linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Seth Forshee <seth.forshee@canonical.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Michael j Theall <mtheall@us.ibm.com>,
	fuse-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org,
	Miklos Szeredi <miklos@szeredi.hu>
Subject: Re: [fuse-devel] [RFC] fuse: Support posix ACLs
Date: Thu, 30 Jun 2016 11:54:14 -0500	[thread overview]
Message-ID: <20160630165414.GB123267@ubuntu-hedt> (raw)
In-Reply-To: <871t3efxtv.fsf@x220.int.ebiederm.org>

On Thu, Jun 30, 2016 at 11:25:32AM -0500, Eric W. Biederman wrote:
> Seth Forshee <seth.forshee@canonical.com> writes:
> 
> > On Wed, Jun 29, 2016 at 03:18:24PM -0500, Eric W. Biederman wrote:
> >> "Michael j Theall" <mtheall@us.ibm.com> writes:
> >> 
> >> > Going by the patch I posted a couple of years ago:
> >> > https://sourceforge.net/p/fuse/mailman/message/33033653/
> >> >
> >> > The only hole I see in your patch is that in setattr() you are not
> >> > updating the cached acl if the ATTR_MODE is updated. The other major
> >> > difference is that my version uses the get_acl/set_acl inode
> >> > operations but you use that plus the xattr handlers. I'm not
> >> > up-to-speed on the kernel so I'm not sure if you actually need to
> >> > implement both.
> >> 
> >> That makes an interesting question.  Is it desirable to keep
> >> inode->i_mode in sync with the posix acls in fuse or should a filesystem
> >> that supports posix acls worry about that?
> >
> > My first blush opinion is that the kernel should take care of this, not
> > the filesystems. Then a fuse filesystem which supports xattrs gets acl
> > support for free. Otherwise if a filesystem supports xattrs but not acls
> > internally, we have no way of knowing that in the kernel and they get
> > out of sync.
> >
> > However if some filesystems are already doing this internally then we
> > have redundancy. Presumably this would be harmless aside from the wasted
> > effort.
> 
> Which means that in set_acl we need to something like:
> 
> 	if (type == ACL_TYPE_ACCESS) {
>         	struct iattr attr;
>                 attr.ia_valid = ATTR_MODE;
>                 attr.ia_mode = inode->i_mode;
>         	ret = posix_acl_equiv_mode(acl, &attr.ia_mode);
>                 if (ret < 0)
>                 	return ret;
>                 if (ret == 0)
>                 	acl = NULL;
> 		if (attr.ia_mode != inode->i_mode) {
> 			ret = fuse_do_setattr(inode, &attr, NULL);
> 	                if (ret < 0)
>         	        	return ret;
>                 }
>         }
> 
> In fuse_setattr should wind up looking something like:
> 
> static int fuse_setattr(struct dentry *entry, struct iattr *attr)
> {
> 	struct inode *inode = d_inode(entry);
>         int ret;
> 
> 	if (!fuse_allow_current_process(get_fuse_conn(inode)))
> 		return -EACCES;
> 
> 	if (attr->ia_valid & ATTR_FILE)
> 		ret = fuse_do_setattr(inode, attr, attr->ia_file);
> 	else
> 		ret = fuse_do_setattr(inode, attr, NULL);
> 
> 	if (ret == 0 && attr->ia_valid & ATTR_MODE)
>         	ret = posix_acl_chmod(inode, inode->i_mode);
> 	return ret;
> }
> 
> That should be enough to keep everything in sync with the existing
> fuse protocol.  And then fuse filesystems won't have to care in general
> about the contents of acls (unless they choose to care).

Yes, I've already written pretty much the same code and am attempting to
test it.  The problem I'm having is finding a good filesystem to test
with. fusexmp works but is probably unfair as the underlying filesystem
is handling the acls and updating the mode. I haven't found any
filesystem yet that fully supports xattrs but doesn't do something
special with the posix acl xattrs.

Can anyone suggest a good filesystem for me to test with?

Thanks,
Seth

  reply	other threads:[~2016-06-30 16:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 19:07 [RFC] fuse: Support posix ACLs Seth Forshee
2016-06-29 19:24 ` Michael j Theall
     [not found]   ` <OFF8F0F486.DB2CEB73-ON86257FE1.006A1FF4-86257FE1.006A9703-8eTO7WVQ4XIsd+ienQ86orlN3bxYEBpz@public.gmane.org>
2016-06-29 19:52     ` Michael j Theall
2016-06-29 21:03       ` [fuse-devel] " Seth Forshee
2016-06-29 21:13         ` Michael j Theall
2016-06-29 20:18   ` [fuse-devel] " Eric W. Biederman
     [not found]     ` <87vb0rhhpr.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-06-29 20:35       ` Michael j Theall
2016-06-30  7:23     ` [fuse-devel] " Jean-Pierre André
2016-06-30 13:07     ` Seth Forshee
2016-06-30 16:25       ` Eric W. Biederman
2016-06-30 16:54         ` Seth Forshee [this message]
2016-07-01 19:37           ` Nikolaus Rath
2016-07-01 19:33     ` Nikolaus Rath
2016-07-01 19:49       ` Seth Forshee
2016-06-29 20:56   ` Seth Forshee
2016-06-30  7:13 ` Jean-Pierre André
2016-07-01 19:29 ` Nikolaus Rath
2016-07-01 19:58   ` Seth Forshee

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=20160630165414.GB123267@ubuntu-hedt \
    --to=seth.forshee@canonical.com \
    --cc=ebiederm@xmission.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=mtheall@us.ibm.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 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).