bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#563254: du: bind mount causes corrupted filesystem warning (desp


From: Alan Jenkins
Subject: Re: Bug#563254: du: bind mount causes corrupted filesystem warning (despite -x !)
Date: Fri, 01 Jan 2010 21:03:16 +0000
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Jim Meyering wrote:
Alan Jenkins wrote:
Package: coreutils
Version: 8.1-1
Severity: normal


To reproduce:

$ mkdir -p /mnt/root
$ mount --bind / /mnt/root

(I have this in /etc/fstab...
 it lets me access parts of / which are hidden by other mounted filesystems -
 this happens to be useful for reasons too long and obscure to be worth 
explaining)

$ du -x
du: WARNING: Circular directory structure.
This almost certainly means that you have a corrupted file system.
NOTIFY YOUR SYSTEM MANAGER.
The following directory is part of the cycle:
  `./mnt/root'
....

Thanks for the report.
I confirm that this still happens with the latest.

For now, I suggest you use e.g.,

    du --exclude=/mnt -x /

Unless such bind mounts appear to be common,
I may just leave the current semantics as they are.

By the way, would you want du to traverse each
root partition directory twice?

No. I was thinking that -x would treat bind mounts like other mounts, and not traverse them.

I guess the problem is that -x is taken to mean "stay on this _filesystem_ only", as opposed to "stay on this _mount_ only".

And "stay on this filesystem" is probably easier to implement; you just check st_dev. "Stay on this mount" requires checking /etc/mtab or /proc/mounts.

It doesn't seem too hard to add an extra check before printing the warning. But I agree this is probably obscure, so I don't blame you for not being very bothered about it :-).

Thanks
Alan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]