All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk
@ 2020-02-20  9:59 Cyril Hrubis
  2020-02-20 10:14 ` Yang Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2020-02-20  9:59 UTC (permalink / raw)
  To: ltp

There are minimal systems that does not ship with RAM disk kernel module
which makes this test fail with ENXIO when we attempt to open the block
device in the test setup.

LTP depends on heavily on loop device driver already so it makes sense
to switch over to a loop device backed block device instead.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/fgetxattr/fgetxattr02.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
index 02e81810a..82fb676be 100644
--- a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
+++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
@@ -210,7 +210,8 @@ static void setup(void)
 	size_t i = 0;
 	struct sockaddr_un sun;
 
-	dev_t dev = makedev(1, 3);
+	dev_t chr_dev = makedev(1, 3);
+	dev_t blk_dev = makedev(7, 3);
 
 	SAFE_TOUCH(FILENAME, 0644, NULL);
 	SAFE_TOUCH(SYMLINKF, 0644, NULL);
@@ -219,8 +220,8 @@ static void setup(void)
 
 	/* root: mknod(2) needs it to create something other than a file */
 	SAFE_MKNOD(FIFO, S_IFIFO | 0777, 0);
-	SAFE_MKNOD(CHR, S_IFCHR | 0777, dev);
-	SAFE_MKNOD(BLK, S_IFBLK | 0777, dev);
+	SAFE_MKNOD(CHR, S_IFCHR | 0777, chr_dev);
+	SAFE_MKNOD(BLK, S_IFBLK | 0777, blk_dev);
 
 	for (i = 0; i < ARRAY_SIZE(tc); i++) {
 
-- 
2.23.0


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

* [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk
  2020-02-20  9:59 [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk Cyril Hrubis
@ 2020-02-20 10:14 ` Yang Xu
  2020-02-20 10:18   ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Xu @ 2020-02-20 10:14 UTC (permalink / raw)
  To: ltp


Hi Cyril> There are minimal systems that does not ship with RAM disk 
kernel module
> which makes this test fail with ENXIO when we attempt to open the block
> device in the test setup.
> 
> LTP depends on heavily on loop device driver already so it makes sense
> to switch over to a loop device backed block device instead.
> 
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> ---
>   testcases/kernel/syscalls/fgetxattr/fgetxattr02.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
> index 02e81810a..82fb676be 100644
> --- a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
> +++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
> @@ -210,7 +210,8 @@ static void setup(void)
>   	size_t i = 0;
>   	struct sockaddr_un sun;
>   
> -	dev_t dev = makedev(1, 3);
> +	dev_t chr_dev = makedev(1, 3);
> +	dev_t blk_dev = makedev(7, 3);
  Can we use tst_find_free_loopdev to avoid a fixed loop dev like 
copy_file_range02.c?

Best Regards
Yang Xu
>   
>   	SAFE_TOUCH(FILENAME, 0644, NULL);
>   	SAFE_TOUCH(SYMLINKF, 0644, NULL);
> @@ -219,8 +220,8 @@ static void setup(void)
>   
>   	/* root: mknod(2) needs it to create something other than a file */
>   	SAFE_MKNOD(FIFO, S_IFIFO | 0777, 0);
> -	SAFE_MKNOD(CHR, S_IFCHR | 0777, dev);
> -	SAFE_MKNOD(BLK, S_IFBLK | 0777, dev);
> +	SAFE_MKNOD(CHR, S_IFCHR | 0777, chr_dev);
> +	SAFE_MKNOD(BLK, S_IFBLK | 0777, blk_dev);
>   
>   	for (i = 0; i < ARRAY_SIZE(tc); i++) {
>   
> 



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

* [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk
  2020-02-20 10:14 ` Yang Xu
@ 2020-02-20 10:18   ` Cyril Hrubis
  2020-02-20 10:31     ` Yang Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2020-02-20 10:18 UTC (permalink / raw)
  To: ltp

Hi!
> > which makes this test fail with ENXIO when we attempt to open the block
> > device in the test setup.
> > 
> > LTP depends on heavily on loop device driver already so it makes sense
> > to switch over to a loop device backed block device instead.
> > 
> > Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> > ---
> >   testcases/kernel/syscalls/fgetxattr/fgetxattr02.c | 7 ++++---
> >   1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
> > index 02e81810a..82fb676be 100644
> > --- a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
> > +++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
> > @@ -210,7 +210,8 @@ static void setup(void)
> >   	size_t i = 0;
> >   	struct sockaddr_un sun;
> >   
> > -	dev_t dev = makedev(1, 3);
> > +	dev_t chr_dev = makedev(1, 3);
> > +	dev_t blk_dev = makedev(7, 3);
>   Can we use tst_find_free_loopdev to avoid a fixed loop dev like 
> copy_file_range02.c?

I do not think that it matters here, we are not actually touching the
block device here, we just need to be able to open the block device so
that we can add an attribute to the file we have created. I does not
matter if it's used or not.

-- 
Cyril Hrubis
chrubis@suse.cz

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

* [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk
  2020-02-20 10:18   ` Cyril Hrubis
@ 2020-02-20 10:31     ` Yang Xu
  2020-02-25 11:14       ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Xu @ 2020-02-20 10:31 UTC (permalink / raw)
  To: ltp



Hi
> Hi!
>>> which makes this test fail with ENXIO when we attempt to open the block
>>> device in the test setup.
>>>
>>> LTP depends on heavily on loop device driver already so it makes sense
>>> to switch over to a loop device backed block device instead.
>>>
>>> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
>>> ---
>>>    testcases/kernel/syscalls/fgetxattr/fgetxattr02.c | 7 ++++---
>>>    1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
>>> index 02e81810a..82fb676be 100644
>>> --- a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
>>> +++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
>>> @@ -210,7 +210,8 @@ static void setup(void)
>>>    	size_t i = 0;
>>>    	struct sockaddr_un sun;
>>>    
>>> -	dev_t dev = makedev(1, 3);
>>> +	dev_t chr_dev = makedev(1, 3);
>>> +	dev_t blk_dev = makedev(7, 3);
>>    Can we use tst_find_free_loopdev to avoid a fixed loop dev like
>> copy_file_range02.c?
> 
> I do not think that it matters here, we are not actually touching the
> block device here, we just need to be able to open the block device so
> that we can add an attribute to the file we have created. I does not
> matter if it's used or not.
Sound reasonable, feel free to add
Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

> 



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

* [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk
  2020-02-20 10:31     ` Yang Xu
@ 2020-02-25 11:14       ` Cyril Hrubis
  0 siblings, 0 replies; 5+ messages in thread
From: Cyril Hrubis @ 2020-02-25 11:14 UTC (permalink / raw)
  To: ltp

Hi!
> Sound reasonable, feel free to add
> Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>

Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2020-02-25 11:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20  9:59 [LTP] [PATCH] syscalls/fgetxattr02: Use loop instead of RAM disk Cyril Hrubis
2020-02-20 10:14 ` Yang Xu
2020-02-20 10:18   ` Cyril Hrubis
2020-02-20 10:31     ` Yang Xu
2020-02-25 11:14       ` Cyril Hrubis

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.