public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] ioctl06: fix BLKRASET failures in small sectors
@ 2017-04-27 10:12 Li Wang
  2017-04-27 15:33 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Li Wang @ 2017-04-27 10:12 UTC (permalink / raw)
  To: ltp

ioctl() failed to set readahead area in smaller sectors on ppc/aarch64
(PAGESIZE == 65536kB) arch, that's because the minimal readahead pages
aligned by '(arg * 512) / PAGE_SIZE'. See:

 block/ioctl.c:
         case BLKRASET:
         case BLKFRASET:
                 if(!capable(CAP_SYS_ADMIN))
                         return -EACCES;
                 bdev->bd_bdi->ra_pages = (arg * 512) / PAGE_SIZE;
                 return 0;

In this patch, shift the test value with increase by 512 bytes
(base on: blockdev(8) --setra).

Error log:
tst_device.c:82: INFO: Found free device '/dev/loop1'
tst_test.c:847: INFO: Timeout per run is 0h 05m 00s
ioctl06.c:37: INFO: BLKRAGET original value 256
ioctl06.c:44: PASS: BLKRASET 0 read back correctly
ioctl06.c:46: FAIL: BLKRASET 64 read back 0
ioctl06.c:44: PASS: BLKRASET 128 read back correctly
ioctl06.c:46: FAIL: BLKRASET 192 read back 128
ioctl06.c:44: PASS: BLKRASET 256 read back correctly
ioctl06.c:46: FAIL: BLKRASET 320 read back 256
ioctl06.c:44: PASS: BLKRASET 384 read back correctly
ioctl06.c:46: FAIL: BLKRASET 448 read back 384
ioctl06.c:44: PASS: BLKRASET 512 read back correctly
ioctl06.c:49: INFO: BLKRASET restoring original value 256

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/ioctl/ioctl06.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/ioctl/ioctl06.c b/testcases/kernel/syscalls/ioctl/ioctl06.c
index 082d097..30ca088 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl06.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl06.c
@@ -36,7 +36,7 @@ static void verify_ioctl(void)
 
 	tst_res(TINFO, "BLKRAGET original value %lu", rao);
 
-	for (ra = 0; ra <= 512; ra += 64) {
+	for (ra = 0; ra <= 4096; ra += 512) {
 		SAFE_IOCTL(fd, BLKRASET, ra);
 		SAFE_IOCTL(fd, BLKRAGET, &rab);
 
-- 
2.9.3


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

* [LTP] [PATCH] ioctl06: fix BLKRASET failures in small sectors
  2017-04-27 10:12 [LTP] [PATCH] ioctl06: fix BLKRASET failures in small sectors Li Wang
@ 2017-04-27 15:33 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2017-04-27 15:33 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2017-04-27 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-27 10:12 [LTP] [PATCH] ioctl06: fix BLKRASET failures in small sectors Li Wang
2017-04-27 15:33 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox