From d2f7e772bb9e7615db15a0a8796a66f072d116b5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 11 Mar 2020 10:38:37 +0100 Subject: [PATCH] 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 --- libmount/src/tab.c | 6 +++++- libmount/src/utils.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 || -- 2.47.2