1. 05 1月, 2009 2 次提交
    • M
      [SCSI] Fix error handling for DIF/DIX · 3e695f89
      Martin K. Petersen 提交于
      patch
      
      commit b60af5b0
      Author: Alan Stern <stern@rowland.harvard.edu>
      Date:   Mon Nov 3 15:56:47 2008 -0500
      
          [SCSI] simplify scsi_io_completion()
      
      broke DIX error handling.  Also, we are now using EILSEQ to indicate
      integrity errors to the upper layers (as opposed to regular EIO
      failures).  This allows filesystems to inspect buffers and decide
      whether to retry the I/O.  Update scsi_io_completion() accordingly.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      3e695f89
    • J
      [SCSI] scsi_lib: don't decrement busy counters when inserting commands · 4f5299ac
      James Bottomley 提交于
      A bug was introduced by
      
      commit b60af5b0
      Author: Alan Stern <stern@rowland.harvard.edu>
      Date:   Mon Nov 3 15:56:47 2008 -0500
      
          [SCSI] simplify scsi_io_completion()
       
      because the simplification uses scsi_queue_insert().  The problem with
      this function is that it expects to be called from the completion path
      while the command is still outstanding, so it decrements the device
      and host busy counts to do the requeue.  The problem is that
      scsi_io_completion() is a path executed well after these counts have
      *already* been decremented, leading to a double decrement if the
      command goes down any error path leading to ACTION_DELAYED_RETRY.
      
      The fix is to allow a private function __scsi_queue_insert() with a
      flag to say whether the busy counters should be decremented.  This is
      made static to scsi_lib.c to discourage other use.
      Reported-by: NMike Christie <michaelc@cs.wisc.edu>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      4f5299ac
  2. 03 1月, 2009 28 次提交
  3. 01 1月, 2009 10 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 · b58602a4
      Linus Torvalds 提交于
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (34 commits)
        nfsd race fixes: jfs
        nfsd race fixes: reiserfs
        nfsd race fixes: ext4
        nfsd race fixes: ext3
        nfsd race fixes: ext2
        nfsd/create race fixes, infrastructure
        filesystem notification: create fs/notify to contain all fs notification
        fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization
        kill ->dir_notify()
        filp_cachep can be static in fs/file_table.c
        fix f_count description in Documentation/filesystems/files.txt
        make INIT_FS use the __RW_LOCK_UNLOCKED initialization
        take init_fs to saner place
        kill vfs_permission
        pass a struct path * to may_open
        kill walk_init_root
        remove incorrect comment in inode_permission
        expand some comments (d_path / seq_path)
        correct wrong function name of d_put in kernel document and source comment
        fix switch_names() breakage in short-to-short case
        ...
      b58602a4
    • D
      nfsd race fixes: jfs · 1f3403fa
      Dave Kleikamp 提交于
      jfs version of Al Viro's nfsd race patches
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1f3403fa
    • A
      nfsd race fixes: reiserfs · c1eaa26b
      Al Viro 提交于
      ... and the same for reiserfs.  The difference here is that we need
      insert_inode_locked4() to match iget5_locked().
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c1eaa26b
    • A
      nfsd race fixes: ext4 · 6b38e842
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6b38e842
    • A
      nfsd race fixes: ext3 · c38012da
      Al Viro 提交于
      ext3 analog of the previous patch
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c38012da
    • A
      nfsd race fixes: ext2 · 41080b5a
      Al Viro 提交于
      * make ext2_new_inode() put the inode into icache in locked state
      * do not unlock until the inode is fully set up; otherwise nfsd
      might pick it in half-baked state.
      * make sure that ext2_new_inode() does *not* lead to two inodes with the
      same inumber hashed at the same time; otherwise a bogus fhandle coming
      from nfsd might race with inode creation:
      
      nfsd: iget_locked() creates inode
      nfsd: try to read from disk, block on that.
      ext2_new_inode(): allocate inode with that inumber
      ext2_new_inode(): insert it into icache, set it up and dirty
      ext2_write_inode(): get the relevant part of inode table in cache,
      set the entry for our inode (and start writing to disk)
      nfsd: get CPU again, look into inode table, see nice and sane on-disk
      inode, set the in-core inode from it
      
      oops - we have two in-core inodes with the same inumber live in icache,
      both used for IO.  Welcome to fs corruption...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      41080b5a
    • A
      nfsd/create race fixes, infrastructure · 261bca86
      Al Viro 提交于
      new helpers - insert_inode_locked() and insert_inode_locked4().
      Hash new inode, making sure that there's no such inode in icache
      already.  If there is and it does not end up unhashed (as would
      happen if we have nfsd trying to resolve a bogus fhandle), fail.
      Otherwise insert our inode into hash and succeed.
      
      In either case have i_state set to new+locked; cleanup ends up
      being simpler with such calling conventions.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      261bca86
    • E
      filesystem notification: create fs/notify to contain all fs notification · 272eb014
      Eric Paris 提交于
      Creating a generic filesystem notification interface, fsnotify, which will be
      used by inotify, dnotify, and eventually fanotify is really starting to
      clutter the fs directory.  This patch simply moves inotify and dnotify into
      fs/notify/inotify and fs/notify/dnotify respectively to make both current fs/
      and future notification tidier.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      272eb014
    • D
      fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization · c2acf7b9
      Denis ChengRq 提交于
      - iget5_locked in bdget really needs blockdev_superblock, instead of
        bd_mnt, so bd_mnt could be just a local variable;
      
      - blockdev_superblock really needs __read_mostly, while local var bd_mnt
        not;
      
      - make use of sb_is_blkdev_sb in bd_forget, instead of direct reference
        to blockdev_superblock.
      Signed-off-by: NDenis ChengRq <crquan@gmail.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c2acf7b9
    • A
      kill ->dir_notify() · 6badd79b
      Al Viro 提交于
      Remove the hopelessly misguided ->dir_notify().  The only instance (cifs)
      has been broken by design from the very beginning; the objects it creates
      are never destroyed, keep references to struct file they can outlive, nothing
      that could possibly evict them exists on close(2) path *and* no locking
      whatsoever is done to prevent races with close(), should the previous, er,
      deficiencies someday be dealt with.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6badd79b