1. 20 3月, 2008 9 次提交
    • R
      fs: fix kernel-doc notation warnings · a6b91919
      Randy Dunlap 提交于
      Fix kernel-doc notation warnings in fs/.
      
      Warning(mmotm-2008-0314-1449//fs/super.c:560): missing initial short description on line:
       *	mark_files_ro
      Warning(mmotm-2008-0314-1449//fs/locks.c:1277): missing initial short description on line:
       *	lease_get_mtime
      Warning(mmotm-2008-0314-1449//fs/locks.c:1277): missing initial short description on line:
       *	lease_get_mtime
      Warning(mmotm-2008-0314-1449//fs/namei.c:1368): missing initial short description on line:
       * lookup_one_len:  filesystem helper to lookup single pathname component
      Warning(mmotm-2008-0314-1449//fs/buffer.c:3221): missing initial short description on line:
       * bh_uptodate_or_lock: Test whether the buffer is uptodate
      Warning(mmotm-2008-0314-1449//fs/buffer.c:3240): missing initial short description on line:
       * bh_submit_read: Submit a locked buffer for reading
      Warning(mmotm-2008-0314-1449//fs/fs-writeback.c:30): missing initial short description on line:
       * writeback_acquire: attempt to get exclusive writeback access to a device
      Warning(mmotm-2008-0314-1449//fs/fs-writeback.c:47): missing initial short description on line:
       * writeback_in_progress: determine whether there is writeback in progress
      Warning(mmotm-2008-0314-1449//fs/fs-writeback.c:58): missing initial short description on line:
       * writeback_release: relinquish exclusive writeback access against a device.
      Warning(mmotm-2008-0314-1449//include/linux/jbd.h:351): contents before sections
      Warning(mmotm-2008-0314-1449//include/linux/jbd.h:561): contents before sections
      Warning(mmotm-2008-0314-1449//fs/jbd/transaction.c:1935): missing initial short description on line:
       * void journal_invalidatepage()
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6b91919
    • M
      eCryptfs: Swap dput() and mntput() · 5366dc9f
      Michael Halcrow 提交于
      ecryptfs_d_release() is doing a mntput before doing the dput.  This patch
      moves the dput before the mntput.
      
      Thanks to Rajouri Jammu for reporting this.
      Signed-off-by: NMichael Halcrow <mhalcrow@us.ibm.com>
      Cc: Rajouri Jammu <rajouri.jammu@gmail.com>
      Cc: Eric Sandeen <sandeen@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5366dc9f
    • D
      jbd2: correctly unescape journal data blocks · d0025676
      Duane Griffin 提交于
      Fix a long-standing typo (predating git) that will cause data corruption if a
      journal data block needs unescaping.  At the moment the wrong buffer head's
      data is being unescaped.
      
      To test this case mount a filesystem with data=journal, start creating and
      deleting a bunch of files containing only JBD2_MAGIC_NUMBER (0xc03b3998), then
      pull the plug on the device.  Without this patch the files will contain zeros
      instead of the correct data after recovery.
      Signed-off-by: NDuane Griffin <duaneg@dghda.com>
      Acked-by: NJan Kara <jack@suse.cz>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d0025676
    • D
      jbd: correctly unescape journal data blocks · 439aeec6
      Duane Griffin 提交于
      Fix a long-standing typo (predating git) that will cause data corruption if a
      journal data block needs unescaping.  At the moment the wrong buffer head's
      data is being unescaped.
      
      To test this case mount a filesystem with data=journal, start creating and
      deleting a bunch of files containing only JFS_MAGIC_NUMBER (0xc03b3998), then
      pull the plug on the device.  Without this patch the files will contain zeros
      instead of the correct data after recovery.
      Signed-off-by: NDuane Griffin <duaneg@dghda.com>
      Acked-by: NJan Kara <jack@suse.cz>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      439aeec6
    • D
      ROMFS: Fix up an error in iget removal · 4ebf8984
      David Howells 提交于
      Fix up an error in iget removal in which romfs_lookup() making a successful
      call to romfs_iget() continues through the negative/error handling (previously
      the successful case jumped around the negative/error handling case):
      
       (1) inode is initialised to NULL at the top of the function, eliminating the
           need for specific negative-inode handling.  This means the positive
           success handling now flows straight through.
      
       (2) Rename the labels to be clearer about what they mean.
      
      Also make romfs_lookup()'s result variable of type long so as to avoid
      32-bit/64-bit conversions with PTR_ERR() and friends.
      
      Based upon a report and patch from Adam Richter.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: N"Adam J. Richter" <adam@yggdrasil.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4ebf8984
    • J
      ext3: fix wrong gfp type under transaction · c587f0c0
      Josef Bacik 提交于
      There are several places where we make allocations with GFP_KERNEL while under
      a transaction, which could lead to an assertion panic or lockup if under
      memory pressure.  This patch switches these problem areas to use GFP_NOFS to
      keep these problems from happening.
      Signed-off-by: NJosef Bacik <jbacik@redhat.com>
      Cc: <linux-ext4@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c587f0c0
    • J
      quota: add possibly missing iput() when quotaon and quotaoff races · 87cb055b
      Jan Kara 提交于
      We should always put inode we have reference to, even if quota was reenabled
      in the mean time.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      87cb055b
    • R
      jbd: fix jbd kernel-doc notation · 0cf01f66
      Randy Dunlap 提交于
      Fix kernel-doc notation in jbd.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0cf01f66
    • Q
      aio: bad AIO race in aio_complete() leads to process hang · 6cb2a210
      Quentin Barnes 提交于
      My group ran into a AIO process hang on a 2.6.24 kernel with the process
      sleeping indefinitely in io_getevents(2) waiting for the last wakeup to come
      and it never would.
      
      We ran the tests on x86_64 SMP.  The hang only occurred on a Xeon box
      ("Clovertown") but not a Core2Duo ("Conroe").  On the Xeon, the L2 cache isn't
      shared between all eight processors, but is L2 is shared between between all
      two processors on the Core2Duo we use.
      
      My analysis of the hang is if you go down to the second while-loop
      in read_events(), what happens on processor #1:
      	1) add_wait_queue_exclusive() adds thread to ctx->wait
      	2) aio_read_evt() to check tail
      	3) if aio_read_evt() returned 0, call [io_]schedule() and sleep
      
      In aio_complete() with processor #2:
      	A) info->tail = tail;
      	B) waitqueue_active(&ctx->wait)
      	C) if waitqueue_active() returned non-0, call wake_up()
      
      The way the code is written, step 1 must be seen by all other processors
      before processor 1 checks for pending events in step 2 (that were recorded by
      step A) and step A by processor 2 must be seen by all other processors
      (checked in step 2) before step B is done.
      
      The race I believed I was seeing is that steps 1 and 2 were
      effectively swapped due to the __list_add() being delayed by the L2
      cache not shared by some of the other processors.  Imagine:
      proc 2: just before step A
      proc 1, step 1: adds to ctx->wait, but is not visible by other processors yet
      proc 1, step 2: checks tail and sees no pending events
      proc 2, step A: updates tail
      proc 1, step 3: calls [io_]schedule() and sleeps
      proc 2, step B: checks ctx->wait, but sees no one waiting, skips wakeup
                      so proc 1 sleeps indefinitely
      
      My patch adds a memory barrier between steps A and B.  It ensures that the
      update in step 1 gets seen on processor 2 before continuing.  If processor 1
      was just before step 1, the memory barrier makes sure that step A (update
      tail) gets seen by the time processor 1 makes it to step 2 (check tail).
      
      Before the patch our AIO process would hang virtually 100% of the time.  After
      the patch, we have yet to see the process ever hang.
      Signed-off-by: NQuentin Barnes <qbarnes+linux@yahoo-inc.com>
      Reviewed-by: NZach Brown <zach.brown@oracle.com>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Cc: <stable@kernel.org>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      [ We should probably disallow that "if (waitqueue_active()) wake_up()"
        coding pattern, because it's so often buggy wrt memory ordering ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6cb2a210
  2. 18 3月, 2008 3 次提交
  3. 15 3月, 2008 1 次提交
    • J
      nfsd: fix oops on access from high-numbered ports · b663c6fd
      J. Bruce Fields 提交于
      This bug was always here, but before my commit 6fa02839
      ("recheck for secure ports in fh_verify"), it could only be triggered by
      failure of a kmalloc().  After that commit it could be triggered by a
      client making a request from a non-reserved port for access to an export
      marked "secure".  (Exports are "secure" by default.)
      
      The result is a struct svc_export with a reference count one too low,
      resulting in likely oopses next time the export is accessed.
      
      The reference counting here is not straightforward; a later patch will
      clean up fh_verify().
      
      Thanks to Lukas Hejtmanek for the bug report and followup.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Lukas Hejtmanek <xhejtman@ics.muni.cz>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b663c6fd
  4. 14 3月, 2008 1 次提交
  5. 12 3月, 2008 1 次提交
  6. 11 3月, 2008 11 次提交
  7. 08 3月, 2008 4 次提交
    • T
      NFS: Fix dentry revalidation for NFSv4 referrals and mountpoint crossings · 4e99a1ff
      Trond Myklebust 提交于
      As long as the directory contents haven't changed, we should just let the
      path walk proceed to cross the mountpoint. Apart from being an optimisation
      in the case of 'nohide' mountpoint traversals, it also fixes an issue with
      referrals: referral inodes don't have valid filehandles, so calling
      nfs_revalidate_inode() on them is a bug.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4e99a1ff
    • T
      NFS: Fix the fsid revalidation in nfs_update_inode() · c37dcd33
      Trond Myklebust 提交于
      When we detect that we've crossed a mountpoint on the remote server, we
      must take care not to use that inode to revalidate the fsid on our
      current superblock. To do so, we label the inode as a remote mountpoint,
      and check for that in nfs_update_inode().
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c37dcd33
    • T
      NFS: Fix an f_mode/f_flags confusion in fs/nfs/write.c · af1b8c2f
      Trond Myklebust 提交于
      O_SYNC is stored in filp->f_flags.
      Thanks to Al Viro for pointing out the bug.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      af1b8c2f
    • P
      [NET]: Make /proc/net a symlink on /proc/self/net (v3) · e9720acd
      Pavel Emelyanov 提交于
      Current /proc/net is done with so called "shadows", but current
      implementation is broken and has little chances to get fixed.
      
      The problem is that dentries subtree of /proc/net directory has
      fancy revalidation rules to make processes living in different
      net namespaces see different entries in /proc/net subtree, but
      currently, tasks see in the /proc/net subdir the contents of any
      other namespace, depending on who opened the file first.
      
      The proposed fix is to turn /proc/net into a symlink, which points
      to /proc/self/net, which in turn shows what previously was in
      /proc/net - the network-related info, from the net namespace the
      appropriate task lives in.
      
      # ls -l /proc/net
      lrwxrwxrwx  1 root root 8 Mar  5 15:17 /proc/net -> self/net
      
      In other words - this behaves like /proc/mounts, but unlike
      "mounts", "net" is not a file, but a directory.
      
      Changes from v2:
      * Fixed discrepancy of /proc/net nlink count and selinux labeling
        screwup pointed out by Stephen.
      
        To get the correct nlink count the ->getattr callback for /proc/net
        is overridden to read one from the net->proc_net entry.
      
        To make selinux still work the net->proc_net entry is initialized
        properly, i.e. with the "net" name and the proc_net parent.
      
      Selinux fixes are
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      
      Changes from v1:
      * Fixed a task_struct leak in get_proc_task_net, pointed out by Paul.
      Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
      Acked-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e9720acd
  8. 06 3月, 2008 4 次提交
    • D
      [XFS] fix inode leak in xfs_iget_core() · 72772a3b
      David Chinner 提交于
      If the radix_tree_preload() fails, we need to destroy the inode we just
      read in before trying again. This could leak xfs_vnode structures when
      there is memory pressure. Noticed by Christoph Hellwig.
      
      SGI-PV: 977823
      SGI-Modid: xfs-linux-melb:xfs-kern:30606a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      72772a3b
    • D
      [XFS] 977545 977545 977545 977545 977545 977545 xfsaild causing too many · 92d9cd10
      David Chinner 提交于
      wakeups
      
      Idle state is not being detected properly by the xfsaild push code. The
      current idle state is detected by an empty list which may never happen
      with mostly idle filesystem or one using lazy superblock counters. A
      single dirty item in the list that exists beyond the push target can
      result repeated looping attempting to push up to the target because it
      fails to check if the push target has been acheived or not.
      
      Fix by considering a dirty list with everything past the target as an idle
      state and set the timeout appropriately.
      
      SGI-PV: 977545
      SGI-Modid: xfs-linux-melb:xfs-kern:30532a
      Signed-off-by: NDavid Chinner <dgc@sgi.com>
      Signed-off-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
      92d9cd10
    • E
      NFS: use new LSM interfaces to explicitly set mount options · f9c3a380
      Eric Paris 提交于
      NFS and SELinux worked together previously because SELinux had NFS
      specific knowledge built in.  This design was approved by both groups
      back in 2004 but the recent NFS changes to use nfs_parsed_mount_data and
      the usage of nfs_clone_mount_data showed this to be a poor fragile
      solution.  This patch fixes the NFS functionality regression by making
      use of the new LSM interfaces to allow an FS to explicitly set its own
      mount options.
      
      The explicit setting of mount options is done in the nfs get_sb
      functions which are called before the generic vfs hooks try to set mount
      options for filesystems which use text mount data.
      
      This does not currently support NFSv4 as that functionality did not
      exist in previous kernels and thus there is no regression.  I will be
      adding the needed code, which I believe to be the exact same as the v3
      code, in nfs4_get_sb for 2.6.26.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      f9c3a380
    • E
      LSM/SELinux: Interfaces to allow FS to control mount options · e0007529
      Eric Paris 提交于
      Introduce new LSM interfaces to allow an FS to deal with their own mount
      options.  This includes a new string parsing function exported from the
      LSM that an FS can use to get a security data blob and a new security
      data blob.  This is particularly useful for an FS which uses binary
      mount data, like NFS, which does not pass strings into the vfs to be
      handled by the loaded LSM.  Also fix a BUG() in both SELinux and SMACK
      when dealing with binary mount data.  If the binary mount data is less
      than one page the copy_page() in security_sb_copy_data() can cause an
      illegal page fault and boom.  Remove all NFSisms from the SELinux code
      since they were broken by past NFS changes.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
      Acked-by: NCasey Schaufler <casey@schaufler-ca.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      e0007529
  9. 05 3月, 2008 6 次提交