[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140428181524.GA18775@kroah.com>
Date: Mon, 28 Apr 2014 11:15:24 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Jeff Layton <jlayton@...chiereds.net>
Cc: linux-fsdevel@...r.kernel.org,
Eric Van Hensbergen <ericvh@...il.com>,
Ron Minnich <rminnich@...dia.gov>,
Latchesar Ionkov <lucho@...kov.net>,
David Howells <dhowells@...hat.com>,
Sage Weil <sage@...tank.com>,
Miklos Szeredi <miklos@...redi.hu>,
"J. Bruce Fields" <bfields@...ldses.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Trond Myklebust <trond.myklebust@...marydata.com>,
"open list:STAGING SUBSYSTEM" <devel@...verdev.osuosl.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:9P FILE SYSTEM" <v9fs-developer@...ts.sourceforge.net>,
"open list:AFS FILESYSTEM &..." <linux-afs@...ts.infradead.org>,
"open list:CEPH DISTRIBUTED..." <ceph-devel@...r.kernel.org>,
"open list:FUSE: FILESYSTEM..." <fuse-devel@...ts.sourceforge.net>,
"open list:NFS, SUNRPC, AND..." <linux-nfs@...r.kernel.org>
Subject: Re: [PATCH] locks: ensure that fl_owner is always initialized
properly in flock and lease codepaths
On Mon, Apr 28, 2014 at 01:50:13PM -0400, Jeff Layton wrote:
> 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@...marydata.com>
> Signed-off-by: Jeff Layton <jlayton@...chiereds.net>
> ---
> drivers/staging/lustre/lustre/llite/file.c | 17 ++++++-----------
> fs/9p/vfs_file.c | 3 ---
> fs/afs/flock.c | 4 ----
> fs/ceph/locks.c | 10 ++--------
> fs/fuse/file.c | 1 -
> fs/locks.c | 4 +++-
> fs/nfs/file.c | 4 ----
> 7 files changed, 11 insertions(+), 32 deletions(-)
Staging portion:
Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists