On Friday 20 April 2007 21:17, Ulrich Drepper wrote:What I described is a supported feature, nothing more and nothing less. It's also relatively easy to handle this case correctly in glibc, e.g., --- a/sysdeps/unix/sysv/linux/internal_statvfs.c +++ b/sysdeps/unix/sysv/linux/internal_statvfs.c @@ -139,6 +139,7 @@ __statvfs_getflags (const char *name, in char *cp = mntbuf.mnt_opts; char *opt; + result = 0; while ((opt = strsep (&cp, ",")) != NULL) if (strcmp (opt, "ro") == 0) result |= ST_RDONLY; @@ -157,9 +158,10 @@ __statvfs_getflags (const char *name, in else if (strcmp (opt, "nodiratime") == 0) result |= ST_NODIRATIME; - /* We can stop looking for more entries. */ success = true; - break; + /* Don't stop looking: the same device may be mounted several + times with different options; in that case, the last entry + is the topmost mount. */ } } /* Maybe the kernel names for the filesystems changed or the There is no way to avoid these problems with chroots; it's not that anybody creates stupid problems on purpose. The approach I'm proposing fixes these problems. It has a small disadvantage for statvfs / fstatvfs in some situations, which is due to the fact that the kernel doesn't offer a direct interface for querying the mount options of a file descriptor or path, and so glibc has to resort to messing with /proc/mounts. I don't see a nice way of fixing this without introducing [f]statvfs syscalls right now. This is what POSIX says about statvfs / fstatvfs: In my opinion, the advantage of not reporting bogus pathnames in /proc/mounts by far outweighs the problems is sometimes causes for fstatvfs(). Anyone relying on the information obtained from statvfs / fstatvfs is making false assumptions anyway, and in "normal setups" as you called them, nothing changes for fstatvfs and statvfs. Andreas -
| Jens Axboe | Re: [BUG] New Kernel Bugs |
| KAMEZAWA Hiroyuki | Re: 2.6.24-rc3-mm1 |
| Ingo Molnar | Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS] |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: Data corruption issue with splice() on 2.6.27.10 |
| Patrick McHardy | Re: [GIT]: Networking |
