From: Karel Zak Date: Wed, 11 Mar 2020 09:38:37 +0000 (+0100) Subject: libmount: improve smb{2,3} support X-Git-Tag: v2.36-rc1~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b7ff4134beea53688ab3c01484cf59b2ce2d9ce9;p=thirdparty%2Futil-linux.git libmount: improve smb{2,3} support It seems kernel can use smb3 as fstype in mountinfo. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1812118 Signed-off-by: Karel Zak --- diff --git a/libmount/src/tab.c b/libmount/src/tab.c index 2218285b4c..aeeefcde68 100644 --- a/libmount/src/tab.c +++ b/libmount/src/tab.c @@ -1763,9 +1763,13 @@ int __mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_f if (root) { const char *fstype = mnt_fs_get_fstype(fs); - if (fstype && strcmp(fstype, "cifs") == 0) { + if (fstype && (strcmp(fstype, "cifs") == 0 + || strcmp(fstype, "smb2") == 0 + || strcmp(fstype, "smb3") == 0)) { + const char *unc_subdir = get_cifs_unc_subdir_path(src); const char *path_on_fs = mnt_fs_get_root(fs); + if (!unc_subdir || !path_on_fs || !streq_paths(unc_subdir, path_on_fs)) continue; } else { diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 708da2e008..90c84f4009 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -332,6 +332,8 @@ int mnt_fstype_is_pseudofs(const char *type) int mnt_fstype_is_netfs(const char *type) { if (strcmp(type, "cifs") == 0 || + strcmp(type, "smb2") == 0 || + strcmp(type, "smb3") == 0 || strcmp(type, "smbfs") == 0 || strncmp(type,"nfs", 3) == 0 || strcmp(type, "afs") == 0 ||