* [LTP] ftruncate04 broken on kernels without mandatory locking
@ 2016-06-08 15:23 Jiri Jaburek
2016-06-09 9:32 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Jaburek @ 2016-06-08 15:23 UTC (permalink / raw)
To: ltp
Upstream kernel commit
9e8925b67a809bb27ce4b7d352d67f25cf1d7fc5
locks: Allow disabling mandatory locking at compile time
added a config option to remove support for mandatory locking
(mount -o mand, MS_MANDLOCK), which went into v4.5.
Some distributions (like Fedora) already disable it, causing
ftruncate04 to fail:
ftruncate04 0 TINFO : TMPDIR does not support mandatory locks
ftruncate04 0 TINFO : Found free device '/dev/loop0'
ftruncate04 0 TINFO : Formatting /dev/loop0 with ext2 opts=''
extra opts=''
mke2fs 1.42.13 (17-May-2015)
ftruncate04 1 TBROK : safe_macros.c:728: ftruncate04.c:247:
mount(/dev/loop0, dir/, ext2, 64, (nil)) failed: errno=EPERM(1):
Operation not permitted
ftruncate04 2 TBROK : safe_macros.c:728: Remaining cases broken
and indeed
$ mount /dev/loop0 /mnt/
$ umount /mnt
$ mount /dev/loop0 /mnt/ -o mand
mount: permission denied
The question is how to best fix the testcase - do the mount unsafely
and assume EPERM should be TCONF? Or somehow check kernel config?
Maybe do the mount first without MS_MANDLOCK (to rule out other perm
issues) and then remount with MS_MANDLOCK, checking EPERM?
Any other ideas?
Thanks,
Jiri
^ permalink raw reply [flat|nested] 2+ messages in thread
* [LTP] ftruncate04 broken on kernels without mandatory locking
2016-06-08 15:23 [LTP] ftruncate04 broken on kernels without mandatory locking Jiri Jaburek
@ 2016-06-09 9:32 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2016-06-09 9:32 UTC (permalink / raw)
To: ltp
Hi!
> Upstream kernel commit
>
> 9e8925b67a809bb27ce4b7d352d67f25cf1d7fc5
> locks: Allow disabling mandatory locking at compile time
>
> added a config option to remove support for mandatory locking
> (mount -o mand, MS_MANDLOCK), which went into v4.5.
>
> Some distributions (like Fedora) already disable it, causing
> ftruncate04 to fail:
>
> ftruncate04 0 TINFO : TMPDIR does not support mandatory locks
> ftruncate04 0 TINFO : Found free device '/dev/loop0'
> ftruncate04 0 TINFO : Formatting /dev/loop0 with ext2 opts=''
> extra opts=''
> mke2fs 1.42.13 (17-May-2015)
> ftruncate04 1 TBROK : safe_macros.c:728: ftruncate04.c:247:
> mount(/dev/loop0, dir/, ext2, 64, (nil)) failed: errno=EPERM(1):
> Operation not permitted
> ftruncate04 2 TBROK : safe_macros.c:728: Remaining cases broken
>
> and indeed
>
> $ mount /dev/loop0 /mnt/
> $ umount /mnt
> $ mount /dev/loop0 /mnt/ -o mand
> mount: permission denied
>
> The question is how to best fix the testcase - do the mount unsafely
> and assume EPERM should be TCONF? Or somehow check kernel config?
> Maybe do the mount first without MS_MANDLOCK (to rule out other perm
> issues) and then remount with MS_MANDLOCK, checking EPERM?
Too bad that it returns EPERM rather than ENOSYS.
Parsing kernel config portably between major distributions is very
troublesome if not impossible so I would like to avoid this path.
Checking for EPERM while remounting with MS_MANDLOCK sounds good to me.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-09 9:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-08 15:23 [LTP] ftruncate04 broken on kernels without mandatory locking Jiri Jaburek
2016-06-09 9:32 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox