From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] gfs2: add nfslocks mount option
Date: Mon, 29 Mar 2010 09:44:27 +0100 [thread overview]
Message-ID: <1269852267.2504.19.camel@localhost> (raw)
In-Reply-To: <20100325214526.GA9522@redhat.com>
Hi,
The code is ok, but I'm not intending to take this at least until I can
figure out why it is needed. I can't see any use case in which it would
be useful at the moment,
Steve.
On Thu, 2010-03-25 at 16:45 -0500, David Teigland wrote:
> Using the nfslocks mount option causes gfs2 to pass posix locks
> from nfs to the dlm to be clustered. It is off by default because
> posix locks from nfs are not fully handled by the cluster.
>
> Signed-off-by: David Teigland <teigland@redhat.com>
> ---
> fs/gfs2/file.c | 11 +++++++++++
> fs/gfs2/incore.h | 1 +
> fs/gfs2/super.c | 13 +++++++++++++
> 3 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index e6dd2ae..bd41b37 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -650,6 +650,17 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
> }
> if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)))
> return -EIO;
> +
> + if (fl->fl_lmops && fl->fl_lmops->fl_grant &&
> + !sdp->sd_args.ar_nfslocks) {
> + if (IS_GETLK(cmd)) {
> + posix_test_lock(file, fl);
> + return 0;
> + } else {
> + return posix_lock_file_wait(file, fl);
> + }
> + }
> +
> if (IS_GETLK(cmd))
> return dlm_posix_get(ls->ls_dlm, ip->i_no_addr, file, fl);
> else if (fl->fl_type == F_UNLCK)
> diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
> index 3aac46f..31d6991 100644
> --- a/fs/gfs2/incore.h
> +++ b/fs/gfs2/incore.h
> @@ -430,6 +430,7 @@ struct gfs2_args {
> unsigned int ar_discard:1; /* discard requests */
> unsigned int ar_errors:2; /* errors=withdraw | panic */
> unsigned int ar_nobarrier:1; /* do not send barriers */
> + unsigned int ar_nfslocks:1; /* pass nfs plocks to dlm */
> int ar_commit; /* Commit interval */
> int ar_statfs_quantum; /* The fast statfs interval */
> int ar_quota_quantum; /* The quota interval */
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 50aac60..3a830c8 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -77,6 +77,8 @@ enum {
> Opt_quota_quantum,
> Opt_barrier,
> Opt_nobarrier,
> + Opt_nfslocks,
> + Opt_nonfslocks,
> Opt_error,
> };
>
> @@ -113,6 +115,8 @@ static const match_table_t tokens = {
> {Opt_quota_quantum, "quota_quantum=%d"},
> {Opt_barrier, "barrier"},
> {Opt_nobarrier, "nobarrier"},
> + {Opt_nfslocks, "nfslocks"},
> + {Opt_nonfslocks, "nonfslocks"},
> {Opt_error, NULL}
> };
>
> @@ -265,6 +269,12 @@ int gfs2_mount_args(struct gfs2_args *args, char *options)
> case Opt_nobarrier:
> args->ar_nobarrier = 1;
> break;
> + case Opt_nfslocks:
> + args->ar_nfslocks = 1;
> + break;
> + case Opt_nonfslocks:
> + args->ar_nfslocks = 0;
> + break;
> case Opt_error:
> default:
> printk(KERN_WARNING "GFS2: invalid mount option: %s\n", o);
> @@ -1135,6 +1145,7 @@ static int gfs2_remount_fs(struct super_block *sb, int *flags, char *data)
> args_neq(&args, &sdp->sd_args, ignore_local_fs) ||
> args_neq(&args, &sdp->sd_args, localflocks) ||
> args_neq(&args, &sdp->sd_args, localcaching) ||
> + args_neq(&args, &sdp->sd_args, nfslocks) ||
> args_neq(&args, &sdp->sd_args, meta))
> return -EINVAL;
>
> @@ -1262,6 +1273,8 @@ static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
> seq_printf(s, ",localflocks");
> if (args->ar_localcaching)
> seq_printf(s, ",localcaching");
> + if (args->ar_nfslocks)
> + seq_printf(s, ",nfslocks");
> if (args->ar_debug)
> seq_printf(s, ",debug");
> if (args->ar_upgrade)
prev parent reply other threads:[~2010-03-29 8:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 21:45 [Cluster-devel] [PATCH] gfs2: add nfslocks mount option David Teigland
2010-03-29 8:44 ` Steven Whitehouse [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=1269852267.2504.19.camel@localhost \
--to=swhiteho@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.