All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guangliang Zhao <lucienchao@gmail.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: remove OPT_acl parse when acl disabled
Date: Mon, 12 May 2014 10:42:53 +0800	[thread overview]
Message-ID: <20140512024253.GA8573@work-station> (raw)
In-Reply-To: <20140509132109.GZ5988@twin.jikos.cz>

On Fri, May 09, 2014 at 03:21:09PM +0200, David Sterba wrote:
> On Thu, May 08, 2014 at 12:56:32PM +0800, Guangliang Zhao wrote:
> > Even CONFIG_BTRFS_FS_POSIX_ACL is not defined, the acl still could
> > been enabled using a mount option, and now fs/btrfs/acl.o is not
> > built, so the mount options will appear to be supported but will
> > be silently ignored.
> > 
> > --- a/fs/btrfs/super.c
> > +++ b/fs/btrfs/super.c
> > @@ -579,9 +579,11 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
> >  				goto out;
> >  			}
> >  			break;
> > +#ifdef CONFIG_BTRFS_FS_POSIX_ACL
> >  		case Opt_acl:
> >  			root->fs_info->sb->s_flags |= MS_POSIXACL;
> >  			break;
> > +#endif
> 
> This will still silently accept the 'acl' mount option:
> 
>   token = match_token(p, tokens, args);
> 
> token will be Opt_acl
> 
> and in the switch(token), caught by the default: branch and will return 0.

Didn't take care of it, good catch :-). I will send V2 ASAP.

> 
> What' needed here is a #if/#else/#endif sequence where the #else block
> says that something like "acls requested but not compiled in".
> 
> Similar to how the Opt_check_integrity* options are handled.
> 
> >  		case Opt_noacl:
> >  			root->fs_info->sb->s_flags &= ~MS_POSIXACL;
> >  			break;

-- 
Best regards,
Guangliang

      reply	other threads:[~2014-05-12  2:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08  4:56 [PATCH] Btrfs: remove OPT_acl parse when acl disabled Guangliang Zhao
2014-05-09 13:21 ` David Sterba
2014-05-12  2:42   ` Guangliang Zhao [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=20140512024253.GA8573@work-station \
    --to=lucienchao@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.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 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.