make st seekable again
Subsystems (2)
PATCH 5/5 make st seekable again
From: Kai Makisara <[email protected]>
Apparently `tar' errors out if it cannot perform lseek() against a tape. Work around that in-kernel.
Signed-off-by Kai Makisara <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
25-akpm/drivers/ide/ide-tape.c | 8 +++++++- 25-akpm/drivers/scsi/osst.c | 8 +++++++- 25-akpm/drivers/scsi/st.c | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-)
drivers/ide/ide-tape.c renamed from drivers/ide/ide-tape.c~make-st-seekable-again +7 -1
@@ -4100,7 +4100,13 @@ static int idetape_chrdev_open (struct iidetape_pc_t pc;int retval; -nonseekable_open (inode, filp); +/* +* We really want to do nonseekable_open(inode, filp); here, but some +* versions of tar incorrectly call lseek on tapes and bail out if that +* fails. So we disallow pread() and pwrite(), but permit lseeks. +*/ + filp->f_mode &= ~(FMODE_PREAD |FMODE_PWRITE ); +#if IDETAPE_DEBUG_LOG printk (KERN_INFO "ide-tape: Reached idetape_chrdev_open\n" );#endif /* IDETAPE_DEBUG_LOG */
drivers/scsi/st.c renamed from drivers/scsi/st.c~make-st-seekable-again +7 -1
@@ -1004,7 +1004,13 @@ static int st_open(struct inode *inode,int dev =TAPE_NR (inode);char *name; -nonseekable_open (inode, filp); +/* +* We really want to do nonseekable_open(inode, filp); here, but some +* versions of tar incorrectly call lseek on tapes and bail out if that +* fails. So we disallow pread() and pwrite(), but permit lseeks. +*/ + filp->f_mode &= ~(FMODE_PREAD |FMODE_PWRITE ); +write_lock (&st_dev_arr_lock);if (dev >= st_dev_max || scsi_tapes ==NULL || ((STp = scsi_tapes[dev]) ==NULL )) {
drivers/scsi/osst.c renamed from drivers/scsi/osst.c~make-st-seekable-again +7 -1
@@ -4318,7 +4318,13 @@ static int os_scsi_tape_open(struct inodint dev =TAPE_NR (inode);int mode =TAPE_MODE (inode); -nonseekable_open (inode, filp); +/* +* We really want to do nonseekable_open(inode, filp); here, but some +* versions of tar incorrectly call lseek on tapes and bail out if that +* fails. So we disallow pread() and pwrite(), but permit lseeks. +*/ + filp->f_mode &= ~(FMODE_PREAD |FMODE_PWRITE ); +write_lock (&os_scsi_tapes_lock);if (dev >= osst_max_dev || os_scsi_tapes ==NULL || (STp = os_scsi_tapes[dev]) ==NULL || !STp->device) {
_
Quoted 8 lines · On Fri, Mar 04, 2005 at 01:16:58PM -0800, [email protected] wrote:
From: Kai Makisara <[email protected]>
Apparently `tar' errors out if it cannot perform
lseek()against a tape. Work around that in-kernel.Signed-off-by Kai Makisara <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Added to the -stable queue, thanks.
greg k-h