From: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
To: Felix Blyakher <felixb-sJ/iWh9BUns@public.gmane.org>
Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] lockd: call locks_release_private to cleanup per-filesystem state
Date: Fri, 24 Apr 2009 19:01:45 -0400 [thread overview]
Message-ID: <20090424230145.GC22477@fieldses.org> (raw)
In-Reply-To: <1238530376-28013-1-git-send-email-felixb-sJ/iWh9BUns@public.gmane.org>
Thanks, applied.--b.
On Tue, Mar 31, 2009 at 03:12:56PM -0500, Felix Blyakher wrote:
> For every lock request lockd creates a new file_lock object
> in nlmsvc_setgrantargs() by copying the passed in file_lock with
> locks_copy_lock(). A filesystem can attach it's own lock_operations
> vector to the file_lock. It has to be cleaned up at the end of the
> file_lock's life. However, lockd doesn't do it today, yet it
> asserts in nlmclnt_release_lockargs() that the per-filesystem
> state is clean.
> This patch fixes it by exporting locks_release_private() and adding
> it to nlmsvc_freegrantargs(), to be symmetrical to creating a
> file_lock in nlmsvc_setgrantargs().
>
> Signed-off-by: Felix Blyakher <felixb-sJ/iWh9BUns@public.gmane.org>
> ---
> fs/lockd/svclock.c | 2 ++
> fs/locks.c | 3 ++-
> include/linux/fs.h | 1 +
> 3 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
> index 763b78a..865504a 100644
> --- a/fs/lockd/svclock.c
> +++ b/fs/lockd/svclock.c
> @@ -326,6 +326,8 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
> {
> if (call->a_args.lock.oh.data != call->a_owner)
> kfree(call->a_args.lock.oh.data);
> +
> + locks_release_private(&call->a_args.lock.fl);
> }
>
> /*
> diff --git a/fs/locks.c b/fs/locks.c
> index ec3deea..5b745dc 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -151,7 +151,7 @@ static struct file_lock *locks_alloc_lock(void)
> return kmem_cache_alloc(filelock_cache, GFP_KERNEL);
> }
>
> -static void locks_release_private(struct file_lock *fl)
> +void locks_release_private(struct file_lock *fl)
> {
> if (fl->fl_ops) {
> if (fl->fl_ops->fl_release_private)
> @@ -165,6 +165,7 @@ static void locks_release_private(struct file_lock *fl)
> }
>
> }
> +EXPORT_SYMBOL(locks_release_private);
>
> /* Free a lock which is not in use. */
> static void locks_free_lock(struct file_lock *fl)
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 92734c0..3aa4ff6 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1047,6 +1047,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *);
> extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
> extern void locks_remove_posix(struct file *, fl_owner_t);
> extern void locks_remove_flock(struct file *);
> +extern void locks_release_private(struct file_lock *);
> extern void posix_test_lock(struct file *, struct file_lock *);
> extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
> extern int posix_lock_file_wait(struct file *, struct file_lock *);
> --
> 1.5.4.rc3
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-04-24 23:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-31 20:12 [PATCH] lockd: call locks_release_private to cleanup per-filesystem state Felix Blyakher
[not found] ` <1238530376-28013-1-git-send-email-felixb-sJ/iWh9BUns@public.gmane.org>
2009-04-02 22:46 ` J. Bruce Fields
2009-04-03 5:56 ` Felix Blyakher
2009-04-24 23:01 ` J. Bruce Fields [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090424230145.GC22477@fieldses.org \
--to=bfields-uc3wqj2krung9huczpvpmw@public.gmane.org \
--cc=felixb-sJ/iWh9BUns@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).