1. 16 12月, 2012 1 次提交
    • T
      NFS: Don't use SetPageError in the NFS writeback code · ada8e20d
      Trond Myklebust 提交于
      The writeback code is already capable of passing errors back to user space
      by means of the open_context->error. In the case of ENOSPC, Neil Brown
      is reporting seeing 2 errors being returned.
      
      Neil writes:
      
      "e.g. if /mnt2/ if an nfs mounted filesystem that has no space then
      
      strace dd if=/dev/zero conv=fsync >> /mnt2/afile count=1
      
      reported Input/output error and the relevant parts of the strace output are:
      
      write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
      fsync(1)                                = -1 EIO (Input/output error)
      close(1)                                = -1 ENOSPC (No space left on device)"
      
      Neil then shows that the duplication of error messages appears to be due to
      the use of the PageError() mechanism, which causes filemap_fdatawait_range
      to return the extra EIO. The regression was introduced by
      commit 7b281ee0 (NFS: fsync() must exit
      with an error if page writeback failed).
      
      Fix this by removing the call to SetPageError(), and just relying on
      open_context->error reporting the ENOSPC back to fsync().
      Reported-by: NNeil Brown <neilb@suse.de>
      Tested-by: NNeil Brown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@vger.kernel.org [3.6+]
      ada8e20d
  2. 11 12月, 2012 1 次提交
    • J
      nfs: don't extend writes to cover entire page if pagecache is invalid · 81d9bce5
      Jeff Layton 提交于
      Jian reported that the following sequence would leave "testfile" with
      corrupt data:
      
          # mount localhost:/export /mnt/nfs/ -o vers=3
          # echo abc > /mnt/nfs/testfile; echo def >> /export/testfile; echo ghi >> /mnt/nfs/testfile
          # cat -v /export/testfile
          abc
          ^@^@^@^@ghi
      
      While there's no locking involved here, the operations are serialized,
      so CTO should prevent corruption.
      
      The first write to the file is fine and writes 4 bytes. The file is then
      extended on the server. When it's reopened a GETATTR is issued and the
      size change is noticed. This causes NFS_INO_INVALID_DATA to be set on
      the file. Because the file is opened for write only,
      nfs_want_read_modify_write() returns 0 to nfs_write_begin().
      nfs_updatepage then calls nfs_write_pageuptodate() to see if it should
      extend the nfs_page to cover the whole page. NFS_INO_INVALID_DATA is
      still set on the file at that point, but that flag is ignored and
      nfs_pageuptodate erroneously extends the write to cover the whole page,
      with the write done on the server side filled in with zeroes.
      
      This patch just has that function check for NFS_INO_INVALID_DATA in
      addition to NFS_INO_REVAL_PAGECACHE. This fixes the bug, but looking
      over the code, I wonder if we might have a similar bug in
      nfs_revalidate_size(). The difference between those two flags is very
      subtle, so it seems like we ought to be checking for
      NFS_INO_INVALID_DATA in most of the places that we look for
      NFS_INO_REVAL_PAGECACHE.
      
      I believe this is regression introduced by commit 8d197a56. The code
      did check for NFS_INO_INVALID_DATA prior to that patch.
      
      Original bug report is here:
      
          https://bugzilla.redhat.com/show_bug.cgi?id=885743
      
      Cc: <stable@vger.kernel.org> # 3.5+
      Reported-by: NJian Li <jiali@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      81d9bce5
  3. 26 11月, 2012 1 次提交
  4. 05 11月, 2012 1 次提交
  5. 29 9月, 2012 2 次提交
  6. 03 8月, 2012 1 次提交
  7. 01 8月, 2012 3 次提交
  8. 31 7月, 2012 4 次提交
  9. 29 6月, 2012 4 次提交
  10. 06 6月, 2012 1 次提交
    • T
      NFS: Fix a commit bug · 9bce008b
      Trond Myklebust 提交于
      The new commit code fails to copy the verifier into the wb_verf field
      of _all_ the nfs_page structures; it only copies it into the first entry.
      The consequence is that most requests end up failing to match in
      nfs_commit_release.
      
      Fix is to copy the verifier into the req->wb_verf field in
      nfs_write_completion.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Fred Isaman <iisaman@netapp.com>
      9bce008b
  11. 20 5月, 2012 1 次提交
  12. 10 5月, 2012 4 次提交
  13. 02 5月, 2012 2 次提交
  14. 01 5月, 2012 1 次提交
  15. 28 4月, 2012 13 次提交