[LTP] [PATCH v1] mount_setattr02.c: Check mount_setattr attr.propagation
Petr Vorel
pvorel@suse.cz
Wed Feb 19 10:05:36 CET 2025
> On Tue, Feb 18, 2025 at 04:18:58PM +0100, Petr Vorel wrote:
> > Hi Wei,
> > nit: I guess you want to replace dot with space in subject.
> You mean i s/attr.propagation/attr propagation ?
Yes.
...
> > > +#define DIRA "/DIRA_PROPAGATION_CHECK"
> > Is it necessary to to use directory under root?
> Yes. Otherwise failed will happen during mount_setattr.
> But i have not check for detail.
Ideally we would create files in TMPDIR. Specially if bug in the code leave
/DIRA_PROPAGATION_CHECK kept.
> > ...
> > > +static void cleanup(void)
> > > +{
> > I guess this is due result of:
> > SAFE_MOUNT(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0);
> > There should be either a proper detection whether this works or
> > ../../../../include/lapi/fsmount.h:113: TCONF: syscall(442) __NR_mount_setattr not supported on your arch
> > mount_setattr02.c:52: TWARN: rmdir(/DIRA_PROPAGATION_CHECK) failed: EBUSY (16)
> > > + SAFE_RMDIR(DIRA);
> > When running on old kernel (e.g. SLES based 4.12) it fails due TCONF:
> > ../../../../include/lapi/fsmount.h:197: TCONF: Test not supported on kernel version < v5.2
> > mount_setattr02.c:52: TWARN: rmdir(/DIRA_PROPAGATION_CHECK) failed: ENOENT (2)
> > There should be a flag to remove dir only when it was created.
> > > +
> > nit: please remove this new line (I have to keep asking this :( ).
> Sorry, i need pay attention, thanks for point this out with great patient :).
Thank you, not a big deal :).
...
> > + I later create generic helper from is_shared_mount().
> I sent v2 patch now, once your create generic helper i can do another patch together with
> your generic helper.
Sure, it should not block your work on the test.
Kind regards,
Petr
> > Kind regards,
> > Petr
More information about the ltp
mailing list