diff options
author | Karel Zak | 2014-02-20 16:59:11 +0100 |
---|---|---|
committer | Karel Zak | 2014-02-20 16:59:11 +0100 |
commit | 6c373810f5b1d32824371e9dff6ee5a006388f98 (patch) | |
tree | 287306034379ceea9232f217e99a506ffef72e9f /misc-utils/findmnt.c | |
parent | fallocate: fix missing sentinel for is_nul() (diff) | |
download | kernel-qcow2-util-linux-6c373810f5b1d32824371e9dff6ee5a006388f98.tar.gz kernel-qcow2-util-linux-6c373810f5b1d32824371e9dff6ee5a006388f98.tar.xz kernel-qcow2-util-linux-6c373810f5b1d32824371e9dff6ee5a006388f98.zip |
libmount: FS id and parent ID could be zero
It seems that linux 3.14 is able to produce things like:
19 0 8:3 / / rw,relatime - ext4 /dev/sda3 rw,data=ordered
^
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/findmnt.c')
-rw-r--r-- | misc-utils/findmnt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index fb21174ef..988cd7397 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -822,8 +822,9 @@ static int tab_is_tree(struct libmnt_table *tb) if (!itr) return 0; - if (mnt_table_next_fs(tb, itr, &fs) == 0) - rc = mnt_fs_get_id(fs) > 0 && mnt_fs_get_parent_id(fs) > 0; + rc = (mnt_table_next_fs(tb, itr, &fs) == 0 && + mnt_fs_is_kernel(fs) && + mnt_fs_get_root(fs)); mnt_free_iter(itr); return rc; |