[PATCH v6 39/40] xfs: support idmapped mounts

Christoph Hellwig hch at lst.de
Wed Mar 3 07:01:03 UTC 2021


On Mon, Mar 01, 2021 at 12:05:20PM -0800, Darrick J. Wong wrote:
> > +	if (breq->mnt_userns != &init_user_ns) {
> > +		xfs_warn_ratelimited(breq->mp,
> > +			"bulkstat not supported inside of idmapped mounts.");
> > +		return -EINVAL;
> 
> Shouldn't this be -EPERM?
> 
> Or -EOPNOTSUPP?

-EINVAL is what we return for all our nor suppored ioctls, so I think it
is the right choice here, and should generally trigger the right
fallbacks.

> Also, I'm not sure why bulkstat won't work in an idmapped mount but
> bulkstat_single does?  You can use the singleton version to stat inodes
> that aren't inside the submount.

Looking at it again I think we should fail BULKSTAT_SINGLE as well.
I had somehow assumed BULKSTAT_SINGLE would operate on the inode of
the open file, in which case it would be fine.  But it doesn't so that
argument doesn't count.



More information about the Linux-security-module-archive mailing list