All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-api@vger.kernel.org, Christoph Hellwig <hch@infradead.org>,
	kernel@pengutronix.de, Jan Kara <jack@suse.com>,
	Richard Weinberger <richard@nod.at>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <christian.brauner@ubuntu.com>
Subject: Re: [PATCH v3 0/2] quota: Add mountpath based quota support
Date: Tue, 25 May 2021 09:05:50 +0100	[thread overview]
Message-ID: <YKyv3sFKLKDWUZ3C@infradead.org> (raw)
In-Reply-To: <20210525072615.GR19819@pengutronix.de>

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,

  reply	other threads:[~2021-05-25  8:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 12:35 [PATCH v3 0/2] quota: Add mountpath based quota support Sascha Hauer
2021-03-04 12:35 ` [PATCH 1/2] " Sascha Hauer
2021-03-04 12:35 ` [PATCH 2/2] quota: wire up quotactl_path Sascha Hauer
2021-03-04 16:41   ` kernel test robot
2021-03-04 17:08   ` kernel test robot
2021-03-04 12:35 ` [PATCH] quotactl.2: Add documentation for quotactl_path() Sascha Hauer
2021-03-16 11:29 ` [PATCH v3 0/2] quota: Add mountpath based quota support Jan Kara
2021-03-24 15:43   ` Sascha Hauer
2021-05-12 11:01   ` Jan Kara
2021-05-12 12:53     ` Christian Brauner
2021-05-12 13:14       ` Jan Kara
2021-05-12 15:36         ` Christian Brauner
2021-05-17 12:50           ` Jan Kara
2021-05-12 15:03     ` Sascha Hauer
2021-05-24  8:49       ` Jan Kara
2021-05-25  7:26         ` Sascha Hauer
2021-05-25  8:05           ` Christoph Hellwig [this message]
2021-05-25 16:19             ` Jan Kara

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=YKyv3sFKLKDWUZ3C@infradead.org \
    --to=hch@infradead.org \
    --cc=christian.brauner@ubuntu.com \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=kernel@pengutronix.de \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=s.hauer@pengutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    /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.