From cf7e1b5b8fb53aef2a9103a32d6ad5ee0b595fa6 Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Thu, 9 Aug 2012 17:34:09 +0200 Subject: du: handle bind-mounted directory cycles gracefully Before this change, a directory cycle induced by a bind mount would be treated as a fatal error, i.e., probable disk corruption. However, such cycles are relatively common, and can be detected efficiently, so now du emits a descriptive warning and arranges to exit nonzero. * NEWS (Bug fixes): Mention it. * src/du.c: Include "mountlist.h". (di_mnt): New global set. (di_files): Rename global from di_set, now that there are two. (fill_mount_table): New function. (hash_ins): Add DI_SET parameter. (process_file): Look up each dir dev/ino pair in the new set. (main): Allocate, initialize, and free the new set. * tests/du/bind-mount-dir-cycle: Add a test for the fix. * tests/Makefile.am (TESTS): Add it. * THANKS.in: Update. This implements the proposal in http://bugs.gnu.org/11844. Originally reported in http://bugs.debian.org/563254 by Alan Jenkins and more recently as http://bugzilla.redhat.com/836557 Improved by: Jim Meyering --- NEWS | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index f7672d9e3..d8a47ab57 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,13 @@ GNU coreutils NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + du no longer emits a "disk-corrupted"-style diagnostic when it detects + a directory cycle that is due to a bind-mounted directory. Instead, + it detects this precise type of cycle, diagnoses it as such and + eventually exits nonzero. + * Noteworthy changes in release 8.19 (2012-08-20) [stable] -- cgit v1.2.3-54-g00ecf