Bug 678035

Summary: inotify_add_watch_0 test failing on RHEL 6.1
Product: Red Hat Enterprise Linux 6 Reporter: Matthew Booth <mbooth>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1CC: llim
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-07 13:45:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 678511    
Bug Blocks:    

Description Matthew Booth 2011-02-16 15:22:35 UTC
Description of problem:
libguestfs builds in RHEL 6.1 are currently failing due to the failure of test inotify_add_watch_0. Note that no code change or patches have been added since the last successful build, so the failure is presumably down a behavioural change of some dependent component. Top guesses would be: kvm, kernel or glibc.

The test fails in brew, and on my RHEL 6.1 KVM guest. I'm not able to test it on bare metal.

Example failure output:
  1/  1 test_inotify_add_watch_0
libguestfs: trace: available "inotify"
libguestfs: trace: available = 0
libguestfs: trace: blockdev_setrw "/dev/sda"
libguestfs: trace: blockdev_setrw = 0
libguestfs: trace: umount_all
libguestfs: trace: umount_all = 0
libguestfs: trace: lvm_remove_all
libguestfs: trace: lvm_remove_all = 0
libguestfs: trace: mount_options "" "/dev/sdb1" "/"
libguestfs: trace: mount_options = 0
libguestfs: trace: mkdir "/inotify_add_watch"
libguestfs: trace: mkdir = 0
libguestfs: trace: inotify_init 0
libguestfs: trace: inotify_init = 0
libguestfs: trace: inotify_add_watch "/inotify_add_watch" 1073741823
libguestfs: trace: inotify_add_watch = 1
libguestfs: trace: touch "/inotify_add_watch/a"
libguestfs: trace: touch = 0
libguestfs: trace: touch "/inotify_add_watch/b"
libguestfs: trace: touch = 0
libguestfs: trace: inotify_files
libguestfs: trace: inotify_files = [""]
test_inotify_add_watch_0: short list returned from command
test_inotify_add_watch_0 FAILED

Version-Release number of selected component (if applicable):
libguestfs-1.7.17-12.el6

Comment 1 Matthew Booth 2011-02-16 17:05:25 UTC
Minimal testcase with guestfish:

$ dd if=/dev/zero of=test.img bs=1M count=10
$ guestfish -a test.img

><fs> run
open /dev/kvm: No such file or directory
Could not initialize KVM, will disable KVM support
Using CPU model "cpu64-rhel6"
><fs> mkfs ext2 /dev/vda
><fs> mount /dev/vda /
><fs> inotify-init 0
><fs> mkdir /inotify_add_watch
><fs> inotify-add-watch /inotify_add_watch 1073741823
1
><fs> touch /inotify_add_watch/a
><fs> touch /inotify_add_watch/b
><fs> inotify-files 
><fs> quit

This same test succeeds with libguestfs-1.8.1-1.fc14 in F14.

Comment 2 Matthew Booth 2011-02-16 17:06:50 UTC
Note that changing inotify-init some number larger than zero in the above test doesn't make it work.

Comment 3 Richard W.M. Jones 2011-03-07 13:44:59 UTC
Closing this as it appears the problem was caused by
a kernel regression which has been fixed.