Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

block/017 fails because systemd tries to read it #50

Open
gurugio opened this issue Apr 2, 2019 · 0 comments
Open

block/017 fails because systemd tries to read it #50

gurugio opened this issue Apr 2, 2019 · 0 comments

Comments

@gurugio
Copy link

gurugio commented Apr 2, 2019

Hi,

block/017 always fails on my test machine.

gkim@ib1:~/pb-ltp/blktests$ sudo ./check block/017
block/017 (do I/O and check the inflight counter)            [failed]
    runtime  58.937s  ...  58.952s
    --- tests/block/017.out	2018-10-26 00:39:35.516915128 +0200
    +++ /home/gkim/pb-ltp/blktests/results/nodev/block/017.out.bad	2019-04-02 11:08:55.659410586 +0200
    @@ -7,8 +7,8 @@
     sysfs inflight writes 1
     sysfs stat 2
     diskstats 2
    -sysfs inflight reads 0
    +sysfs inflight reads 1
     sysfs inflight writes 0
    -sysfs stat 0
    ...
    (Run 'diff -u tests/block/017.out /home/gkim/pb-ltp/blktests/results/nodev/block/017.out.bad' to see the entire diff)

I found out that systemd-udevd read it when /dev/nullb0 is created and it increased read-inflight count.
Do you have any idea to solve it?

gkim@ib1:~/pb-ltp/blktests$ sudo modprobe null_blk queue_mode=2 irqmode=2 completion_nsec=5000000000
[sudo] password for gkim: 
gkim@ib1:~/pb-ltp/blktests$ ls /sys/block/nullb0/inflight 
/sys/block/nullb0/inflight
gkim@ib1:~/pb-ltp/blktests$ cat /sys/block/nullb0/inflight 
       1        0
gkim@ib1:~/pb-ltp/blktests$ sudo fuser /dev/nullb0
/dev/nullb0:         31484
gkim@ib1:~/pb-ltp/blktests$ ps 31484
  PID TTY      STAT   TIME COMMAND
31484 ?        D      0:00 /lib/systemd/systemd-udevd
gkim@ib1:~/pb-ltp/blktests$ cat /sys/block/nullb0/inflight 
       1        0

I tried following patch but it did not work.

gkim@ib1:~/pb-ltp/blktests$ git diff
diff --git a/tests/block/017 b/tests/block/017
index e4a9259..faab514 100755
--- a/tests/block/017
+++ b/tests/block/017
@@ -32,6 +32,8 @@ test() {
                return 1
        fi
 
+       udevadm settle
+       
        dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1 status=none &
        sleep 0.1
        show_inflight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant