1. 20 11月, 2014 1 次提交
  2. 17 11月, 2014 1 次提交
    • B
      fs: add freeze_super/thaw_super fs hooks · 48b6bca6
      Benjamin Marzinski 提交于
      Currently, freezing a filesystem involves calling freeze_super, which locks
      sb->s_umount and then calls the fs-specific freeze_fs hook. This makes it
      hard for gfs2 (and potentially other cluster filesystems) to use the vfs
      freezing code to do freezes on all the cluster nodes.
      
      In order to communicate that a freeze has been requested, and to make sure
      that only one node is trying to freeze at a time, gfs2 uses a glock
      (sd_freeze_gl). The problem is that there is no hook for gfs2 to acquire
      this lock before calling freeze_super. This means that two nodes can
      attempt to freeze the filesystem by both calling freeze_super, acquiring
      the sb->s_umount lock, and then attempting to grab the cluster glock
      sd_freeze_gl. Only one will succeed, and the other will be stuck in
      freeze_super, making it impossible to finish freezing the node.
      
      To solve this problem, this patch adds the freeze_super and thaw_super
      hooks.  If a filesystem implements these hooks, they are called instead of
      the vfs freeze_super and thaw_super functions. This means that every
      filesystem that implements these hooks must call the vfs freeze_super and
      thaw_super functions itself within the hook function to make use of the vfs
      freezing code.
      Reviewed-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      48b6bca6
  3. 10 11月, 2014 3 次提交
  4. 06 11月, 2014 1 次提交
  5. 01 11月, 2014 2 次提交
  6. 31 10月, 2014 1 次提交
    • D
      Return short read or 0 at end of a raw device, not EIO · b2de525f
      David Jeffery 提交于
      Author: David Jeffery <djeffery@redhat.com>
      Changes to the basic direct I/O code have broken the raw driver when reading
      to the end of a raw device.  Instead of returning a short read for a read that
      extends partially beyond the device's end or 0 when at the end of the device,
      these reads now return EIO.
      
      The raw driver needs the same end of device handling as was added for normal
      block devices.  Using blkdev_read_iter, which has the needed size checks,
      prevents the EIO conditions at the end of the device.
      Signed-off-by: NDavid Jeffery <djeffery@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      b2de525f
  7. 29 10月, 2014 1 次提交
  8. 24 10月, 2014 6 次提交
  9. 14 10月, 2014 1 次提交
  10. 09 10月, 2014 2 次提交
  11. 08 10月, 2014 6 次提交
    • J
      locks: fix fcntl_setlease/getlease return when !CONFIG_FILE_LOCKING · 1b2b32dc
      Jeff Layton 提交于
      Currently they both just return 0. Fix them to return more appropriate
      values instead.
      
      For better or worse, most places in the kernel return -EINVAL when
      leases aren't available. -ENOLCK would probably have been better, but
      let's follow suit here in the case of F_SETLEASE.
      
      In the F_GETLEASE case, just return F_UNLCK since we know that no
      lease will have been set.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      1b2b32dc
    • J
      locks: set fl_owner for leases to filp instead of current->files · 7ca76311
      Jeff Layton 提交于
      Like flock locks, leases are owned by the file description. Now that the
      i_have_this_lease check in __break_lease is gone, we don't actually use
      the fl_owner for leases for anything. So, it's now safe to set this more
      appropriately to the same value as the fl_file.
      
      While we're at it, fix up the comments over the fl_owner_t definition
      since they're rather out of date.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      7ca76311
    • J
      locks: give lm_break a return value · 4d01b7f5
      Jeff Layton 提交于
      Christoph suggests:
      
         "Add a return value to lm_break so that the lock manager can tell the
          core code "you can delete this lease right now".  That gets rid of
          the games with the timeout which require all kinds of race avoidance
          code in the users."
      
      Do that here and have the nfsd lease break routine use it when it detects
      that there was a race between setting up the lease and it being broken.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      4d01b7f5
    • J
      locks: move freeing of leases outside of i_lock · c45198ed
      Jeff Layton 提交于
      There was only one place where we still could free a file_lock while
      holding the i_lock -- lease_modify. Add a new list_head argument to the
      lm_change operation, pass in a private list when calling it, and fix
      those callers to dispose of the list once the lock has been dropped.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      c45198ed
    • J
      locks: define a lm_setup handler for leases · 1c7dd2ff
      Jeff Layton 提交于
      ...and move the fasync setup into it for fcntl lease calls. At the same
      time, change the semantics of how the file_lock double-pointer is
      handled. Up until now, on a successful lease return you got a pointer to
      the lock on the list. This is bad, since that pointer can no longer be
      relied on as valid once the inode->i_lock has been released.
      
      Change the code to instead just zero out the pointer if the lease we
      passed in ended up being used. Then the callers can just check to see
      if it's NULL after the call and free it if it isn't.
      
      The priv argument has the same semantics. The lm_setup function can
      zero the pointer out to signal to the caller that it should not be
      freed after the function returns.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      1c7dd2ff
    • J
      locks: plumb a "priv" pointer into the setlease routines · e6f5c789
      Jeff Layton 提交于
      In later patches, we're going to add a new lock_manager_operation to
      finish setting up the lease while still holding the i_lock.  To do
      this, we'll need to pass a little bit of info in the fcntl setlease
      case (primarily an fasync structure). Plumb the extra pointer into
      there in advance of that.
      
      We declare this pointer as a void ** to make it clear that this is
      private info, and that the caller isn't required to set this unless
      the lm_setup specifically requires it.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      e6f5c789
  12. 10 9月, 2014 6 次提交
  13. 09 8月, 2014 1 次提交
    • D
      mm: allow drivers to prevent new writable mappings · 4bb5f5d9
      David Herrmann 提交于
      This patch (of 6):
      
      The i_mmap_writable field counts existing writable mappings of an
      address_space.  To allow drivers to prevent new writable mappings, make
      this counter signed and prevent new writable mappings if it is negative.
      This is modelled after i_writecount and DENYWRITE.
      
      This will be required by the shmem-sealing infrastructure to prevent any
      new writable mappings after the WRITE seal has been set.  In case there
      exists a writable mapping, this operation will fail with EBUSY.
      
      Note that we rely on the fact that iff you already own a writable mapping,
      you can increase the counter without using the helpers.  This is the same
      that we do for i_writecount.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NHugh Dickins <hughd@google.com>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Ryan Lortie <desrt@desrt.ca>
      Cc: Lennart Poettering <lennart@poettering.net>
      Cc: Daniel Mack <zonque@gmail.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4bb5f5d9
  14. 08 8月, 2014 2 次提交
  15. 07 8月, 2014 1 次提交
  16. 14 7月, 2014 1 次提交
  17. 12 6月, 2014 2 次提交
  18. 11 6月, 2014 1 次提交
  19. 05 6月, 2014 1 次提交