linux/fs/ceph
Jeff Layton 130d1f956a locks: ensure that fl_owner is always initialized properly in flock and lease codepaths
Currently, the fl_owner isn't set for flock locks. Some filesystems use
byte-range locks to simulate flock locks and there is a common idiom in
those that does:

    fl->fl_owner = (fl_owner_t)filp;
    fl->fl_start = 0;
    fl->fl_end = OFFSET_MAX;

Since flock locks are generally "owned" by the open file description,
move this into the common flock lock setup code. The fl_start and fl_end
fields are already set appropriately, so remove the unneeded setting of
that in flock ops in those filesystems as well.

Finally, the lease code also sets the fl_owner as if they were owned by
the process and not the open file description. This is incorrect as
leases have the same ownership semantics as flock locks. Set them the
same way. The lease code doesn't actually use the fl_owner value for
anything, so this is more for consistency's sake than a bugfix.

Reported-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (Staging portion)
Acked-by: J. Bruce Fields <bfields@fieldses.org>
2014-06-02 08:09:29 -04:00
..
Kconfig ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
Makefile ceph: add acl for cephfs 2013-12-31 20:32:01 +02:00
acl.c ceph: make ceph_forget_all_cached_acls() static inline 2014-02-17 12:37:12 -08:00
addr.c ceph: fix dout() compile warnings in ceph_filemap_fault() 2014-01-28 09:57:06 -08:00
cache.c ceph: fscache: Wait for completion of object initialization 2014-04-03 10:33:53 +08:00
cache.h ceph: fscache: add an interface to synchronize object store limit 2014-04-03 10:33:53 +08:00
caps.c ceph: avoid releasing caps that are being used 2014-04-28 12:55:01 -07:00
ceph_frag.c ceph: factor out libceph from Ceph file system 2010-10-20 15:37:28 -07:00
debugfs.c ceph: print inode number for LOOKUPINO request 2014-04-03 10:33:54 +08:00
dir.c ceph: clear directory's completeness when creating file 2014-04-28 12:54:44 -07:00
export.c ceph: add get_name() NFS export callback 2014-04-03 10:33:53 +08:00
file.c These are regression and bug fixes for ext4. 2014-04-20 20:43:47 -07:00
inode.c ceph: clear directory's completeness when creating file 2014-04-28 12:54:44 -07:00
ioctl.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2014-05-05 15:17:02 -07:00
ioctl.h ceph: fully initialize new layout 2012-05-16 14:28:27 -05:00
locks.c locks: ensure that fl_owner is always initialized properly in flock and lease codepaths 2014-06-02 08:09:29 -04:00
mds_client.c ceph: flush cap release queue when trimming session caps 2014-04-04 21:08:26 -07:00
mds_client.h ceph: preallocate buffer for readdir reply 2014-04-04 21:08:22 -07:00
mdsmap.c ceph: tidy ceph_mdsmap_decode() a little 2013-07-01 09:52:02 -07:00
snap.c ceph: use ceph_create_snap_context() 2013-05-01 21:20:09 -07:00
strings.c ceph: add get_name() NFS export callback 2014-04-03 10:33:53 +08:00
super.c ceph: use fl->fl_file as owner identifier of flock and posix lock 2014-04-04 21:07:11 -07:00
super.h ceph: clear directory's completeness when creating file 2014-04-28 12:54:44 -07:00
xattr.c ceph: don't include ceph.{file,dir}.layout vxattr in listxattr() 2014-04-04 21:07:21 -07:00