All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y
@ 2021-09-06  8:35 ` Jan Stancek
  2021-09-06  9:00     ` Cyril Hrubis
  2021-09-07  2:20     ` Li Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Jan Stancek @ 2021-09-06  8:35 UTC (permalink / raw)
  To: ltp

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.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/ftruncate/ftruncate04.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate04.c b/testcases/kernel/syscalls/ftruncate/ftruncate04.c
index ad5c7bbb90ef..c832ceaa659d 100644
--- a/testcases/kernel/syscalls/ftruncate/ftruncate04.c
+++ b/testcases/kernel/syscalls/ftruncate/ftruncate04.c
@@ -168,6 +168,10 @@ static void setup(void)
 }
 
 static struct tst_test test = {
+	.needs_kconfigs = (const char *[]) {
+		"CONFIG_MANDATORY_FILE_LOCKING=y",
+		NULL
+	},
 	.test_all = verify_ftruncate,
 	.setup = setup,
 	.needs_checkpoints = 1,
-- 
2.27.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y
@ 2021-09-06  9:00     ` Cyril Hrubis
  0 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2021-09-06  9:00 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp

Hi!
Sounds good.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y
@ 2021-09-07  2:20     ` Li Wang
  2021-09-07  5:38         ` Jan Stancek
  0 siblings, 1 reply; 6+ messages in thread
From: Li Wang @ 2021-09-07  2:20 UTC (permalink / raw)
  To: Jan Stancek; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 649 bytes --]

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?

And, should we drop the mount-check for EPERM from setup after adding
this .needs_kconfigs?

-- 
Regards,
Li Wang

[-- Attachment #1.2: Type: text/html, Size: 1481 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y
@ 2021-09-07  5:38         ` Jan Stancek
  2021-09-07  5:53             ` Li Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Stancek @ 2021-09-07  5:38 UTC (permalink / raw)
  To: Li Wang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1009 bytes --]

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.


>
> 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)



>
> --
> Regards,
> Li Wang
>

[-- Attachment #1.2: Type: text/html, Size: 2846 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y
@ 2021-09-07  5:53             ` Li Wang
  2021-09-07  7:49                 ` Jan Stancek
  0 siblings, 1 reply; 6+ messages in thread
From: Li Wang @ 2021-09-07  5:53 UTC (permalink / raw)
  To: Jan Stancek; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1209 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 3607 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y
@ 2021-09-07  7:49                 ` Jan Stancek
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Stancek @ 2021-09-07  7:49 UTC (permalink / raw)
  To: Li Wang; +Cc: LTP List


[-- Attachment #1.1: Type: text/plain, Size: 1319 bytes --]

On Tue, Sep 7, 2021 at 7:53 AM Li Wang <liwang@redhat.com> wrote:

>
>
> 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>
>

Pushed.

[-- Attachment #1.2: Type: text/html, Size: 3912 bytes --]

[-- Attachment #2: Type: text/plain, Size: 60 bytes --]


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-07  7:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06  8:35 [LTP] [PATCH] ftruncate04: require CONFIG_MANDATORY_FILE_LOCKING=y Jan Stancek
2021-09-06  8:35 ` Jan Stancek
2021-09-06  9:00   ` Cyril Hrubis
2021-09-06  9:00     ` Cyril Hrubis
2021-09-07  2:20   ` Li Wang
2021-09-07  2:20     ` Li Wang
2021-09-07  5:38       ` Jan Stancek
2021-09-07  5:38         ` Jan Stancek
2021-09-07  5:53           ` Li Wang
2021-09-07  5:53             ` Li Wang
2021-09-07  7:49               ` Jan Stancek
2021-09-07  7:49                 ` Jan Stancek

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.