Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
SUSE:SLE-12-SP3:GA
coreutils-testsuite.1874
coreutils-df-fix-local-hanging-with-inaccessibl...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File coreutils-df-fix-local-hanging-with-inaccessible-remote-mounts.patch of Package coreutils-testsuite.1874
From: Philipp Thomas <pth@suse.de> Date: 2015-12-18 12:11:27+01:00 Subject: Fix hanging References: bsc#954222 Upstream: df used to hang when remounte mounts were unavailable @@ -, +, @@ --- NEWS | 3 +++ init.cfg | 2 +- src/df.c | 9 ++++++--- tests/df/no-mtab-status.sh | 3 ++- tests/df/skip-rootfs.sh | 3 ++- tests/df/total-verify.sh | 3 ++- 6 files changed, 16 insertions(+), 7 deletions(-) --- coreutils-8.22/NEWS +++ coreutils-8.22/NEWS @@ -2,6 +2,9 @@ GNU coreutils NEWS Changes done after the release of 8.22 + df --local no longer hangs with inaccessible remote mounts. + [bug introduced in coreutils-8.21] + df has more fixes related to the newer dynamic representation of file systems: Duplicates are elided for virtual file systems like tmpfs. Details for the correct device are output for points mounted multiple times. --- coreutils-8.22/init.cfg +++ coreutils-8.22/init.cfg @@ -79,7 +79,7 @@ is_local_dir_() require_mount_list_() { local mount_list_fail='cannot read table of mounted file systems' - df 2>&1 | grep -F "$mount_list_fail" >/dev/null && + df --local 2>&1 | grep -F "$mount_list_fail" >/dev/null && skip_ "$mount_list_fail" } --- coreutils-8.22/src/df.c +++ coreutils-8.22/src/df.c @@ -622,13 +622,16 @@ filter_mount_list (bool devices_only) struct devlist *devlist; struct mount_entry *discard_me = NULL; - /* TODO: On Linux we might avoid this stat() and another in get_dev() + /* Avoid stating remote file systems as that may hang. + TODO: On Linux we might avoid this stat() and another in get_dev() by using the device IDs available from /proc/self/mountinfo. read_file_system_list() could populate me_dev from those for efficiency and accuracy. */ - if (-1 == stat (me->me_mountdir, &buf)) + if ((me->me_remote && show_local_fs) + || -1 == stat (me->me_mountdir, &buf)) { - /* Stat failed - add ME to be able to complain about it later. */ + /* If remote, and showing just local, add ME for filtering later. + If stat failed; add ME to be able to complain about it later. */ buf.st_dev = me->me_dev; } else --- coreutils-8.22/tests/df/no-mtab-status.sh +++ coreutils-8.22/tests/df/no-mtab-status.sh @@ -21,7 +21,8 @@ print_ver_ df require_gcc_shared_ -df || skip_ "df fails" +# Protect against inaccessible remote mounts etc. +timeout 10 df || skip_ "df fails" # Simulate "mtab" failure. cat > k.c <<'EOF' || framework_failure_ --- coreutils-8.22/tests/df/skip-rootfs.sh +++ coreutils-8.22/tests/df/skip-rootfs.sh @@ -19,7 +19,8 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ df -df || skip_ "df fails" +# Protect against inaccessible remote mounts etc. +timeout 10 df || skip_ "df fails" # Verify that rootfs is in mtab (and shown when the -a option is specified). df -a >out || fail=1 --- coreutils-8.22/tests/df/total-verify.sh +++ coreutils-8.22/tests/df/total-verify.sh @@ -20,7 +20,8 @@ print_ver_ df require_perl_ -df || skip_ "df fails" +# Protect against inaccessible remote mounts etc. +timeout 10 df || skip_ "df fails" cat <<\EOF > check-df || framework_failure_ my ($total, $used, $avail) = (0, 0, 0);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor