From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Dmitry Antipov <dmantipov@yandex.ru>,
Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
akpm <akpm@linux-foundation.org>
Cc: ocfs2-devel@lists.linux.dev, lvc-project@linuxtesting.org
Subject: Re: [PATCH 1/2] ocfs2: add extra flags check in ocfs2_ioctl_move_extents()
Date: Thu, 9 Oct 2025 19:07:48 +0800 [thread overview]
Message-ID: <32dfd05f-0210-4a4f-8584-550bdedb06ec@linux.alibaba.com> (raw)
In-Reply-To: <20251009102349.181126-1-dmantipov@yandex.ru>
On 2025/10/9 18:23, Dmitry Antipov wrote:
> In 'ocfs2_ioctl_move_extents()', add extra check whether only actually
> supported flags are passed via 'ioctl(..., OCFS2_IOC_MOVE_EXT, ...)',
> and reject anything beyond OCFS2_MOVE_EXT_FL_AUTO_DEFRAG and
> OCFS2_MOVE_EXT_FL_PART_DEFRAG with -EINVAL. In particular,
> OCFS2_MOVE_EXT_FL_COMPLETE may be set by the kernel only and
> should never be passed from userspace.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Looks fine.
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> fs/ocfs2/move_extents.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c
> index 86f2631e6360..e038c009cdef 100644
> --- a/fs/ocfs2/move_extents.c
> +++ b/fs/ocfs2/move_extents.c
> @@ -1031,6 +1031,12 @@ int ocfs2_ioctl_move_extents(struct file *filp, void __user *argp)
> if (range.me_threshold > i_size_read(inode))
> range.me_threshold = i_size_read(inode);
>
> + if (range.me_flags & ~(OCFS2_MOVE_EXT_FL_AUTO_DEFRAG |
> + OCFS2_MOVE_EXT_FL_PART_DEFRAG)) {
> + status = -EINVAL;
> + goto out_free;
> + }
> +
> if (range.me_flags & OCFS2_MOVE_EXT_FL_AUTO_DEFRAG) {
> context->auto_defrag = 1;
>
next prev parent reply other threads:[~2025-10-09 11:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-08 11:20 [PATCH] ocfs2: add extra flags check in ocfs2_ioctl_move_extents() Dmitry Antipov
2025-10-09 2:15 ` Joseph Qi
2025-10-09 6:39 ` Dmitry Antipov
2025-10-09 7:51 ` Joseph Qi
2025-10-09 10:23 ` [PATCH 1/2] " Dmitry Antipov
2025-10-09 10:23 ` [PATCH 2/2] ocfs2: relax BUG() to ocfs2_error() in __ocfs2_move_extent() Dmitry Antipov
2025-10-09 11:12 ` Joseph Qi
2025-11-12 8:30 ` Andy Shevchenko
2025-11-12 18:02 ` Andrew Morton
2025-10-09 11:07 ` Joseph Qi [this message]
2025-10-09 10:25 ` [PATCH] ocfs2: add extra flags check in ocfs2_ioctl_move_extents() Dmitry Antipov
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=32dfd05f-0210-4a4f-8584-550bdedb06ec@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=dmantipov@yandex.ru \
--cc=jlbec@evilplan.org \
--cc=lvc-project@linuxtesting.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
/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.