[LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y

Li Wang liwang@redhat.com
Tue Sep 7 07:53:07 CEST 2021


On Tue, Sep 7, 2021 at 1:38 PM Jan Stancek <jstancek@redhat.com> wrote:

>
>
> On Tue, Sep 7, 2021 at 4:20 AM Li Wang <liwang@redhat.com> wrote:
>
>>
>>
>> On Mon, Sep 6, 2021 at 4:36 PM Jan Stancek <jstancek@redhat.com> wrote:
>>
>>> commit f7e33bdbd6d1 ("fs: remove mandatory file locking support")
>>> removed mandatory file locking support, but mount option
>>> is still allowed and produces no error. There's a warning
>>> in dmesg but it's pr_warn_once() so we can't rely to always
>>> find it there.
>>>
>>> Make the test check also for CONFIG_MANDATORY_FILE_LOCKING=y.
>>>
>>
>> I'm wondering, if the SUT without CONFIG_MANDATORY_FILE_LOCKING
>> enabling, why the mount-check in setup() didn't report EPERM?
>>
>
> Because kernel commit f7e33bdbd6d1 removed that code, it generates
> warning message instead.
>

Ok, I see.


>
>
>
>>
>> And, should we drop the mount-check for EPERM from setup after adding
>> this .needs_kconfigs?
>>
>
> I'd keep it, it doesn't hurt anything and older kernels could get EPERM
> for other reason (like running test in namespace where you don't have
> CAP_SYS_ADMIN)
>

Sure, that sounds acceptable too.

Reviewed-by: Li Wang <liwang@redhat.com>

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210907/32f1db53/attachment.htm>


More information about the ltp mailing list