]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: be careful about what we stat in platform_check_mount
authorEric Sandeen <sandeen@redhat.com>
Wed, 23 May 2018 21:30:49 +0000 (16:30 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 23 May 2018 21:30:49 +0000 (16:30 -0500)
commit98c4a01c21b99b13d8aaa406ab15b7424ee5ef9f
tree58999b26a0912534934cf426771e266f3a9a7c7f
parent35f7c5b381ab3a0dc1a149fa0daad2fe78cb8c6e
xfsprogs: be careful about what we stat in platform_check_mount

After we lost ustat(2) in commit 4e7a824, we ended up with a slightly
bonkers method to determine if our target block device was mounted:
it goes through every entry returned by getmntent and stats the dir
to see if its underlying device matches ours.

Unfortunately that dir might be a hung nfs server and sadness ensues.

So just do a really simple sanity check before we try to stat the
mountpoint: does its device start with a / ?  If not, skip it.

Fixes: 4e7a824 ("libxfs/linux.c: Replace use of ustat by stat")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libfrog/linux.c