]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e4defrag: handle failure to open the file system gracefully
authorTheodore Ts'o <tytso@mit.edu>
Sun, 21 Oct 2018 11:35:53 +0000 (07:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 21 Oct 2018 11:52:29 +0000 (07:52 -0400)
commit1dc6d6e33a3a5d8d822cc8aa9b1b64162ae83a0d
tree15decf642e28580e6979dd888c812dff5937a88c
parent8d24eeb71a7743a22e3d4b029592490000cb939f
e4defrag: handle failure to open the file system gracefully

If e4defrag is run by root, it will try to open the underlying file
system for files that it is trying to defrag so it can get the file
system parameters.  It's currently doing this by searching /etc/mtab.
This isn't the best way to go about doing things, but we'll leave it
for now, at least for a maintenance release.  (The better way to do
things would be to look up the device using the blkid library, but
that's a more involved change.)

Since the file system parameters isn't strictly speaking necessary
(after all we get by without them when not running as root), we'll
allow e4defrag to continue running if we can't find the file system.
This can happen if /etc/mtab is pointing at /proc/mounts, and the
kernel can't properly identify the root file system, it is reported as
"/dev/root".

Addresses-Debian-Bug: #907634

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/e4defrag.c