1. 01 8月, 2011 1 次提交
    • J
      cifs: simplify refcounting for oplock breaks · ad635942
      Jeff Layton 提交于
      Currently, we take a sb->s_active reference and a cifsFileInfo reference
      when an oplock break workqueue job is queued. This is unnecessary and
      more complicated than it needs to be. Also as Al points out,
      deactivate_super has non-trivial locking implications so it's best to
      avoid that if we can.
      
      Instead, just cancel any pending oplock breaks for this filehandle
      synchronously in cifsFileInfo_put after taking it off the lists.
      That should ensure that this job doesn't outlive the structures it
      depends on.
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ad635942
  2. 21 7月, 2011 2 次提交
  3. 27 5月, 2011 3 次提交
  4. 26 5月, 2011 1 次提交
    • J
      cifs: convert cifs_writepages to use async writes · c3d17b63
      Jeff Layton 提交于
      Have cifs_writepages issue asynchronous writes instead of waiting on
      each write call to complete before issuing another. This also allows us
      to return more quickly from writepages. It can just send out all of the
      I/Os and not wait around for the replies.
      
      In the WB_SYNC_ALL case, if the write completes with a retryable error,
      then the completion workqueue job will resend the write.
      
      This also changes the page locking semantics a little bit. Instead of
      holding the page lock until the response is received, release it after
      doing the send. This will reduce contention for the page lock and should
      prevent processes that have the file mmap'ed from being blocked
      unnecessarily.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-and-Tested-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      c3d17b63
  5. 19 5月, 2011 3 次提交
  6. 12 4月, 2011 3 次提交
    • J
      cifs: don't allow mmap'ed pages to be dirtied while under writeback (try #3) · ca83ce3d
      Jeff Layton 提交于
      This is more or less the same patch as before, but with some merge
      conflicts fixed up.
      
      If a process has a dirty page mapped into its page tables, then it has
      the ability to change it while the client is trying to write the data
      out to the server. If that happens after the signature has been
      calculated then that signature will then be wrong, and the server will
      likely reset the TCP connection.
      
      This patch adds a page_mkwrite handler for CIFS that simply takes the
      page lock. Because the page lock is held over the life of writepage and
      writepages, this prevents the page from becoming writeable until
      the write call has completed.
      
      With this, we can also remove the "sign_zero_copy" module option and
      always inline the pages when writing.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ca83ce3d
    • J
      cifs: replace /proc/fs/cifs/Experimental with a module parm · bdf1b03e
      Jeff Layton 提交于
      This flag currently only affects whether we allow "zero-copy" writes
      with signing enabled. Typically we map pages in the pagecache directly
      into the write request. If signing is enabled however and the contents
      of the page change after the signature is calculated but before the
      write is sent then the signature will be wrong. Servers typically
      respond to this by closing down the socket.
      
      Still, this can provide a performance benefit so the "Experimental" flag
      was overloaded to allow this. That's really not a good place for this
      option however since it's not clear what that flag does.
      
      Move that flag instead to a new module parameter that better describes
      its purpose. That's also better since it can be set at module insertion
      time by configuring modprobe.d.
      Reviewed-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      bdf1b03e
    • J
      cifs: check for private_data before trying to put it · 77970693
      Jeff Layton 提交于
      cifs_close doesn't check that the filp->private_data is non-NULL before
      trying to put it. That can cause an oops in certain error conditions
      that can occur on open or lookup before the private_data is set.
      Reported-by: NBen Greear <greearb@candelatech.com>
      CC: Stable <stable@kernel.org>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      77970693
  7. 10 3月, 2011 1 次提交
  8. 04 2月, 2011 1 次提交
  9. 31 1月, 2011 1 次提交
    • J
      cifs: clean up some compiler warnings · 31c2659d
      Jeff Layton 提交于
      New compiler warnings that I noticed when building a patchset based
      on recent Fedora kernel:
      
      fs/cifs/cifssmb.c: In function 'CIFSSMBSetFileSize':
      fs/cifs/cifssmb.c:4813:8: warning: variable 'data_offset' set but not used
      [-Wunused-but-set-variable]
      
      fs/cifs/file.c: In function 'cifs_open':
      fs/cifs/file.c:349:24: warning: variable 'pCifsInode' set but not used
      [-Wunused-but-set-variable]
      fs/cifs/file.c: In function 'cifs_partialpagewrite':
      fs/cifs/file.c:1149:23: warning: variable 'cifs_sb' set but not used
      [-Wunused-but-set-variable]
      fs/cifs/file.c: In function 'cifs_iovec_write':
      fs/cifs/file.c:1740:9: warning: passing argument 6 of 'CIFSSMBWrite2' from
      incompatible pointer type [enabled by default]
      fs/cifs/cifsproto.h:337:12: note: expected 'unsigned int *' but argument is
      of type 'size_t *'
      
      fs/cifs/readdir.c: In function 'cifs_readdir':
      fs/cifs/readdir.c:767:23: warning: variable 'cifs_sb' set but not used
      [-Wunused-but-set-variable]
      
      fs/cifs/cifs_dfs_ref.c: In function 'cifs_dfs_d_automount':
      fs/cifs/cifs_dfs_ref.c:342:2: warning: 'rc' may be used uninitialized in
      this function [-Wuninitialized]
      fs/cifs/cifs_dfs_ref.c:278:6: note: 'rc' was declared here
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      31c2659d
  10. 26 1月, 2011 1 次提交
  11. 21 1月, 2011 5 次提交
  12. 20 1月, 2011 2 次提交
    • J
      cifs: don't fail writepages on -EAGAIN errors · 941b853d
      Jeff Layton 提交于
      If CIFSSMBWrite2 returns -EAGAIN, then the error should be considered
      temporary. CIFS should retry the write instead of setting an error on
      the mapping and returning.
      
      For WB_SYNC_ALL, just retry the write immediately. In the WB_SYNC_NONE
      case, call redirty_page_for_writeback on all of the pages that didn't
      get written out and then move on.
      
      Also, fix up the handling of a short write with a successful return
      code. MS-CIFS says that 0 bytes_written means ENOSPC or EFBIG. It
      doesn't mention what a short, but non-zero write means, so for now
      treat it as we would an -EAGAIN return.
      Reviewed-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Reviewed-by: NPavel Shilovsky <piastryyy@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      941b853d
    • P
      CIFS: Fix oplock break handling (try #2) · 12fed00d
      Pavel Shilovsky 提交于
      When we get oplock break notification we should set the appropriate
      value of OplockLevel field in oplock break acknowledge according to
      the oplock level held by the client in this time. As we only can have
      level II oplock or no oplock in the case of oplock break, we should be
      aware only about clientCanCacheRead field in cifsInodeInfo structure.
      
      Also fix bug connected with wrong interpretation of OplockLevel field
      during oplock break notification processing.
      Signed-off-by: NPavel Shilovsky <piastryyy@gmail.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      12fed00d
  13. 10 1月, 2011 1 次提交
  14. 07 1月, 2011 2 次提交
  15. 07 12月, 2010 1 次提交
  16. 10 11月, 2010 1 次提交
  17. 06 11月, 2010 1 次提交
  18. 05 11月, 2010 1 次提交
    • J
      cifs: dereferencing first then checking · d3892294
      Jeff Layton 提交于
      This patch is based on Dan's original patch. His original description is
      below:
      
      Smatch complained about a couple checking for NULL after dereferencing
      bugs.  I'm not super familiar with the code so I did the conservative
      thing and move the dereferences after the checks.
      
      The dereferences in cifs_lock() and cifs_fsync() were added in
      ba00ba64 "cifs: make various routines use the cifsFileInfo->tcon
      pointer".  The dereference in find_writable_file() was added in
      6508d904 "cifs: have find_readable/writable_file filter by fsuid".
      The comments there say it's possible to trigger the NULL dereference
      under stress.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d3892294
  19. 03 11月, 2010 2 次提交
  20. 02 11月, 2010 1 次提交
    • J
      FS: cifs, remove unneeded NULL tests · 50ae28f0
      Jiri Slaby 提交于
      Stanse found that pSMBFile in cifs_ioctl and file->f_path.dentry in
      cifs_user_write are dereferenced prior their test to NULL.
      
      The alternative is not to dereference them before the tests. The patch is
      to point out the problem, you have to decide.
      
      While at it we cache the inode in cifs_user_write to a local variable
      and use all over the function.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Steve French <sfrench@samba.org>
      Cc: linux-cifs@vger.kernel.org
      Cc: Jeff Layton <jlayton@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      50ae28f0
  21. 28 10月, 2010 1 次提交
  22. 27 10月, 2010 1 次提交
    • W
      writeback: remove nonblocking/encountered_congestion references · 1b430bee
      Wu Fengguang 提交于
      This removes more dead code that was somehow missed by commit 0d99519e
      (writeback: remove unused nonblocking and congestion checks).  There are
      no behavior change except for the removal of two entries from one of the
      ext4 tracing interface.
      
      The nonblocking checks in ->writepages are no longer used because the
      flusher now prefer to block on get_request_wait() than to skip inodes on
      IO congestion.  The latter will lead to more seeky IO.
      
      The nonblocking checks in ->writepage are no longer used because it's
      redundant with the WB_SYNC_NONE check.
      
      We no long set ->nonblocking in VM page out and page migration, because
      a) it's effectively redundant with WB_SYNC_NONE in current code
      b) it's old semantic of "Don't get stuck on request queues" is mis-behavior:
         that would skip some dirty inodes on congestion and page out others, which
         is unfair in terms of LRU age.
      
      Inspired by Christoph Hellwig. Thanks!
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      Cc: Theodore Ts'o <tytso@mit.edu>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Sage Weil <sage@newdream.net>
      Cc: Steve French <sfrench@samba.org>
      Cc: Chris Mason <chris.mason@oracle.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1b430bee
  23. 25 10月, 2010 4 次提交