1. 07 5月, 2014 13 次提交
  2. 28 4月, 2014 7 次提交
  3. 08 4月, 2014 1 次提交
  4. 02 4月, 2014 13 次提交
  5. 26 1月, 2014 1 次提交
    • S
      Fix race when checking i_size on direct i/o read · 9fe55eea
      Steven Whitehouse 提交于
      So far I've had one ACK for this, and no other comments. So I think it
      is probably time to send this via some suitable tree. I'm guessing that
      the vfs tree would be the most appropriate route, but not sure that
      there is one at the moment (don't see anything recent at kernel.org)
      so in that case I think -mm is the "back up plan". Al, please let me
      know if you will take this?
      
      Steve.
      
      ---------------------
      
      Following on from the "Re: [PATCH v3] vfs: fix a bug when we do some dio
      reads with append dio writes" thread on linux-fsdevel, this patch is my
      current version of the fix proposed as option (b) in that thread.
      
      Removing the i_size test from the direct i/o read path at vfs level
      means that filesystems now have to deal with requests which are beyond
      i_size themselves. These I've divided into three sets:
      
       a) Those with "no op" ->direct_IO (9p, cifs, ceph)
      These are obviously not going to be an issue
      
       b) Those with "home brew" ->direct_IO (nfs, fuse)
      I've been told that NFS should not have any problem with the larger
      i_size, however I've added an extra test to FUSE to duplicate the
      original behaviour just to be on the safe side.
      
       c) Those using __blockdev_direct_IO()
      These call through to ->get_block() which should deal with the EOF
      condition correctly. I've verified that with GFS2 and I believe that
      Zheng has verified it for ext4. I've also run the test on XFS and it
      passes both before and after this change.
      
      The part of the patch in filemap.c looks a lot larger than it really is
      - there are only two lines of real change. The rest is just indentation
      of the contained code.
      
      There remains a test of i_size though, which was added for btrfs. It
      doesn't cause the other filesystems a problem as the test is performed
      after ->direct_IO has been called. It is possible that there is a race
      that does matter to btrfs, however this patch doesn't change that, so
      its still an overall improvement.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Reported-by: NZheng Liu <gnehzuil.liu@gmail.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Dave Chinner <david@fromorbit.com>
      Acked-by: NMiklos Szeredi <miklos@szeredi.hu>
      Cc: Chris Mason <clm@fb.com>
      Cc: Josef Bacik <jbacik@fb.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9fe55eea
  6. 23 1月, 2014 2 次提交
    • A
      fuse: support clients that don't implement 'open' · 7678ac50
      Andrew Gallagher 提交于
      open/release operations require userspace transitions to keep track
      of the open count and to perform any FS-specific setup.  However,
      for some purely read-only FSs which don't need to perform any setup
      at open/release time, we can avoid the performance overhead of
      calling into userspace for open/release calls.
      
      This patch adds the necessary support to the fuse kernel modules to prevent
      open/release operations from hitting in userspace. When the client returns
      ENOSYS, we avoid sending the subsequent release to userspace, and also
      remember this so that future opens also don't trigger a userspace
      operation.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      7678ac50
    • A
      fuse: don't invalidate attrs when not using atime · 451418fc
      Andrew Gallagher 提交于
      Various read operations (e.g. readlink, readdir) invalidate the cached
      attrs for atime changes.  This patch adds a new function
      'fuse_invalidate_atime', which checks for a read-only super block and
      avoids the attr invalidation in that case.
      Signed-off-by: NAndrew Gallagher <andrewjcg@fb.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      451418fc
  7. 05 11月, 2013 3 次提交
    • M
      fuse: writepages: protect secondary requests from fuse file release · ce128de6
      Maxim Patlasov 提交于
      All async fuse requests must be supplied with extra reference to a fuse
      file.  This is necessary to ensure that the fuse file is not released until
      all in-flight requests are completed.  Fuse secondary writeback requests
      must obey this rule as well.
      Signed-off-by: NMaxim Patlasov <MPatlasov@parallels.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      ce128de6
    • M
      fuse: writepages: update bdi writeout when deleting secondary request · 41b6e41f
      Maxim Patlasov 提交于
      BDI_WRITTEN counter is used to estimate bdi bandwidth.  It must be
      incremented every time as bdi ends page writeback.  No matter whether it
      was fulfilled by actual write or by discarding the request (e.g. due to
      shrunk i_size).
      
      Note that even before writepages patches, the case "Got truncated off
      completely" was handled in fuse_send_writepage() by calling
      fuse_writepage_finish() which updated BDI_WRITTEN unconditionally.
      Signed-off-by: NMaxim Patlasov <MPatlasov@parallels.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      41b6e41f
    • M
      fuse: writepages: crop secondary requests · 6eaf4782
      Maxim Patlasov 提交于
      If writeback happens while fuse is in FUSE_NOWRITE condition, the request
      will be queued but not processed immediately (see fuse_flush_writepages()).
      Until FUSE_NOWRITE becomes relaxed, more writebacks can happen.  They will
      be queued as "secondary" requests to that first ("primary") request.
      
      Existing implementation crops only primary request.  This is not correct
      because a subsequent extending write(2) may increase i_size and then
      secondary requests won't be cropped properly.  The result would be stale
      data written to the server to a file offset where zeros must be.
      
      Similar problem may happen if secondary requests are attached to an
      in-flight request that was already cropped.
      
      The patch solves the issue by cropping all secondary requests in
      fuse_writepage_end().  Thanks to Miklos for idea.
      Signed-off-by: NMaxim Patlasov <MPatlasov@parallels.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      6eaf4782