kernel-hacking-2024-linux-s.../fs/afs
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
..
afs.h afs: Support interacting with multiple user namespaces 2013-02-13 06:00:51 -08:00
afs_cm.h
afs_fs.h
afs_vl.h AFS: Fix silly characters in a comment 2011-07-20 20:48:03 -04:00
cache.c
callback.c workqueue: use mod_delayed_work() instead of cancel + queue 2012-08-13 16:27:37 -07:00
cell.c FS-Cache: Provide the ability to enable/disable cookies 2013-09-27 18:40:25 +01:00
cmservice.c
dir.c afs: dget_parent() can't return a negative dentry 2013-09-29 22:02:24 -04:00
file.c mm: change invalidatepage prototype to accept length 2013-05-21 23:17:23 -04:00
flock.c locks: ensure that fl_owner is always initialized properly in flock and lease codepaths 2014-06-02 08:09:29 -04:00
fsclient.c afs: Support interacting with multiple user namespaces 2013-02-13 06:00:51 -08:00
inode.c mm + fs: store shadow entries in page cache 2014-04-03 16:21:01 -07:00
internal.h afs: don't use PREPARE_WORK 2014-03-07 10:24:50 -05:00
Kconfig fs/afs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:04 -08:00
main.c
Makefile
misc.c
mntpt.c stop passing nameidata to ->lookup() 2012-07-14 16:34:32 +04:00
netdevices.c
proc.c afs: proc cells and rootcell are writeable 2014-02-01 10:59:39 -08:00
rxrpc.c afs: don't use PREPARE_WORK 2014-03-07 10:24:50 -05:00
security.c ->permission() sanitizing: don't pass flags to ->permission() 2011-07-20 01:43:24 -04:00
server.c workqueue: use mod_delayed_work() instead of cancel + queue 2012-08-13 16:27:37 -07:00
super.c fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
vlclient.c
vlocation.c FS-Cache: Provide the ability to enable/disable cookies 2013-09-27 18:40:25 +01:00
vnode.c
volume.c FS-Cache: Provide the ability to enable/disable cookies 2013-09-27 18:40:25 +01:00
write.c aio: don't include aio.h in sched.h 2013-05-07 20:16:25 -07:00