From: Petr Vorel <pvorel@suse.cz>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org, ltp@lists.linux.it,
Cyril Hrubis <chrubis@suse.cz>, Theodore Ts'o <tytso@mit.edu>,
Andreas Dilger <adilger.kernel@dilger.ca>,
Jan Kara <jack@suse.com>
Subject: Re: [LTP] [PATCH 1/1] ioctl_ficlone03.c: Support test on more filesystems
Date: Tue, 22 Jul 2025 15:50:49 +0200 [thread overview]
Message-ID: <20250722135049.GB84869@pevik> (raw)
In-Reply-To: <azo7y22pblcngf6y5xkzda5cew4p3kxylfse7i32hixjtld2mh@ml2bonivmpbe>
Hi Jan, all,
> Hi!
> On Tue 22-07-25 12:23:46, Petr Vorel wrote:
> > ...
> > > > static void setup(void)
> > > I find it strange that we manage to set the FS_IMMUTABLE_FL in the setup
> > > with the FS_IOC_SETFLAGS without any error. Maybe it would make sense to
> > > check with ext devs what is going on here.
> > > > @@ -117,6 +123,10 @@ static struct tst_test test = {
> > > > .mkfs_ver = "mkfs.xfs >= 1.5.0",
> > > > .mkfs_opts = (const char *const []) {"-m", "reflink=1", NULL},
> > > > },
> > > > + {.type = "ext2"},
> > > > + {.type = "ext3"},
> > > > + {.type = "ext4"},
> > > > + {.type = "tmpfs"},
> > > > {}
> > While I was working on extending [1] LTP ioctl_ficlone03.c to run on more
> > filesystems [2], I found that ext[2-4] don't support FS_IMMUTABLE_FL.
> Why do you think FS_IMMUTABLE_FL is unsupported? ext2 was the filesystem
> actually introducing it to the kernel ;)
Lol, I should have git grep kernel sources and google before asking silly
question :). Thanks for correcting me.
> > immut_fd = open(MNTPOINT"/immutable", O_CREAT | O_RDWR, 0640);
> > mnt_file = open(MNTPOINT"/file", O_CREAT | O_RDWR, 0640);
> > int attr = FS_IMMUTABLE_FL;
> > ioctl(immut_fd, FS_IOC_SETFLAGS, &attr);
> > ...
> > struct file_clone_range *clone_range;
> > ioctl(immut_fd, FICLONE, mnt_file),
> > ioctl(immut_fd, FICLONERANGE, clone_range),
> > The last two ioctl() with FICLONE and FICLONERANGE get errno EOPNOTSUPP
> > (instead of EPERM as on other fs). Cyril raised concern [3], why first
> > ioctl() FS_IOC_SETFLAGS even works. Shouldn't it also gets EINVAL as
> > vfat, exfat and ntfs get?
> Unlink FICLONE and FICLONERANGE which are indeed unsupported on any ext?
> based filesystem so EOPNOTSUPP seems like a correct answer to me.
> So I'm confused where you see a problem.
Thanks for info, obviously there is no problem now :).
I'll amend the commit message before merge that FICLONE and FICLONERANGE are not
supported (not FS_IMMUTABLE_FL).
Kind regards,
Petr
> Honza
prev parent reply other threads:[~2025-07-22 13:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250326142259.50981-1-pvorel@suse.cz>
[not found] ` <aHEccDO8lJiTzbEs@yuki.lan>
2025-07-22 10:23 ` [LTP] [PATCH 1/1] ioctl_ficlone03.c: Support test on more filesystems Petr Vorel
2025-07-22 11:41 ` Jan Kara
2025-07-22 13:50 ` Petr Vorel [this message]
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=20250722135049.GB84869@pevik \
--to=pvorel@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=chrubis@suse.cz \
--cc=jack@suse.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=tytso@mit.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox