[PATCH 1/2] quota: Add mountpath based quota support

2021-03-04 Thread Sascha Hauer
Add syscall quotactl_path, a variant of quotactl which allows to specify the mountpath instead of a path of to a block device. The quotactl syscall expects a path to the mounted block device to specify the filesystem to work on. This limits usage to filesystems which actually have a block device.

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-14 Thread Al Viro
On Thu, Feb 11, 2021 at 04:30:22PM +0100, Sascha Hauer wrote: > + sb = mountpath.dentry->d_inode->i_sb; Minor nit: mountpath.mnt->mnt_sb, please.

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-12 Thread Jan Kara
On Fri 12-02-21 11:29:00, Sascha Hauer wrote: > On Fri, Feb 12, 2021 at 11:05:05AM +0100, Jan Kara wrote: > > On Fri 12-02-21 09:38:35, Sascha Hauer wrote: > > > On Thu, Feb 11, 2021 at 03:38:13PM +, Christoph Hellwig wrote: > > > > > + if (!mountpoint) > > > > > + return

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-12 Thread Sascha Hauer
On Fri, Feb 12, 2021 at 11:05:05AM +0100, Jan Kara wrote: > On Fri 12-02-21 09:38:35, Sascha Hauer wrote: > > On Thu, Feb 11, 2021 at 03:38:13PM +, Christoph Hellwig wrote: > > > > + if (!mountpoint) > > > > + return -ENODEV; > > > > + > > > > + ret =

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-12 Thread Jan Kara
On Fri 12-02-21 09:38:35, Sascha Hauer wrote: > On Thu, Feb 11, 2021 at 03:38:13PM +, Christoph Hellwig wrote: > > > + if (!mountpoint) > > > + return -ENODEV; > > > + > > > + ret = user_path_at(AT_FDCWD, mountpoint, > > > + LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, ); > >

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-12 Thread Sascha Hauer
On Thu, Feb 11, 2021 at 03:38:13PM +, Christoph Hellwig wrote: > > + if (!mountpoint) > > + return -ENODEV; > > + > > + ret = user_path_at(AT_FDCWD, mountpoint, > > +LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, ); > > user_path_at handles an empty path, although

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-11 Thread kernel test robot
Hi Sascha, I love your patch! Yet something to improve: [auto build test ERROR on arm64/for-next/core] [also build test ERROR on tip/x86/asm m68k/for-next hp-parisc/for-next powerpc/next s390/features linus/master v5.11-rc7 next-20210211] [cannot apply to sparc/master] [If your patch is applied

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-11 Thread Christoph Hellwig
> + if (!mountpoint) > + return -ENODEV; > + > + ret = user_path_at(AT_FDCWD, mountpoint, > + LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, ); user_path_at handles an empty path, although you'll get EFAULT instead. Do we care about the -ENODEV here? Otherwise

[PATCH 1/2] quota: Add mountpath based quota support

2021-02-11 Thread Sascha Hauer
Add syscall quotactl_path, a variant of quotactl which allows to specify the mountpath instead of a path of to a block device. The quotactl syscall expects a path to the mounted block device to specify the filesystem to work on. This limits usage to filesystems which actually have a block device.

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-09 Thread Jan Kara
On Tue 09-02-21 08:51:01, Christoph Hellwig wrote: > On Thu, Feb 04, 2021 at 01:53:50PM +0100, Jan Kara wrote: > > Now quota data stored in a normal file is a setup we try to deprecate > > anyway so another option is to just leave quotactl_path() only for those > > setups where quota metadata is

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-09 Thread Christoph Hellwig
On Thu, Feb 04, 2021 at 01:53:50PM +0100, Jan Kara wrote: > Now quota data stored in a normal file is a setup we try to deprecate > anyway so another option is to just leave quotactl_path() only for those > setups where quota metadata is managed by the filesystem so we don't need > to pass quota

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-04 Thread Jan Kara
On Thu 04-02-21 07:34:14, Christoph Hellwig wrote: > On Tue, Feb 02, 2021 at 07:02:41PM +0100, Jan Kara wrote: > > Hum, let me think out loud. The path we pass to Q_QUOTAON is a path to > > quota file - unless the filesystem stores quota in hidden files in which > > case this argument is just

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-03 Thread Christoph Hellwig
On Tue, Feb 02, 2021 at 07:02:41PM +0100, Jan Kara wrote: > Hum, let me think out loud. The path we pass to Q_QUOTAON is a path to > quota file - unless the filesystem stores quota in hidden files in which > case this argument is just ignored. You're right we could require that > specifically for

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-02-02 Thread Jan Kara
On Thu 28-01-21 14:35:52, Christoph Hellwig wrote: > > + struct path path, *pathp = NULL; > > + struct path mountpath; > > + bool excl = false, thawed = false; > > + int ret; > > + > > + cmds = cmd >> SUBCMDSHIFT; > > + type = cmd & SUBCMDMASK; > > Personal pet peeve: it would be nice

Re: [PATCH 1/2] quota: Add mountpath based quota support

2021-01-28 Thread Christoph Hellwig
> + uint cmds, type; > + struct super_block *sb = NULL; I don't think sb needs the NULL initialization. > + struct path path, *pathp = NULL; > + struct path mountpath; > + bool excl = false, thawed = false; > + int ret; > + > + cmds = cmd >> SUBCMDSHIFT; > + type

[PATCH 1/2] quota: Add mountpath based quota support

2021-01-28 Thread Sascha Hauer
Add syscall quotactl_path, a variant of quotactl which allows to specify the mountpath instead of a path of to a block device. The quotactl syscall expects a path to the mounted block device to specify the filesystem to work on. This limits usage to filesystems which actually have a block device.