From: James Simmons <jsimmons@infradead.org>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org,
Andreas Dilger <andreas.dilger@intel.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Lustre Development List <lustre-devel@lists.lustre.org>
Subject: Re: [PATCH 1/8] staging/lustre/llite: move root_squash from sysfs to debugfs
Date: Thu, 8 Dec 2016 00:44:38 +0000 (GMT) [thread overview]
Message-ID: <alpine.LFD.2.20.1612080043170.14850@casper.infradead.org> (raw)
In-Reply-To: <1481150494-1853127-2-git-send-email-green@linuxhacker.ru>
> root_squash control got accidentally moved to sysfs instead of
> debugfs, and the write side of it was also broken expecting a
> userspace buffer.
> It contains both uid and gid values in a single file, so debugfs
> is a clear place for it.
I see why this was missed. The uid/gid pair I needed for my testing
was missing so the test was skipped. I fixed it up and tested this
patch out. Now it passes.
Reviewed-by: James Simmons <jsimmons@infradead.org>
> Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
> Fixes: c948390f10ccc "fix inconsistencies of root squash feature"
> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
> ---
> drivers/staging/lustre/lustre/llite/lproc_llite.c | 27 +++++++++++++----------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
> index 03682c1..f3ee584 100644
> --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
> +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
> @@ -924,27 +924,29 @@ static ssize_t ll_unstable_stats_seq_write(struct file *file,
> }
> LPROC_SEQ_FOPS(ll_unstable_stats);
>
> -static ssize_t root_squash_show(struct kobject *kobj, struct attribute *attr,
> - char *buf)
> +static int ll_root_squash_seq_show(struct seq_file *m, void *v)
> {
> - struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
> - ll_kobj);
> + struct super_block *sb = m->private;
> + struct ll_sb_info *sbi = ll_s2sbi(sb);
> struct root_squash_info *squash = &sbi->ll_squash;
>
> - return sprintf(buf, "%u:%u\n", squash->rsi_uid, squash->rsi_gid);
> + seq_printf(m, "%u:%u\n", squash->rsi_uid, squash->rsi_gid);
> + return 0;
> }
>
> -static ssize_t root_squash_store(struct kobject *kobj, struct attribute *attr,
> - const char *buffer, size_t count)
> +static ssize_t ll_root_squash_seq_write(struct file *file,
> + const char __user *buffer,
> + size_t count, loff_t *off)
> {
> - struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
> - ll_kobj);
> + struct seq_file *m = file->private_data;
> + struct super_block *sb = m->private;
> + struct ll_sb_info *sbi = ll_s2sbi(sb);
> struct root_squash_info *squash = &sbi->ll_squash;
>
> return lprocfs_wr_root_squash(buffer, count, squash,
> - ll_get_fsname(sbi->ll_sb, NULL, 0));
> + ll_get_fsname(sb, NULL, 0));
> }
> -LUSTRE_RW_ATTR(root_squash);
> +LPROC_SEQ_FOPS(ll_root_squash);
>
> static int ll_nosquash_nids_seq_show(struct seq_file *m, void *v)
> {
> @@ -997,6 +999,8 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
> { "statahead_stats", &ll_statahead_stats_fops, NULL, 0 },
> { "unstable_stats", &ll_unstable_stats_fops, NULL },
> { "sbi_flags", &ll_sbi_flags_fops, NULL, 0 },
> + { .name = "root_squash",
> + .fops = &ll_root_squash_fops },
> { .name = "nosquash_nids",
> .fops = &ll_nosquash_nids_fops },
> { NULL }
> @@ -1027,7 +1031,6 @@ static struct attribute *llite_attrs[] = {
> &lustre_attr_max_easize.attr,
> &lustre_attr_default_easize.attr,
> &lustre_attr_xattr_cache.attr,
> - &lustre_attr_root_squash.attr,
> NULL,
> };
>
> --
> 2.7.4
>
>
next prev parent reply other threads:[~2016-12-08 0:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 22:41 [PATCH 0/8] Sparse warning fixes in Lustre Oleg Drokin
2016-12-07 22:41 ` [PATCH 1/8] staging/lustre/llite: move root_squash from sysfs to debugfs Oleg Drokin
2016-12-08 0:44 ` James Simmons [this message]
2016-12-07 22:41 ` [PATCH 2/8] staging/lustre/ldlm: Correct itree_overlap_cb return type Oleg Drokin
2016-12-08 0:16 ` James Simmons
2016-12-08 0:21 ` James Simmons
2016-12-07 22:41 ` [PATCH 3/8] staging/lustre/llite: mark ll_io_init() static Oleg Drokin
2016-12-08 0:24 ` James Simmons
2016-12-07 22:41 ` [PATCH 4/8] staging/lustre/lov: make lov_lsm_alloc() static Oleg Drokin
2016-12-08 0:23 ` James Simmons
2016-12-07 22:41 ` [PATCH 5/8] staging/lustre/osc: extern declare osc_caches in a header Oleg Drokin
2016-12-08 0:22 ` James Simmons
2016-12-08 0:23 ` James Simmons
2016-12-07 22:41 ` [PATCH 6/8] staging/lustre: Declare lu_context/session_tags_default Oleg Drokin
2016-12-08 0:28 ` James Simmons
2016-12-07 22:41 ` [PATCH 7/8] staging/lustre: Move lov_read_and_clear_async_rc declaration Oleg Drokin
2016-12-08 0:24 ` James Simmons
2016-12-07 22:41 ` [PATCH 8/8] staging/lustre/ptlrpc: Move nrs_conf_fifo extern to a header Oleg Drokin
2016-12-08 0:25 ` James Simmons
2016-12-08 0:27 ` James Simmons
2016-12-07 23:46 ` [PATCH 0/8] Sparse warning fixes in Lustre Al Viro
2016-12-13 4:07 ` Oleg Drokin
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=alpine.LFD.2.20.1612080043170.14850@casper.infradead.org \
--to=jsimmons@infradead.org \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=green@linuxhacker.ru \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lustre-devel@lists.lustre.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
all inboxes | Powered by JetHome®