From: Karel Zak Date: Mon, 24 Jun 2013 11:28:06 +0000 (+0200) Subject: findmnt: test for fstype/options/maj:min before source and target X-Git-Tag: v2.24-rc1~485 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4096946f3b4c502345ff40d22139a0c5b7e11d52;p=thirdparty%2Futil-linux.git findmnt: test for fstype/options/maj:min before source and target This change allows to exclude for example NFS mountpoint: findmnt --fstab --target /mnt/foo --type nonfs to stall on a stalled nfs mount. Signed-off-by: Karel Zak --- diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 48c807caf3..b6dbbf5d3c 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -831,14 +831,6 @@ static int match_func(struct libmnt_fs *fs, const char *m; void *md; - m = get_match(COL_TARGET); - if (m && !mnt_fs_match_target(fs, m, cache)) - return rc; - - m = get_match(COL_SOURCE); - if (m && !mnt_fs_match_source(fs, m, cache)) - return rc; - m = get_match(COL_FSTYPE); if (m && !mnt_fs_match_fstype(fs, m)) return rc; @@ -851,6 +843,14 @@ static int match_func(struct libmnt_fs *fs, if (md && mnt_fs_get_devno(fs) != *((dev_t *) md)) return rc; + m = get_match(COL_TARGET); + if (m && !mnt_fs_match_target(fs, m, cache)) + return rc; + + m = get_match(COL_SOURCE); + if (m && !mnt_fs_match_source(fs, m, cache)) + return rc; + if ((flags & FL_DF) && !(flags & FL_ALL)) { const char *type = mnt_fs_get_fstype(fs);