2021-03-04 17:17:16

by Sascha Hauer

[permalink] [raw]
Subject: [PATCH v3 0/2] quota: Add mountpath based quota support

Current quotactl syscall uses a path to a block device to specify the
filesystem to work on which makes it unsuitable for filesystems that
do not have a block device. This series adds a new syscall quotactl_path()
which replaces the path to the block device with a mountpath, but otherwise
behaves like original quotactl.

This is done to add quota support to UBIFS. UBIFS quota support has been
posted several times with different approaches to put the mountpath into
the existing quotactl() syscall until it has been suggested to make it a
new syscall instead, so here it is.

I'm not posting the full UBIFS quota series here as it remains unchanged
and I'd like to get feedback to the new syscall first. For those interested
the most recent series can be found here: https://lwn.net/Articles/810463/

Changes since v2:
- Rebase on v5.12-rc1
- replace mountpath.dentry->d_inode->i_sb with mountpath.mnt->mnt_sb
- fix wrong macro usage in arch/x86/entry/syscalls/syscall_32.tbl
- +Cc [email protected]

Changes since (implicit) v1:
- Ignore second path argument to Q_QUOTAON. With this quotactl_path() can
only do the Q_QUOTAON operation on filesystems which use hidden inodes
for quota metadata storage
- Drop unnecessary quotactl_cmd_onoff() check

Sascha Hauer (2):
quota: Add mountpath based quota support
quota: wire up quotactl_path

arch/alpha/kernel/syscalls/syscall.tbl | 1 +
arch/arm/tools/syscall.tbl | 1 +
arch/arm64/include/asm/unistd.h | 2 +-
arch/arm64/include/asm/unistd32.h | 2 +
arch/ia64/kernel/syscalls/syscall.tbl | 1 +
arch/m68k/kernel/syscalls/syscall.tbl | 1 +
arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
arch/mips/kernel/syscalls/syscall_n32.tbl | 1 +
arch/mips/kernel/syscalls/syscall_n64.tbl | 1 +
arch/mips/kernel/syscalls/syscall_o32.tbl | 1 +
arch/parisc/kernel/syscalls/syscall.tbl | 1 +
arch/powerpc/kernel/syscalls/syscall.tbl | 1 +
arch/s390/kernel/syscalls/syscall.tbl | 1 +
arch/sh/kernel/syscalls/syscall.tbl | 1 +
arch/sparc/kernel/syscalls/syscall.tbl | 1 +
arch/x86/entry/syscalls/syscall_32.tbl | 1 +
arch/x86/entry/syscalls/syscall_64.tbl | 1 +
arch/xtensa/kernel/syscalls/syscall.tbl | 1 +
fs/quota/quota.c | 49 +++++++++++++++++++--
include/linux/syscalls.h | 2 +
include/uapi/asm-generic/unistd.h | 4 +-
kernel/sys_ni.c | 1 +
22 files changed, 71 insertions(+), 5 deletions(-)

--
2.29.2


2021-03-05 00:12:50

by Sascha Hauer

[permalink] [raw]
Subject: [PATCH] quotactl.2: Add documentation for quotactl_path()

Expand the quotactl.2 manpage with a description for quotactl_path()
that takes a mountpoint path instead of a path to a block device.

Signed-off-by: Sascha Hauer <[email protected]>
---
man2/quotactl.2 | 31 ++++++++++++++++++++++++++++---
man2/quotactl_path.2 | 1 +
2 files changed, 29 insertions(+), 3 deletions(-)
create mode 100644 man2/quotactl_path.2

diff --git a/man2/quotactl.2 b/man2/quotactl.2
index 7869c64ea..76505c668 100644
--- a/man2/quotactl.2
+++ b/man2/quotactl.2
@@ -34,6 +34,8 @@ quotactl \- manipulate disk quotas
.PP
.BI "int quotactl(int " cmd ", const char *" special ", int " id \
", caddr_t " addr );
+.BI "int quotactl_path(int " cmd ", const char *" mountpoint ", int " id \
+", caddr_t " addr );
.fi
.SH DESCRIPTION
The quota system can be used to set per-user, per-group, and per-project limits
@@ -48,7 +50,11 @@ after this, the soft limit counts as a hard limit.
.PP
The
.BR quotactl ()
-call manipulates disk quotas.
+and
+.BR quotactl_path ()
+calls manipulate disk quotas. The difference between both functions is the way
+how the filesystem being manipulated is specified, see description of the arguments
+below.
The
.I cmd
argument indicates a command to be applied to the user or
@@ -75,10 +81,19 @@ value is described below.
.PP
The
.I special
-argument is a pointer to a null-terminated string containing the pathname
+argument to
+.BR quotactl ()
+is a pointer to a null-terminated string containing the pathname
of the (mounted) block special device for the filesystem being manipulated.
.PP
The
+.I mountpoint
+argument to
+.BR quotactl_path ()
+is a pointer to a null-terminated string containing the pathname
+of the mountpoint for the filesystem being manipulated.
+.PP
+The
.I addr
argument is the address of an optional, command-specific, data structure
that is copied in or out of the system.
@@ -133,7 +148,17 @@ flag in the
.I dqi_flags
field returned by the
.B Q_GETINFO
-operation.
+operation. The
+.BR quotactl_path ()
+variant of this syscall generally ignores the
+.IR addr
+and
+.IR id
+arguments, so the
+.B Q_QUOTAON
+operation of
+.BR quotactl_path ()
+is only suitable for work with hidden system inodes.
.IP
This operation requires privilege
.RB ( CAP_SYS_ADMIN ).
diff --git a/man2/quotactl_path.2 b/man2/quotactl_path.2
new file mode 100644
index 000000000..5f63187c6
--- /dev/null
+++ b/man2/quotactl_path.2
@@ -0,0 +1 @@
+.so man2/quotactl.2
--
2.20.1

2021-03-05 00:12:50

by Sascha Hauer

[permalink] [raw]
Subject: [PATCH 2/2] quota: wire up quotactl_path

Wire up the quotactl_path syscall added in the previous patch.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
---
arch/alpha/kernel/syscalls/syscall.tbl | 1 +
arch/arm/tools/syscall.tbl | 1 +
arch/arm64/include/asm/unistd.h | 2 +-
arch/arm64/include/asm/unistd32.h | 2 ++
arch/ia64/kernel/syscalls/syscall.tbl | 1 +
arch/m68k/kernel/syscalls/syscall.tbl | 1 +
arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
arch/mips/kernel/syscalls/syscall_n32.tbl | 1 +
arch/mips/kernel/syscalls/syscall_n64.tbl | 1 +
arch/mips/kernel/syscalls/syscall_o32.tbl | 1 +
arch/parisc/kernel/syscalls/syscall.tbl | 1 +
arch/powerpc/kernel/syscalls/syscall.tbl | 1 +
arch/s390/kernel/syscalls/syscall.tbl | 1 +
arch/sh/kernel/syscalls/syscall.tbl | 1 +
arch/sparc/kernel/syscalls/syscall.tbl | 1 +
arch/x86/entry/syscalls/syscall_32.tbl | 1 +
arch/x86/entry/syscalls/syscall_64.tbl | 1 +
arch/xtensa/kernel/syscalls/syscall.tbl | 1 +
include/linux/syscalls.h | 2 ++
include/uapi/asm-generic/unistd.h | 4 +++-
kernel/sys_ni.c | 1 +
21 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl
index 02f0244e005c..c5f7e595adab 100644
--- a/arch/alpha/kernel/syscalls/syscall.tbl
+++ b/arch/alpha/kernel/syscalls/syscall.tbl
@@ -482,3 +482,4 @@
550 common process_madvise sys_process_madvise
551 common epoll_pwait2 sys_epoll_pwait2
552 common mount_setattr sys_mount_setattr
+553 common quotactl_path sys_quotactl_path
diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl
index dcc1191291a2..90cbe207cf3e 100644
--- a/arch/arm/tools/syscall.tbl
+++ b/arch/arm/tools/syscall.tbl
@@ -456,3 +456,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 949788f5ba40..d1f7d35f986e 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -38,7 +38,7 @@
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)

-#define __NR_compat_syscalls 443
+#define __NR_compat_syscalls 444
#endif

#define __ARCH_WANT_SYS_CLONE
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index 3d874f624056..8361c5138e5f 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -893,6 +893,8 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
__SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
#define __NR_mount_setattr 442
__SYSCALL(__NR_mount_setattr, sys_mount_setattr)
+#define __NR_quotactl_path 443
+__SYSCALL(__NR_quotactl_path, sys_quotactl_path)

/*
* Please add new compat syscalls above this comment and update
diff --git a/arch/ia64/kernel/syscalls/syscall.tbl b/arch/ia64/kernel/syscalls/syscall.tbl
index d89231166e19..c072cd459bb5 100644
--- a/arch/ia64/kernel/syscalls/syscall.tbl
+++ b/arch/ia64/kernel/syscalls/syscall.tbl
@@ -363,3 +363,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/m68k/kernel/syscalls/syscall.tbl b/arch/m68k/kernel/syscalls/syscall.tbl
index 72bde6707dd3..5e9f81073ff4 100644
--- a/arch/m68k/kernel/syscalls/syscall.tbl
+++ b/arch/m68k/kernel/syscalls/syscall.tbl
@@ -442,3 +442,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/microblaze/kernel/syscalls/syscall.tbl b/arch/microblaze/kernel/syscalls/syscall.tbl
index d603a5ec9338..8e74d690c64d 100644
--- a/arch/microblaze/kernel/syscalls/syscall.tbl
+++ b/arch/microblaze/kernel/syscalls/syscall.tbl
@@ -448,3 +448,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/mips/kernel/syscalls/syscall_n32.tbl b/arch/mips/kernel/syscalls/syscall_n32.tbl
index 8fd8c1790941..6f397e56926f 100644
--- a/arch/mips/kernel/syscalls/syscall_n32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n32.tbl
@@ -381,3 +381,4 @@
440 n32 process_madvise sys_process_madvise
441 n32 epoll_pwait2 compat_sys_epoll_pwait2
442 n32 mount_setattr sys_mount_setattr
+443 n32 quotactl_path sys_quotactl_path
diff --git a/arch/mips/kernel/syscalls/syscall_n64.tbl b/arch/mips/kernel/syscalls/syscall_n64.tbl
index 169f21438065..ab85a357c4fa 100644
--- a/arch/mips/kernel/syscalls/syscall_n64.tbl
+++ b/arch/mips/kernel/syscalls/syscall_n64.tbl
@@ -357,3 +357,4 @@
440 n64 process_madvise sys_process_madvise
441 n64 epoll_pwait2 sys_epoll_pwait2
442 n64 mount_setattr sys_mount_setattr
+443 n64 quotactl_path sys_quotactl_path
diff --git a/arch/mips/kernel/syscalls/syscall_o32.tbl b/arch/mips/kernel/syscalls/syscall_o32.tbl
index 090d29ca80ff..9c4cd2b40b38 100644
--- a/arch/mips/kernel/syscalls/syscall_o32.tbl
+++ b/arch/mips/kernel/syscalls/syscall_o32.tbl
@@ -430,3 +430,4 @@
440 o32 process_madvise sys_process_madvise
441 o32 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 o32 mount_setattr sys_mount_setattr
+443 o32 quotactl_path sys_quotactl_path
diff --git a/arch/parisc/kernel/syscalls/syscall.tbl b/arch/parisc/kernel/syscalls/syscall.tbl
index 271a92519683..80fba3f7d47b 100644
--- a/arch/parisc/kernel/syscalls/syscall.tbl
+++ b/arch/parisc/kernel/syscalls/syscall.tbl
@@ -440,3 +440,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
index 0b2480cf3e47..f66f9c9b9d6c 100644
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
@@ -522,3 +522,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/s390/kernel/syscalls/syscall.tbl b/arch/s390/kernel/syscalls/syscall.tbl
index 3abef2144dac..4aeaa89fa774 100644
--- a/arch/s390/kernel/syscalls/syscall.tbl
+++ b/arch/s390/kernel/syscalls/syscall.tbl
@@ -445,3 +445,4 @@
440 common process_madvise sys_process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/sh/kernel/syscalls/syscall.tbl b/arch/sh/kernel/syscalls/syscall.tbl
index d08eebad6b7f..f68517aaa4f1 100644
--- a/arch/sh/kernel/syscalls/syscall.tbl
+++ b/arch/sh/kernel/syscalls/syscall.tbl
@@ -445,3 +445,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/sparc/kernel/syscalls/syscall.tbl b/arch/sparc/kernel/syscalls/syscall.tbl
index 84403a99039c..3ee82321504d 100644
--- a/arch/sparc/kernel/syscalls/syscall.tbl
+++ b/arch/sparc/kernel/syscalls/syscall.tbl
@@ -488,3 +488,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl
index a1c9f496fca6..f52a443eede0 100644
--- a/arch/x86/entry/syscalls/syscall_32.tbl
+++ b/arch/x86/entry/syscalls/syscall_32.tbl
@@ -447,3 +447,4 @@
440 i386 process_madvise sys_process_madvise
441 i386 epoll_pwait2 sys_epoll_pwait2 compat_sys_epoll_pwait2
442 i386 mount_setattr sys_mount_setattr
+443 i386 quotactl_path sys_quotactl_path
diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl
index 7bf01cbe582f..7eb007b8cab5 100644
--- a/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/arch/x86/entry/syscalls/syscall_64.tbl
@@ -364,6 +364,7 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path

#
# Due to a historical design error, certain syscalls are numbered differently
diff --git a/arch/xtensa/kernel/syscalls/syscall.tbl b/arch/xtensa/kernel/syscalls/syscall.tbl
index 365a9b849224..c71cc45633de 100644
--- a/arch/xtensa/kernel/syscalls/syscall.tbl
+++ b/arch/xtensa/kernel/syscalls/syscall.tbl
@@ -413,3 +413,4 @@
440 common process_madvise sys_process_madvise
441 common epoll_pwait2 sys_epoll_pwait2
442 common mount_setattr sys_mount_setattr
+443 common quotactl_path sys_quotactl_path
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2839dc9a7c01..a672bbe28577 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -483,6 +483,8 @@ asmlinkage long sys_pipe2(int __user *fildes, int flags);
/* fs/quota.c */
asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
qid_t id, void __user *addr);
+asmlinkage long sys_quotactl_path(unsigned int cmd, const char __user *mountpoint,
+ qid_t id, void __user *addr);

/* fs/readdir.c */
asmlinkage long sys_getdents64(unsigned int fd,
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index ce58cff99b66..739c839d28fe 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -863,9 +863,11 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
__SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
#define __NR_mount_setattr 442
__SYSCALL(__NR_mount_setattr, sys_mount_setattr)
+#define __NR_quotactl_path 443
+__SYSCALL(__NR_quotactl_path, sys_quotactl_path)

#undef __NR_syscalls
-#define __NR_syscalls 443
+#define __NR_syscalls 444

/*
* 32 bit systems traditionally used different
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 19aa806890d5..d24431782414 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -99,6 +99,7 @@ COND_SYSCALL(flock);

/* fs/quota.c */
COND_SYSCALL(quotactl);
+COND_SYSCALL(quotactl_path);

/* fs/readdir.c */

--
2.29.2

2021-03-05 00:52:41

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/2] quota: wire up quotactl_path

Hi Sascha,

I love your patch! Perhaps something to improve:

[auto build test WARNING on m68k/for-next]
[also build test WARNING on hp-parisc/for-next powerpc/next s390/features sparc/master linus/master v5.12-rc1]
[cannot apply to arm64/for-next/core tip/x86/asm]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Sascha-Hauer/quota-Add-mountpath-based-quota-support/20210304-204157
base: https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git for-next
config: x86_64-randconfig-m001-20210304 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/4c5e71a8aad3e3e1f2eb339eec24d563d0d6acbe
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sascha-Hauer/quota-Add-mountpath-based-quota-support/20210304-204157
git checkout 4c5e71a8aad3e3e1f2eb339eec24d563d0d6acbe
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:69:1: note: in expansion of macro 'COND_SYSCALL'
69 | COND_SYSCALL(epoll_pwait);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_epoll_pwait2' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:71:1: note: in expansion of macro 'COND_SYSCALL'
71 | COND_SYSCALL(epoll_pwait2);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_inotify_init1' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:77:1: note: in expansion of macro 'COND_SYSCALL'
77 | COND_SYSCALL(inotify_init1);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_inotify_add_watch' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:78:1: note: in expansion of macro 'COND_SYSCALL'
78 | COND_SYSCALL(inotify_add_watch);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_inotify_rm_watch' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:79:1: note: in expansion of macro 'COND_SYSCALL'
79 | COND_SYSCALL(inotify_rm_watch);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_ioprio_set' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:84:1: note: in expansion of macro 'COND_SYSCALL'
84 | COND_SYSCALL(ioprio_set);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_ioprio_get' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:85:1: note: in expansion of macro 'COND_SYSCALL'
85 | COND_SYSCALL(ioprio_get);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_flock' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:88:1: note: in expansion of macro 'COND_SYSCALL'
88 | COND_SYSCALL(flock);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_quotactl' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:101:1: note: in expansion of macro 'COND_SYSCALL'
101 | COND_SYSCALL(quotactl);
| ^~~~~~~~~~~~
>> arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_quotactl_path' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:102:1: note: in expansion of macro 'COND_SYSCALL'
102 | COND_SYSCALL(quotactl_path);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_signalfd4' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:113:1: note: in expansion of macro 'COND_SYSCALL'
113 | COND_SYSCALL(signalfd4);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_create' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:123:1: note: in expansion of macro 'COND_SYSCALL'
123 | COND_SYSCALL(timerfd_create);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_settime' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:124:1: note: in expansion of macro 'COND_SYSCALL'
124 | COND_SYSCALL(timerfd_settime);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_settime32' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:125:1: note: in expansion of macro 'COND_SYSCALL'
125 | COND_SYSCALL(timerfd_settime32);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_gettime' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:126:1: note: in expansion of macro 'COND_SYSCALL'
126 | COND_SYSCALL(timerfd_gettime);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_timerfd_gettime32' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:127:1: note: in expansion of macro 'COND_SYSCALL'
127 | COND_SYSCALL(timerfd_gettime32);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_acct' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)
| ^~~~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL'
256 | __X64_COND_SYSCALL(name) \
| ^~~~~~~~~~~~~~~~~~
kernel/sys_ni.c:132:1: note: in expansion of macro 'COND_SYSCALL'
132 | COND_SYSCALL(acct);
| ^~~~~~~~~~~~
arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_capget' [-Wmissing-prototypes]
83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \
| ^~
arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL'
100 | __COND_SYSCALL(x64, sys_##name)


vim +/__x64_sys_quotactl_path +83 arch/x86/include/asm/syscall_wrapper.h

cc42c045af1ff4de Brian Gerst 2020-03-13 13
25c619e59b395a8c Brian Gerst 2020-03-13 14 /*
25c619e59b395a8c Brian Gerst 2020-03-13 15 * Instead of the generic __SYSCALL_DEFINEx() definition, the x86 version takes
25c619e59b395a8c Brian Gerst 2020-03-13 16 * struct pt_regs *regs as the only argument of the syscall stub(s) named as:
25c619e59b395a8c Brian Gerst 2020-03-13 17 * __x64_sys_*() - 64-bit native syscall
25c619e59b395a8c Brian Gerst 2020-03-13 18 * __ia32_sys_*() - 32-bit native syscall or common compat syscall
25c619e59b395a8c Brian Gerst 2020-03-13 19 * __ia32_compat_sys_*() - 32-bit compat syscall
25c619e59b395a8c Brian Gerst 2020-03-13 20 * __x32_compat_sys_*() - 64-bit X32 compat syscall
25c619e59b395a8c Brian Gerst 2020-03-13 21 *
25c619e59b395a8c Brian Gerst 2020-03-13 22 * The registers are decoded according to the ABI:
25c619e59b395a8c Brian Gerst 2020-03-13 23 * 64-bit: RDI, RSI, RDX, R10, R8, R9
25c619e59b395a8c Brian Gerst 2020-03-13 24 * 32-bit: EBX, ECX, EDX, ESI, EDI, EBP
25c619e59b395a8c Brian Gerst 2020-03-13 25 *
25c619e59b395a8c Brian Gerst 2020-03-13 26 * The stub then passes the decoded arguments to the __se_sys_*() wrapper to
25c619e59b395a8c Brian Gerst 2020-03-13 27 * perform sign-extension (omitted for zero-argument syscalls). Finally the
25c619e59b395a8c Brian Gerst 2020-03-13 28 * arguments are passed to the __do_sys_*() function which is the actual
25c619e59b395a8c Brian Gerst 2020-03-13 29 * syscall. These wrappers are marked as inline so the compiler can optimize
25c619e59b395a8c Brian Gerst 2020-03-13 30 * the functions where appropriate.
25c619e59b395a8c Brian Gerst 2020-03-13 31 *
25c619e59b395a8c Brian Gerst 2020-03-13 32 * Example assembly (slightly re-ordered for better readability):
25c619e59b395a8c Brian Gerst 2020-03-13 33 *
25c619e59b395a8c Brian Gerst 2020-03-13 34 * <__x64_sys_recv>: <-- syscall with 4 parameters
25c619e59b395a8c Brian Gerst 2020-03-13 35 * callq <__fentry__>
25c619e59b395a8c Brian Gerst 2020-03-13 36 *
25c619e59b395a8c Brian Gerst 2020-03-13 37 * mov 0x70(%rdi),%rdi <-- decode regs->di
25c619e59b395a8c Brian Gerst 2020-03-13 38 * mov 0x68(%rdi),%rsi <-- decode regs->si
25c619e59b395a8c Brian Gerst 2020-03-13 39 * mov 0x60(%rdi),%rdx <-- decode regs->dx
25c619e59b395a8c Brian Gerst 2020-03-13 40 * mov 0x38(%rdi),%rcx <-- decode regs->r10
25c619e59b395a8c Brian Gerst 2020-03-13 41 *
25c619e59b395a8c Brian Gerst 2020-03-13 42 * xor %r9d,%r9d <-- clear %r9
25c619e59b395a8c Brian Gerst 2020-03-13 43 * xor %r8d,%r8d <-- clear %r8
25c619e59b395a8c Brian Gerst 2020-03-13 44 *
25c619e59b395a8c Brian Gerst 2020-03-13 45 * callq __sys_recvfrom <-- do the actual work in __sys_recvfrom()
25c619e59b395a8c Brian Gerst 2020-03-13 46 * which takes 6 arguments
25c619e59b395a8c Brian Gerst 2020-03-13 47 *
25c619e59b395a8c Brian Gerst 2020-03-13 48 * cltq <-- extend return value to 64-bit
25c619e59b395a8c Brian Gerst 2020-03-13 49 * retq <-- return
25c619e59b395a8c Brian Gerst 2020-03-13 50 *
25c619e59b395a8c Brian Gerst 2020-03-13 51 * This approach avoids leaking random user-provided register content down
25c619e59b395a8c Brian Gerst 2020-03-13 52 * the call chain.
25c619e59b395a8c Brian Gerst 2020-03-13 53 */
25c619e59b395a8c Brian Gerst 2020-03-13 54
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 55 /* Mapping of registers to parameters for syscalls on x86-64 and x32 */
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 56 #define SC_X86_64_REGS_TO_ARGS(x, ...) \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 57 __MAP(x,__SC_ARGS \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 58 ,,regs->di,,regs->si,,regs->dx \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 59 ,,regs->r10,,regs->r8,,regs->r9) \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 60
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 61 /* Mapping of registers to parameters for syscalls on i386 */
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 62 #define SC_IA32_REGS_TO_ARGS(x, ...) \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 63 __MAP(x,__SC_ARGS \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 64 ,,(unsigned int)regs->bx,,(unsigned int)regs->cx \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 65 ,,(unsigned int)regs->dx,,(unsigned int)regs->si \
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 66 ,,(unsigned int)regs->di,,(unsigned int)regs->bp)
ebeb8c82ffaf9443 Dominik Brodowski 2018-04-05 67
d2b5de495ee9838b Brian Gerst 2020-03-13 68 #define __SYS_STUB0(abi, name) \
0f78ff17112d8b34 Brian Gerst 2020-03-13 69 long __##abi##_##name(const struct pt_regs *regs); \
d2b5de495ee9838b Brian Gerst 2020-03-13 70 ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO); \
0f78ff17112d8b34 Brian Gerst 2020-03-13 71 long __##abi##_##name(const struct pt_regs *regs) \
d2b5de495ee9838b Brian Gerst 2020-03-13 72 __alias(__do_##name);
d2b5de495ee9838b Brian Gerst 2020-03-13 73
4399e0cf494f739a Brian Gerst 2020-03-13 74 #define __SYS_STUBx(abi, name, ...) \
0f78ff17112d8b34 Brian Gerst 2020-03-13 75 long __##abi##_##name(const struct pt_regs *regs); \
4399e0cf494f739a Brian Gerst 2020-03-13 76 ALLOW_ERROR_INJECTION(__##abi##_##name, ERRNO); \
0f78ff17112d8b34 Brian Gerst 2020-03-13 77 long __##abi##_##name(const struct pt_regs *regs) \
4399e0cf494f739a Brian Gerst 2020-03-13 78 { \
4399e0cf494f739a Brian Gerst 2020-03-13 79 return __se_##name(__VA_ARGS__); \
4399e0cf494f739a Brian Gerst 2020-03-13 80 }
4399e0cf494f739a Brian Gerst 2020-03-13 81
6cc8d2b286d9e716 Brian Gerst 2020-03-13 82 #define __COND_SYSCALL(abi, name) \
0f78ff17112d8b34 Brian Gerst 2020-03-13 @83 __weak long __##abi##_##name(const struct pt_regs *__unused) \
6cc8d2b286d9e716 Brian Gerst 2020-03-13 84 { \
6cc8d2b286d9e716 Brian Gerst 2020-03-13 85 return sys_ni_syscall(); \
6cc8d2b286d9e716 Brian Gerst 2020-03-13 86 }
6cc8d2b286d9e716 Brian Gerst 2020-03-13 87

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


Attachments:
(No filename) (19.68 kB)
.config.gz (33.20 kB)
Download all attachments

2021-03-16 18:44:30

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> Current quotactl syscall uses a path to a block device to specify the
> filesystem to work on which makes it unsuitable for filesystems that
> do not have a block device. This series adds a new syscall quotactl_path()
> which replaces the path to the block device with a mountpath, but otherwise
> behaves like original quotactl.
>
> This is done to add quota support to UBIFS. UBIFS quota support has been
> posted several times with different approaches to put the mountpath into
> the existing quotactl() syscall until it has been suggested to make it a
> new syscall instead, so here it is.
>
> I'm not posting the full UBIFS quota series here as it remains unchanged
> and I'd like to get feedback to the new syscall first. For those interested
> the most recent series can be found here: https://lwn.net/Articles/810463/

Thanks. I've merged the two patches into my tree and will push them to
Linus for the next merge window.

Honza

>
> Changes since v2:
> - Rebase on v5.12-rc1
> - replace mountpath.dentry->d_inode->i_sb with mountpath.mnt->mnt_sb
> - fix wrong macro usage in arch/x86/entry/syscalls/syscall_32.tbl
> - +Cc [email protected]
>
> Changes since (implicit) v1:
> - Ignore second path argument to Q_QUOTAON. With this quotactl_path() can
> only do the Q_QUOTAON operation on filesystems which use hidden inodes
> for quota metadata storage
> - Drop unnecessary quotactl_cmd_onoff() check
>
> Sascha Hauer (2):
> quota: Add mountpath based quota support
> quota: wire up quotactl_path
>
> arch/alpha/kernel/syscalls/syscall.tbl | 1 +
> arch/arm/tools/syscall.tbl | 1 +
> arch/arm64/include/asm/unistd.h | 2 +-
> arch/arm64/include/asm/unistd32.h | 2 +
> arch/ia64/kernel/syscalls/syscall.tbl | 1 +
> arch/m68k/kernel/syscalls/syscall.tbl | 1 +
> arch/microblaze/kernel/syscalls/syscall.tbl | 1 +
> arch/mips/kernel/syscalls/syscall_n32.tbl | 1 +
> arch/mips/kernel/syscalls/syscall_n64.tbl | 1 +
> arch/mips/kernel/syscalls/syscall_o32.tbl | 1 +
> arch/parisc/kernel/syscalls/syscall.tbl | 1 +
> arch/powerpc/kernel/syscalls/syscall.tbl | 1 +
> arch/s390/kernel/syscalls/syscall.tbl | 1 +
> arch/sh/kernel/syscalls/syscall.tbl | 1 +
> arch/sparc/kernel/syscalls/syscall.tbl | 1 +
> arch/x86/entry/syscalls/syscall_32.tbl | 1 +
> arch/x86/entry/syscalls/syscall_64.tbl | 1 +
> arch/xtensa/kernel/syscalls/syscall.tbl | 1 +
> fs/quota/quota.c | 49 +++++++++++++++++++--
> include/linux/syscalls.h | 2 +
> include/uapi/asm-generic/unistd.h | 4 +-
> kernel/sys_ni.c | 1 +
> 22 files changed, 71 insertions(+), 5 deletions(-)
>
> --
> 2.29.2
>
--
Jan Kara <[email protected]>
SUSE Labs, CR

2021-03-24 15:46:46

by Sascha Hauer

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Tue, Mar 16, 2021 at 12:29:16PM +0100, Jan Kara wrote:
> On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > Current quotactl syscall uses a path to a block device to specify the
> > filesystem to work on which makes it unsuitable for filesystems that
> > do not have a block device. This series adds a new syscall quotactl_path()
> > which replaces the path to the block device with a mountpath, but otherwise
> > behaves like original quotactl.
> >
> > This is done to add quota support to UBIFS. UBIFS quota support has been
> > posted several times with different approaches to put the mountpath into
> > the existing quotactl() syscall until it has been suggested to make it a
> > new syscall instead, so here it is.
> >
> > I'm not posting the full UBIFS quota series here as it remains unchanged
> > and I'd like to get feedback to the new syscall first. For those interested
> > the most recent series can be found here: https://lwn.net/Articles/810463/
>
> Thanks. I've merged the two patches into my tree and will push them to
> Linus for the next merge window.

Thanks by the way. Now that these patches are merged I'll respin my
UBIFS quota series soon.

Sascha

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

2021-05-12 11:03:39

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

Added a few more CCs.

On Tue 16-03-21 12:29:16, Jan Kara wrote:
> On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > Current quotactl syscall uses a path to a block device to specify the
> > filesystem to work on which makes it unsuitable for filesystems that
> > do not have a block device. This series adds a new syscall quotactl_path()
> > which replaces the path to the block device with a mountpath, but otherwise
> > behaves like original quotactl.
> >
> > This is done to add quota support to UBIFS. UBIFS quota support has been
> > posted several times with different approaches to put the mountpath into
> > the existing quotactl() syscall until it has been suggested to make it a
> > new syscall instead, so here it is.
> >
> > I'm not posting the full UBIFS quota series here as it remains unchanged
> > and I'd like to get feedback to the new syscall first. For those interested
> > the most recent series can be found here: https://lwn.net/Articles/810463/
>
> Thanks. I've merged the two patches into my tree and will push them to
> Linus for the next merge window.

So there are some people at LWN whining that quotactl_path() has no dirfd
and flags arguments for specifying the target. Somewhat late in the game
but since there's no major release with the syscall and no userspace using
it, I think we could still change that. What do you think? What they
suggest does make some sense. But then, rather then supporting API for
million-and-one ways in which I may wish to lookup a fs object, won't it be
better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
AFAICT) and be done with that?

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2021-05-12 13:19:02

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> Added a few more CCs.
>
> On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > Current quotactl syscall uses a path to a block device to specify the
> > > filesystem to work on which makes it unsuitable for filesystems that
> > > do not have a block device. This series adds a new syscall quotactl_path()
> > > which replaces the path to the block device with a mountpath, but otherwise
> > > behaves like original quotactl.
> > >
> > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > posted several times with different approaches to put the mountpath into
> > > the existing quotactl() syscall until it has been suggested to make it a
> > > new syscall instead, so here it is.
> > >
> > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > and I'd like to get feedback to the new syscall first. For those interested
> > > the most recent series can be found here: https://lwn.net/Articles/810463/
> >
> > Thanks. I've merged the two patches into my tree and will push them to
> > Linus for the next merge window.
>
> So there are some people at LWN whining that quotactl_path() has no dirfd
> and flags arguments for specifying the target. Somewhat late in the game
> but since there's no major release with the syscall and no userspace using
> it, I think we could still change that. What do you think? What they
> suggest does make some sense. But then, rather then supporting API for
> million-and-one ways in which I may wish to lookup a fs object, won't it be
> better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> AFAICT) and be done with that?

I think adding a dirfd argument makes a lot of sense (Unless there are
some restrictions around quotas I'm misunderstanding.).

If I may: in general, I think we should aim to not add additional system
calls that operate on paths only. Purely path-based apis tend to be the
source of security issues especially when scoped lookups are really
important which given the ubiquity of sandboxing solutions nowadays is
quite often actually.
For example, when openat2() landed it gave such a boost in lookup
capabilities that I switched some libraries over to only ever do scoped
lookups, i.e. I decide on a starting point that gets opened path-based
and then explicitly express how I want that lookup to proceed ultimately
opening the final path component on which I want to perform operations.
Combined with the mount API almost everything can be done purely fd
based.

In addition to that dirfd-scopable system calls allow for a much nicer
api experience when programming in userspace.

Christian

2021-05-12 13:21:16

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Wed 12-05-21 14:53:10, Christian Brauner wrote:
> On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> > Added a few more CCs.
> >
> > On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > > Current quotactl syscall uses a path to a block device to specify the
> > > > filesystem to work on which makes it unsuitable for filesystems that
> > > > do not have a block device. This series adds a new syscall quotactl_path()
> > > > which replaces the path to the block device with a mountpath, but otherwise
> > > > behaves like original quotactl.
> > > >
> > > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > > posted several times with different approaches to put the mountpath into
> > > > the existing quotactl() syscall until it has been suggested to make it a
> > > > new syscall instead, so here it is.
> > > >
> > > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > > and I'd like to get feedback to the new syscall first. For those interested
> > > > the most recent series can be found here: https://lwn.net/Articles/810463/
> > >
> > > Thanks. I've merged the two patches into my tree and will push them to
> > > Linus for the next merge window.
> >
> > So there are some people at LWN whining that quotactl_path() has no dirfd
> > and flags arguments for specifying the target. Somewhat late in the game
> > but since there's no major release with the syscall and no userspace using
> > it, I think we could still change that. What do you think? What they
> > suggest does make some sense. But then, rather then supporting API for
> > million-and-one ways in which I may wish to lookup a fs object, won't it be
> > better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> > AFAICT) and be done with that?
>
> I think adding a dirfd argument makes a lot of sense (Unless there are
> some restrictions around quotas I'm misunderstanding.).
>
> If I may: in general, I think we should aim to not add additional system
> calls that operate on paths only. Purely path-based apis tend to be the
> source of security issues especially when scoped lookups are really
> important which given the ubiquity of sandboxing solutions nowadays is
> quite often actually.
> For example, when openat2() landed it gave such a boost in lookup
> capabilities that I switched some libraries over to only ever do scoped
> lookups, i.e. I decide on a starting point that gets opened path-based
> and then explicitly express how I want that lookup to proceed ultimately
> opening the final path component on which I want to perform operations.
> Combined with the mount API almost everything can be done purely fd
> based.
>
> In addition to that dirfd-scopable system calls allow for a much nicer
> api experience when programming in userspace.

OK, thanks for your insights. But when we add 'dirfd' I wonder whether we
still need the 'path' component then. I mean you can always do fd =
openat2(), quotactl_fd(fd, ...). After all ioctl() works exactly that way
since the beginning. The only advantage of quotactl_xxx() taking path would
be saving the open(2) call. That is somewhat convenient for simple cases
(but also error prone in complex setups as you point out) and can be also
sligthly faster (but quotactl is hardly a performance sensitive thing)...

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2021-05-12 15:30:20

by Sascha Hauer

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> Added a few more CCs.
>
> On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > Current quotactl syscall uses a path to a block device to specify the
> > > filesystem to work on which makes it unsuitable for filesystems that
> > > do not have a block device. This series adds a new syscall quotactl_path()
> > > which replaces the path to the block device with a mountpath, but otherwise
> > > behaves like original quotactl.
> > >
> > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > posted several times with different approaches to put the mountpath into
> > > the existing quotactl() syscall until it has been suggested to make it a
> > > new syscall instead, so here it is.
> > >
> > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > and I'd like to get feedback to the new syscall first. For those interested
> > > the most recent series can be found here: https://lwn.net/Articles/810463/
> >
> > Thanks. I've merged the two patches into my tree and will push them to
> > Linus for the next merge window.
>
> So there are some people at LWN whining that quotactl_path() has no dirfd
> and flags arguments for specifying the target. Somewhat late in the game
> but since there's no major release with the syscall and no userspace using
> it, I think we could still change that. What do you think? What they
> suggest does make some sense. But then, rather then supporting API for
> million-and-one ways in which I may wish to lookup a fs object, won't it be
> better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> AFAICT) and be done with that?

This sounds like a much cleaner interface to me. If we agree on this I
wouldn't mind spinning this patch for another few rounds.

Sascha

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

2021-05-12 17:39:55

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Wed, May 12, 2021 at 03:14:29PM +0200, Jan Kara wrote:
> On Wed 12-05-21 14:53:10, Christian Brauner wrote:
> > On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> > > Added a few more CCs.
> > >
> > > On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > > > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > > > Current quotactl syscall uses a path to a block device to specify the
> > > > > filesystem to work on which makes it unsuitable for filesystems that
> > > > > do not have a block device. This series adds a new syscall quotactl_path()
> > > > > which replaces the path to the block device with a mountpath, but otherwise
> > > > > behaves like original quotactl.
> > > > >
> > > > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > > > posted several times with different approaches to put the mountpath into
> > > > > the existing quotactl() syscall until it has been suggested to make it a
> > > > > new syscall instead, so here it is.
> > > > >
> > > > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > > > and I'd like to get feedback to the new syscall first. For those interested
> > > > > the most recent series can be found here: https://lwn.net/Articles/810463/
> > > >
> > > > Thanks. I've merged the two patches into my tree and will push them to
> > > > Linus for the next merge window.
> > >
> > > So there are some people at LWN whining that quotactl_path() has no dirfd
> > > and flags arguments for specifying the target. Somewhat late in the game
> > > but since there's no major release with the syscall and no userspace using
> > > it, I think we could still change that. What do you think? What they
> > > suggest does make some sense. But then, rather then supporting API for
> > > million-and-one ways in which I may wish to lookup a fs object, won't it be
> > > better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> > > AFAICT) and be done with that?
> >
> > I think adding a dirfd argument makes a lot of sense (Unless there are
> > some restrictions around quotas I'm misunderstanding.).
> >
> > If I may: in general, I think we should aim to not add additional system
> > calls that operate on paths only. Purely path-based apis tend to be the
> > source of security issues especially when scoped lookups are really
> > important which given the ubiquity of sandboxing solutions nowadays is
> > quite often actually.
> > For example, when openat2() landed it gave such a boost in lookup
> > capabilities that I switched some libraries over to only ever do scoped
> > lookups, i.e. I decide on a starting point that gets opened path-based
> > and then explicitly express how I want that lookup to proceed ultimately
> > opening the final path component on which I want to perform operations.
> > Combined with the mount API almost everything can be done purely fd
> > based.
> >
> > In addition to that dirfd-scopable system calls allow for a much nicer
> > api experience when programming in userspace.
>
> OK, thanks for your insights. But when we add 'dirfd' I wonder whether we
> still need the 'path' component then. I mean you can always do fd =
> openat2(), quotactl_fd(fd, ...). After all ioctl() works exactly that way
> since the beginning. The only advantage of quotactl_xxx() taking path would
> be saving the open(2) call. That is somewhat convenient for simple cases
> (but also error prone in complex setups as you point out) and can be also
> sligthly faster (but quotactl is hardly a performance sensitive thing)...

That's a bit tricky indeed. It would feel consistent to add a path
argument as most of our fs apis seems to work that way even stuff like
fanotify_mark() but indeed a fd-only based api would be fine too. I
would try to follow recent additions/prior art here, I think.

2021-05-17 19:25:24

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Wed 12-05-21 17:36:21, Christian Brauner wrote:
> On Wed, May 12, 2021 at 03:14:29PM +0200, Jan Kara wrote:
> > On Wed 12-05-21 14:53:10, Christian Brauner wrote:
> > > On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> > > > Added a few more CCs.
> > > >
> > > > On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > > > > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > > > > Current quotactl syscall uses a path to a block device to specify the
> > > > > > filesystem to work on which makes it unsuitable for filesystems that
> > > > > > do not have a block device. This series adds a new syscall quotactl_path()
> > > > > > which replaces the path to the block device with a mountpath, but otherwise
> > > > > > behaves like original quotactl.
> > > > > >
> > > > > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > > > > posted several times with different approaches to put the mountpath into
> > > > > > the existing quotactl() syscall until it has been suggested to make it a
> > > > > > new syscall instead, so here it is.
> > > > > >
> > > > > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > > > > and I'd like to get feedback to the new syscall first. For those interested
> > > > > > the most recent series can be found here: https://lwn.net/Articles/810463/
> > > > >
> > > > > Thanks. I've merged the two patches into my tree and will push them to
> > > > > Linus for the next merge window.
> > > >
> > > > So there are some people at LWN whining that quotactl_path() has no dirfd
> > > > and flags arguments for specifying the target. Somewhat late in the game
> > > > but since there's no major release with the syscall and no userspace using
> > > > it, I think we could still change that. What do you think? What they
> > > > suggest does make some sense. But then, rather then supporting API for
> > > > million-and-one ways in which I may wish to lookup a fs object, won't it be
> > > > better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> > > > AFAICT) and be done with that?
> > >
> > > I think adding a dirfd argument makes a lot of sense (Unless there are
> > > some restrictions around quotas I'm misunderstanding.).
> > >
> > > If I may: in general, I think we should aim to not add additional system
> > > calls that operate on paths only. Purely path-based apis tend to be the
> > > source of security issues especially when scoped lookups are really
> > > important which given the ubiquity of sandboxing solutions nowadays is
> > > quite often actually.
> > > For example, when openat2() landed it gave such a boost in lookup
> > > capabilities that I switched some libraries over to only ever do scoped
> > > lookups, i.e. I decide on a starting point that gets opened path-based
> > > and then explicitly express how I want that lookup to proceed ultimately
> > > opening the final path component on which I want to perform operations.
> > > Combined with the mount API almost everything can be done purely fd
> > > based.
> > >
> > > In addition to that dirfd-scopable system calls allow for a much nicer
> > > api experience when programming in userspace.
> >
> > OK, thanks for your insights. But when we add 'dirfd' I wonder whether we
> > still need the 'path' component then. I mean you can always do fd =
> > openat2(), quotactl_fd(fd, ...). After all ioctl() works exactly that way
> > since the beginning. The only advantage of quotactl_xxx() taking path would
> > be saving the open(2) call. That is somewhat convenient for simple cases
> > (but also error prone in complex setups as you point out) and can be also
> > sligthly faster (but quotactl is hardly a performance sensitive thing)...
>
> That's a bit tricky indeed. It would feel consistent to add a path
> argument as most of our fs apis seems to work that way even stuff like
> fanotify_mark() but indeed a fd-only based api would be fine too. I
> would try to follow recent additions/prior art here, I think.

Thanks for opinion Christian. Sasha, I've decided to disable the syscall
for now (I plan to push attached patch to Linus later this week). Will you
please update the syscall to just take 'fd' argument instead of the path to
leave dealing with path pitfalls to syscalls such as openat2()? Probably
renaming to quotactl_fd() would be also good. Thanks!

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR


Attachments:
(No filename) (4.40 kB)
0001-quota-Disable-quotactl_path-syscall.patch (13.06 kB)
Download all attachments

2021-05-24 08:53:00

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Wed 12-05-21 17:03:46, Sascha Hauer wrote:
> On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> > Added a few more CCs.
> >
> > On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > > Current quotactl syscall uses a path to a block device to specify the
> > > > filesystem to work on which makes it unsuitable for filesystems that
> > > > do not have a block device. This series adds a new syscall quotactl_path()
> > > > which replaces the path to the block device with a mountpath, but otherwise
> > > > behaves like original quotactl.
> > > >
> > > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > > posted several times with different approaches to put the mountpath into
> > > > the existing quotactl() syscall until it has been suggested to make it a
> > > > new syscall instead, so here it is.
> > > >
> > > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > > and I'd like to get feedback to the new syscall first. For those interested
> > > > the most recent series can be found here: https://lwn.net/Articles/810463/
> > >
> > > Thanks. I've merged the two patches into my tree and will push them to
> > > Linus for the next merge window.
> >
> > So there are some people at LWN whining that quotactl_path() has no dirfd
> > and flags arguments for specifying the target. Somewhat late in the game
> > but since there's no major release with the syscall and no userspace using
> > it, I think we could still change that. What do you think? What they
> > suggest does make some sense. But then, rather then supporting API for
> > million-and-one ways in which I may wish to lookup a fs object, won't it be
> > better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> > AFAICT) and be done with that?
>
> This sounds like a much cleaner interface to me. If we agree on this I
> wouldn't mind spinning this patch for another few rounds.

So the syscall is currently disabled in Linus' tree. Will you send a patch
for new fd-based quotactl variant?

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2021-05-25 08:23:38

by Sascha Hauer

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Mon, May 24, 2021 at 10:49:12AM +0200, Jan Kara wrote:
> On Wed 12-05-21 17:03:46, Sascha Hauer wrote:
> > On Wed, May 12, 2021 at 01:01:49PM +0200, Jan Kara wrote:
> > > Added a few more CCs.
> > >
> > > On Tue 16-03-21 12:29:16, Jan Kara wrote:
> > > > On Thu 04-03-21 13:35:38, Sascha Hauer wrote:
> > > > > Current quotactl syscall uses a path to a block device to specify the
> > > > > filesystem to work on which makes it unsuitable for filesystems that
> > > > > do not have a block device. This series adds a new syscall quotactl_path()
> > > > > which replaces the path to the block device with a mountpath, but otherwise
> > > > > behaves like original quotactl.
> > > > >
> > > > > This is done to add quota support to UBIFS. UBIFS quota support has been
> > > > > posted several times with different approaches to put the mountpath into
> > > > > the existing quotactl() syscall until it has been suggested to make it a
> > > > > new syscall instead, so here it is.
> > > > >
> > > > > I'm not posting the full UBIFS quota series here as it remains unchanged
> > > > > and I'd like to get feedback to the new syscall first. For those interested
> > > > > the most recent series can be found here: https://lwn.net/Articles/810463/
> > > >
> > > > Thanks. I've merged the two patches into my tree and will push them to
> > > > Linus for the next merge window.
> > >
> > > So there are some people at LWN whining that quotactl_path() has no dirfd
> > > and flags arguments for specifying the target. Somewhat late in the game
> > > but since there's no major release with the syscall and no userspace using
> > > it, I think we could still change that. What do you think? What they
> > > suggest does make some sense. But then, rather then supporting API for
> > > million-and-one ways in which I may wish to lookup a fs object, won't it be
> > > better to just pass 'fd' in the new syscall (it may well be just O_PATH fd
> > > AFAICT) and be done with that?
> >
> > This sounds like a much cleaner interface to me. If we agree on this I
> > wouldn't mind spinning this patch for another few rounds.
>
> So the syscall is currently disabled in Linus' tree. Will you send a patch
> for new fd-based quotactl variant?

I'll sure do that, but I don't know when I can find a timeslot for it.
I hope I can come up with something next month.

Sascha

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

2021-05-25 08:38:53

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

Adding the dfd argument should be as simple as this patch (which also
moves the cmd argument later to match typical calling conventions).

It might be worth to rename the syscall to quotactlat to better match
other syscalls. A flags argument doesn't make much sense here, as the
cmd argument can be used for extensions and is properly checked for
unknown values.

diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index 05e4bd9ab6d6..940101396feb 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -968,8 +968,8 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const char __user *, special,
return ret;
}

-SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
- mountpoint, qid_t, id, void __user *, addr)
+SYSCALL_DEFINE5(quotactl_path, int, dfd, const char __user *, mountpoint,
+ unsigned int, cmd, qid_t, id, void __user *, addr)
{
struct super_block *sb;
struct path mountpath;
@@ -980,8 +980,8 @@ SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
if (type >= MAXQUOTAS)
return -EINVAL;

- ret = user_path_at(AT_FDCWD, mountpoint,
- LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, &mountpath);
+ ret = user_path_at(dfd, mountpoint, LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT,
+ &mountpath);
if (ret)
return ret;

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a672bbe28577..ae34984e2ab9 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -483,8 +483,8 @@ asmlinkage long sys_pipe2(int __user *fildes, int flags);
/* fs/quota.c */
asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
qid_t id, void __user *addr);
-asmlinkage long sys_quotactl_path(unsigned int cmd, const char __user *mountpoint,
- qid_t id, void __user *addr);
+asmlinkage long sys_quotactl_path(int dfd, const char __user *mountpoint,
+ unsigned int cmd, qid_t id, void __user *addr);

/* fs/readdir.c */
asmlinkage long sys_getdents64(unsigned int fd,

2021-05-25 18:00:50

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support

On Tue 25-05-21 09:05:50, Christoph Hellwig wrote:
> Adding the dfd argument should be as simple as this patch (which also
> moves the cmd argument later to match typical calling conventions).
>
> It might be worth to rename the syscall to quotactlat to better match
> other syscalls. A flags argument doesn't make much sense here, as the
> cmd argument can be used for extensions and is properly checked for
> unknown values.

Thanks for the patch! So I was actually thinking about going to completely
fd-based syscall like ioctl(2) and then we don't have to worry about lookup
flags or paths at all. What do people thing about attached patch?

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR


Attachments:
(No filename) (722.00 B)
0001-quota-Change-quotactl_path-systcall-to-an-fd-based-o.patch (3.37 kB)
Download all attachments