1. 01 4月, 2009 1 次提交
    • N
      mm: page_mkwrite change prototype to match fault · c2ec175c
      Nick Piggin 提交于
      Change the page_mkwrite prototype to take a struct vm_fault, and return
      VM_FAULT_xxx flags.  There should be no functional change.
      
      This makes it possible to return much more detailed error information to
      the VM (and also can provide more information eg.  virtual_address to the
      driver, which might be important in some special cases).
      
      This is required for a subsequent fix.  And will also make it easier to
      merge page_mkwrite() with fault() in future.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <joel.becker@oracle.com>
      Cc: Artem Bityutskiy <dedekind@infradead.org>
      Cc: Felix Blyakher <felixb@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c2ec175c
  2. 31 3月, 2009 1 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
  3. 29 3月, 2009 5 次提交
  4. 28 3月, 2009 1 次提交
  5. 20 3月, 2009 3 次提交
  6. 13 3月, 2009 1 次提交
  7. 12 3月, 2009 14 次提交
  8. 11 3月, 2009 4 次提交
    • I
      Bug 11061, NFS mounts dropped · d7371c41
      Ian Dall 提交于
      Addresses: http://bugzilla.kernel.org/show_bug.cgi?id=11061
      
      sockaddr structures can't be reliably compared using memcmp() because
      there are padding bytes in the structure which can't be guaranteed to
      be the same even when the sockaddr structures refer to the same
      socket. Instead compare all the relevant fields. In the case of IPv6
      sin6_flowinfo is not compared because it only affects QoS and
      sin6_scope_id is only compared if the address is "link local" because
      "link local" addresses need only be unique to a specific link.
      Signed-off-by: NIan Dall <ian@beware.dropbear.id.au>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d7371c41
    • 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
    • T
      NFSv3: Fix posix ACL code · ae46141f
      Trond Myklebust 提交于
      Fix a memory leak due to allocation in the XDR layer. In cases where the
      RPC call needs to be retransmitted, we end up allocating new pages without
      clearing the old ones. Fix this by moving the allocation into
      nfs3_proc_setacls().
      
      Also fix an issue discovered by Kevin Rudd, whereby the amount of memory
      reserved for the acls in the xdr_buf->head was miscalculated, and causing
      corruption.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ae46141f
    • T
      NFS: Fix misparsing of nfsv4 fs_locations attribute (take 2) · ef95d31e
      Trond Myklebust 提交于
      The changeset ea31a443 (nfs: Fix
      misparsing of nfsv4 fs_locations attribute) causes the mountpath that is
      calculated at the beginning of try_location() to be clobbered when we
      later strncpy a non-nul terminated hostname using an incorrect buffer
      length.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ef95d31e
  9. 22 1月, 2009 1 次提交
  10. 05 1月, 2009 1 次提交
    • N
      fs: symlink write_begin allocation context fix · 54566b2c
      Nick Piggin 提交于
      With the write_begin/write_end aops, page_symlink was broken because it
      could no longer pass a GFP_NOFS type mask into the point where the
      allocations happened.  They are done in write_begin, which would always
      assume that the filesystem can be entered from reclaim.  This bug could
      cause filesystem deadlocks.
      
      The funny thing with having a gfp_t mask there is that it doesn't really
      allow the caller to arbitrarily tinker with the context in which it can be
      called.  It couldn't ever be GFP_ATOMIC, for example, because it needs to
      take the page lock.  The only thing any callers care about is __GFP_FS
      anyway, so turn that into a single flag.
      
      Add a new flag for write_begin, AOP_FLAG_NOFS.  Filesystems can now act on
      this flag in their write_begin function.  Change __grab_cache_page to
      accept a nofs argument as well, to honour that flag (while we're there,
      change the name to grab_cache_page_write_begin which is more instructive
      and does away with random leading underscores).
      
      This is really a more flexible way to go in the end anyway -- if a
      filesystem happens to want any extra allocations aside from the pagecache
      ones in ints write_begin function, it may now use GFP_KERNEL (rather than
      GFP_NOFS) for common case allocations (eg.  ocfs2_alloc_write_ctxt, for a
      random example).
      
      [kosaki.motohiro@jp.fujitsu.com: fix ubifs]
      [kosaki.motohiro@jp.fujitsu.com: fix fuse]
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.28.x]
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      [ Cleaned up the calling convention: just pass in the AOP flags
        untouched to the grab_cache_page_write_begin() function.  That
        just simplifies everybody, and may even allow future expansion of the
        logic.   - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      54566b2c
  11. 31 12月, 2008 1 次提交
  12. 24 12月, 2008 7 次提交