1. 18 8月, 2010 1 次提交
    • T
      NFS: Fix an Oops in the NFSv4 atomic open code · 0a377cff
      Trond Myklebust 提交于
      Adam Lackorzynski reports:
      
      with 2.6.35.2 I'm getting this reproducible Oops:
      
      [  110.825396] BUG: unable to handle kernel NULL pointer dereference at
      (null)
      [  110.828638] IP: [<ffffffff811247b7>] encode_attrs+0x1a/0x2a4
      [  110.828638] PGD be89f067 PUD bf18f067 PMD 0
      [  110.828638] Oops: 0000 [#1] SMP
      [  110.828638] last sysfs file: /sys/class/net/lo/operstate
      [  110.828638] CPU 2
      [  110.828638] Modules linked in: rtc_cmos rtc_core rtc_lib amd64_edac_mod
      i2c_amd756 edac_core i2c_core dm_mirror dm_region_hash dm_log dm_snapshot
      sg sr_mod usb_storage ohci_hcd mptspi tg3 mptscsih mptbase usbcore nls_base
      [last unloaded: scsi_wait_scan]
      [  110.828638]
      [  110.828638] Pid: 11264, comm: setchecksum Not tainted 2.6.35.2 #1
      [  110.828638] RIP: 0010:[<ffffffff811247b7>]  [<ffffffff811247b7>]
      encode_attrs+0x1a/0x2a4
      [  110.828638] RSP: 0000:ffff88003bf5b878  EFLAGS: 00010296
      [  110.828638] RAX: ffff8800bddb48a8 RBX: ffff88003bf5bb18 RCX:
      0000000000000000
      [  110.828638] RDX: ffff8800be258800 RSI: 0000000000000000 RDI:
      ffff88003bf5b9f8
      [  110.828638] RBP: 0000000000000000 R08: ffff8800bddb48a8 R09:
      0000000000000004
      [  110.828638] R10: 0000000000000003 R11: ffff8800be779000 R12:
      ffff8800be258800
      [  110.828638] R13: ffff88003bf5b9f8 R14: ffff88003bf5bb20 R15:
      ffff8800be258800
      [  110.828638] FS:  0000000000000000(0000) GS:ffff880041e00000(0063)
      knlGS:00000000556bd6b0
      [  110.828638] CS:  0010 DS: 002b ES: 002b CR0: 000000008005003b
      [  110.828638] CR2: 0000000000000000 CR3: 00000000be8ef000 CR4:
      00000000000006e0
      [  110.828638] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
      0000000000000000
      [  110.828638] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7:
      0000000000000400
      [  110.828638] Process setchecksum (pid: 11264, threadinfo
      ffff88003bf5a000, task ffff88003f232210)
      [  110.828638] Stack:
      [  110.828638]  0000000000000000 ffff8800bfbcf920 0000000000000000
      0000000000000ffe
      [  110.828638] <0> 0000000000000000 0000000000000000 0000000000000000
      0000000000000000
      [  110.828638] <0> 0000000000000000 0000000000000000 0000000000000000
      0000000000000000
      [  110.828638] Call Trace:
      [  110.828638]  [<ffffffff81124c1f>] ? nfs4_xdr_enc_setattr+0x90/0xb4
      [  110.828638]  [<ffffffff81371161>] ? call_transmit+0x1c3/0x24a
      [  110.828638]  [<ffffffff813774d9>] ? __rpc_execute+0x78/0x22a
      [  110.828638]  [<ffffffff81371a91>] ? rpc_run_task+0x21/0x2b
      [  110.828638]  [<ffffffff81371b7e>] ? rpc_call_sync+0x3d/0x5d
      [  110.828638]  [<ffffffff8111e284>] ? _nfs4_do_setattr+0x11b/0x147
      [  110.828638]  [<ffffffff81109466>] ? nfs_init_locked+0x0/0x32
      [  110.828638]  [<ffffffff810ac521>] ? ifind+0x4e/0x90
      [  110.828638]  [<ffffffff8111e2fb>] ? nfs4_do_setattr+0x4b/0x6e
      [  110.828638]  [<ffffffff8111e634>] ? nfs4_do_open+0x291/0x3a6
      [  110.828638]  [<ffffffff8111ed81>] ? nfs4_open_revalidate+0x63/0x14a
      [  110.828638]  [<ffffffff811056c4>] ? nfs_open_revalidate+0xd7/0x161
      [  110.828638]  [<ffffffff810a2de4>] ? do_lookup+0x1a4/0x201
      [  110.828638]  [<ffffffff810a4733>] ? link_path_walk+0x6a/0x9d5
      [  110.828638]  [<ffffffff810a42b6>] ? do_last+0x17b/0x58e
      [  110.828638]  [<ffffffff810a5fbe>] ? do_filp_open+0x1bd/0x56e
      [  110.828638]  [<ffffffff811cd5e0>] ? _atomic_dec_and_lock+0x30/0x48
      [  110.828638]  [<ffffffff810a9b1b>] ? dput+0x37/0x152
      [  110.828638]  [<ffffffff810ae063>] ? alloc_fd+0x69/0x10a
      [  110.828638]  [<ffffffff81099f39>] ? do_sys_open+0x56/0x100
      [  110.828638]  [<ffffffff81027a22>] ? ia32_sysret+0x0/0x5
      [  110.828638] Code: 83 f1 01 e8 f5 ca ff ff 48 83 c4 50 5b 5d 41 5c c3 41
      57 41 56 41 55 49 89 fd 41 54 49 89 d4 55 48 89 f5 53 48 81 ec 18 01 00 00
      <8b> 06 89 c2 83 e2 08 83 fa 01 19 db 83 e3 f8 83 c3 18 a8 01 8d
      [  110.828638] RIP  [<ffffffff811247b7>] encode_attrs+0x1a/0x2a4
      [  110.828638]  RSP <ffff88003bf5b878>
      [  110.828638] CR2: 0000000000000000
      [  112.840396] ---[ end trace 95282e83fd77358f ]---
      
      We need to ensure that the O_EXCL flag is turned off if the user doesn't
      set O_CREAT.
      
      Cc: stable@kernel.org
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0a377cff
  2. 10 8月, 2010 1 次提交
    • N
      NFS: allow close-to-open cache semantics to apply to root of NFS filesystem · f5a73672
      Neil Brown 提交于
      
      
      To obey NFS cache semantics, the client must verify the cached
      attributes when a file is opened.  In most cases this is done by a call to
      d_validate as one of the last steps in path_walk.
      
      However for the root of a filesystem, d_validate is only ever called
      on the mounted-on filesystem (except when the path ends '.' or '..').
      So NFS has no chance to validate the attributes.
      
      So, in nfs_opendir, we revalidate the attributes if the opened
      directory is the mountpoint.  This may cause double-validation for "."
      and ".." lookups, but that is better than missing regular /path/name
      lookups completely.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f5a73672
  3. 04 8月, 2010 1 次提交
  4. 02 8月, 2010 1 次提交
    • E
      vfs: re-introduce MAY_CHDIR · 9cfcac81
      Eric Paris 提交于
      Currently MAY_ACCESS means that filesystems must check the permissions
      right then and not rely on cached results or the results of future
      operations on the object.  This can be because of a call to sys_access() or
      because of a call to chdir() which needs to check search without relying on
      any future operations inside that dir.  I plan to use MAY_ACCESS for other
      purposes in the security system, so I split the MAY_ACCESS and the
      MAY_CHDIR cases.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NStephen D. Smalley <sds@tycho.nsa.gov>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      9cfcac81
  5. 19 7月, 2010 1 次提交
    • D
      mm: add context argument to shrinker callback · 7f8275d0
      Dave Chinner 提交于
      The current shrinker implementation requires the registered callback
      to have global state to work from. This makes it difficult to shrink
      caches that are not global (e.g. per-filesystem caches). Pass the shrinker
      structure to the callback so that users can embed the shrinker structure
      in the context the shrinker needs to operate on and get back to it in the
      callback via container_of().
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      7f8275d0
  6. 28 5月, 2010 1 次提交
  7. 26 5月, 2010 1 次提交
  8. 15 5月, 2010 5 次提交
  9. 29 4月, 2010 1 次提交
  10. 23 4月, 2010 1 次提交
  11. 10 4月, 2010 1 次提交
  12. 11 3月, 2010 1 次提交
  13. 06 3月, 2010 1 次提交
  14. 07 1月, 2010 1 次提交
  15. 04 12月, 2009 4 次提交
  16. 26 10月, 2009 1 次提交
  17. 22 7月, 2009 1 次提交
    • T
      NFSv4: Fix a problem whereby a buggy server can oops the kernel · d953126a
      Trond Myklebust 提交于
      We just had a case in which a buggy server occasionally returns the wrong
      attributes during an OPEN call. While the client does catch this sort of
      condition in nfs4_open_done(), and causes the nfs4_atomic_open() to return
      -EISDIR, the logic in nfs_atomic_lookup() is broken, since it causes a
      fallback to an ordinary lookup instead of just returning the error.
      
      When the buggy server then returns a regular file for the fallback lookup,
      the VFS allows the open, and bad things start to happen, since the open
      file doesn't have any associated NFSv4 state.
      
      The fix is firstly to return the EISDIR/ENOTDIR errors immediately, and
      secondly to ensure that we are always careful when dereferencing the
      nfs_open_context state pointer.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d953126a
  18. 13 7月, 2009 1 次提交
  19. 19 5月, 2009 1 次提交
  20. 28 3月, 2009 1 次提交
  21. 20 3月, 2009 1 次提交
  22. 11 3月, 2009 1 次提交
    • S
      NFS: Handle -ESTALE error in access() · a71ee337
      Suresh Jayaraman 提交于
      Hi Trond,
      
      I have been looking at a bugreport where trying to open applications on KDE
      on a NFS mounted home fails temporarily. There have been multiple reports on
      different kernel versions pointing to this common issue:
      http://bugzilla.kernel.org/show_bug.cgi?id=12557
      https://bugs.launchpad.net/ubuntu/+source/linux/+bug/269954
      http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508866.html
      
      This issue can be reproducible consistently by doing this on a NFS mounted
      home (KDE):
      1. Open 2 xterm sessions
      2. From one of the xterm session, do "ssh -X <remote host>"
      3. "stat ~/.Xauthority" on the remote SSH session
      4. Close the two xterm sessions
      5. On the server do a "stat ~/.Xauthority"
      6. Now on the client, try to open xterm
      This will fail.
      
      Even if the filehandle had become stale, the NFS client should invalidate
      the cache/inode and should repeat LOOKUP. Looking at the packet capture when
      the failure occurs shows that there were two subsequent ACCESS() calls with
      the same filehandle and both fails with -ESTALE error.
      
      I have tested the fix below. Now the client issue a LOOKUP after the
      ACCESS() call fails with -ESTALE. If all this makes sense to you, can you
      consider this for inclusion?
      
      Thanks,
      
      
      If the server returns an -ESTALE error due to stale filehandle in response to
      an ACCESS() call, we need to invalidate the cache and inode so that LOOKUP()
      can be retried. Without this change, the nfs client retries ACCESS() with the
      same filehandle, fails again and could lead to temporary failure of
      applications running on nfs mounted home.
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a71ee337
  23. 24 12月, 2008 4 次提交
  24. 23 10月, 2008 2 次提交
    • M
      [PATCH] move executable checking into ->permission() · f696a365
      Miklos Szeredi 提交于
      For execute permission on a regular files we need to check if file has
      any execute bits at all, regardless of capabilites.
      
      This check is normally performed by generic_permission() but was also
      added to the case when the filesystem defines its own ->permission()
      method.  In the latter case the filesystem should be responsible for
      performing this check.
      
      Move the check from inode_permission() inside filesystems which are
      not calling generic_permission().
      
      Create a helper function execute_ok() that returns true if the inode
      is a directory or if any execute bits are present in i_mode.
      
      Also fix up the following code:
      
       - coda control file is never executable
       - sysctl files are never executable
       - hfs_permission seems broken on MAY_EXEC, remove
       - hfsplus_permission is eqivalent to generic_permission(), remove
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      f696a365
    • A
      [PATCH] make O_EXCL in nd->intent.flags visible in nd->flags · 3516586a
      Al Viro 提交于
      New flag: LOOKUP_EXCL.  Set before doing the final step of pathname
      resolution on the paths that have LOOKUP_CREATE and O_EXCL.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      3516586a
  25. 20 10月, 2008 1 次提交
    • R
      vmscan: split LRU lists into anon & file sets · 4f98a2fe
      Rik van Riel 提交于
      Split the LRU lists in two, one set for pages that are backed by real file
      systems ("file") and one for pages that are backed by memory and swap
      ("anon").  The latter includes tmpfs.
      
      The advantage of doing this is that the VM will not have to scan over lots
      of anonymous pages (which we generally do not want to swap out), just to
      find the page cache pages that it should evict.
      
      This patch has the infrastructure and a basic policy to balance how much
      we scan the anon lists and how much we scan the file lists.  The big
      policy changes are in separate patches.
      
      [lee.schermerhorn@hp.com: collect lru meminfo statistics from correct offset]
      [kosaki.motohiro@jp.fujitsu.com: prevent incorrect oom under split_lru]
      [kosaki.motohiro@jp.fujitsu.com: fix pagevec_move_tail() doesn't treat unevictable page]
      [hugh@veritas.com: memcg swapbacked pages active]
      [hugh@veritas.com: splitlru: BDI_CAP_SWAP_BACKED]
      [akpm@linux-foundation.org: fix /proc/vmstat units]
      [nishimura@mxp.nes.nec.co.jp: memcg: fix handling of shmem migration]
      [kosaki.motohiro@jp.fujitsu.com: adjust Quicklists field of /proc/meminfo]
      [kosaki.motohiro@jp.fujitsu.com: fix style issue of get_scan_ratio()]
      Signed-off-by: NRik van Riel <riel@redhat.com>
      Signed-off-by: NLee Schermerhorn <Lee.Schermerhorn@hp.com>
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NDaisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4f98a2fe
  26. 15 10月, 2008 2 次提交
  27. 08 10月, 2008 1 次提交
    • T
      NFS: Add options for finer control of the lookup cache · 4eec952e
      Trond Myklebust 提交于
      Add the flag NFS_MOUNT_LOOKUP_CACHE_NONEG to turn off the caching of
      negative dentries. In reality what we do is to force
      nfs_lookup_revalidate() to always discard negative dentries.
      
      Add the flag NFS_MOUNT_LOOKUP_CACHE_NONE for enforcing stricter
      revalidation of dentries. It forces the revalidate code to always do a
      lookup instead of just checking the cached mtime of the parent directory.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4eec952e
  28. 27 7月, 2008 1 次提交
    • A
      [PATCH] sanitize ->permission() prototype · e6305c43
      Al Viro 提交于
      * kill nameidata * argument; map the 3 bits in ->flags anybody cares
        about to new MAY_... ones and pass with the mask.
      * kill redundant gfs2_iop_permission()
      * sanitize ecryptfs_permission()
      * fix remaining places where ->permission() instances might barf on new
        MAY_... found in mask.
      
      The obvious next target in that direction is permission(9)
      
      folded fix for nfs_permission() breakage from Miklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e6305c43