summaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2018-11-16 10:13:25 -0500
committerSteve French <stfrench@microsoft.com>2018-12-24 00:05:11 -0500
commit5fc7fcd054adcf0f264446cbf778d33e30a45455 (patch)
tree31d5dd3cf962192e88a4113fb82c64d26c6d07ec /fs/cifs/inode.c
parentd9345e0ae7cff25e9aed39d21f092dbb482dffec (diff)
cifs: auto disable 'serverino' in dfs mounts
Different servers have different set of file ids. After failover, unique IDs will be different so we can't validate them. Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-by: Paulo Alcantara <palcantara@suse.de> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 1fe9f3b01703..13fb59aadebc 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -730,7 +730,6 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
730 FILE_ALL_INFO *data, struct super_block *sb, int xid, 730 FILE_ALL_INFO *data, struct super_block *sb, int xid,
731 const struct cifs_fid *fid) 731 const struct cifs_fid *fid)
732{ 732{
733 bool validinum = false;
734 __u16 srchflgs; 733 __u16 srchflgs;
735 int rc = 0, tmprc = ENOSYS; 734 int rc = 0, tmprc = ENOSYS;
736 struct cifs_tcon *tcon; 735 struct cifs_tcon *tcon;
@@ -821,7 +820,6 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
821 (FILE_DIRECTORY_INFO *)data, cifs_sb); 820 (FILE_DIRECTORY_INFO *)data, cifs_sb);
822 fattr.cf_uniqueid = le64_to_cpu( 821 fattr.cf_uniqueid = le64_to_cpu(
823 ((SEARCH_ID_FULL_DIR_INFO *)data)->UniqueId); 822 ((SEARCH_ID_FULL_DIR_INFO *)data)->UniqueId);
824 validinum = true;
825 823
826 cifs_buf_release(srchinf->ntwrk_buf_start); 824 cifs_buf_release(srchinf->ntwrk_buf_start);
827 } 825 }
@@ -840,31 +838,29 @@ cifs_get_inode_info(struct inode **inode, const char *full_path,
840 */ 838 */
841 if (*inode == NULL) { 839 if (*inode == NULL) {
842 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 840 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
843 if (validinum == false) { 841 if (server->ops->get_srv_inum)
844 if (server->ops->get_srv_inum) 842 tmprc = server->ops->get_srv_inum(xid,
845 tmprc = server->ops->get_srv_inum(xid, 843 tcon, cifs_sb, full_path,
846 tcon, cifs_sb, full_path, 844 &fattr.cf_uniqueid, data);
847 &fattr.cf_uniqueid, data); 845 if (tmprc) {
848 if (tmprc) { 846 cifs_dbg(FYI, "GetSrvInodeNum rc %d\n",
849 cifs_dbg(FYI, "GetSrvInodeNum rc %d\n", 847 tmprc);
850 tmprc); 848 fattr.cf_uniqueid = iunique(sb, ROOT_I);
851 fattr.cf_uniqueid = iunique(sb, ROOT_I); 849 cifs_autodisable_serverino(cifs_sb);
852 cifs_autodisable_serverino(cifs_sb); 850 } else if ((fattr.cf_uniqueid == 0) &&
853 } else if ((fattr.cf_uniqueid == 0) && 851 strlen(full_path) == 0) {
854 strlen(full_path) == 0) { 852 /* some servers ret bad root ino ie 0 */
855 /* some servers ret bad root ino ie 0 */ 853 cifs_dbg(FYI, "Invalid (0) inodenum\n");
856 cifs_dbg(FYI, "Invalid (0) inodenum\n"); 854 fattr.cf_flags |=
857 fattr.cf_flags |= 855 CIFS_FATTR_FAKE_ROOT_INO;
858 CIFS_FATTR_FAKE_ROOT_INO; 856 fattr.cf_uniqueid =
859 fattr.cf_uniqueid = 857 simple_hashstr(tcon->treeName);
860 simple_hashstr(tcon->treeName);
861 }
862 } 858 }
863 } else 859 } else
864 fattr.cf_uniqueid = iunique(sb, ROOT_I); 860 fattr.cf_uniqueid = iunique(sb, ROOT_I);
865 } else { 861 } else {
866 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) && 862 if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
867 validinum == false && server->ops->get_srv_inum) { 863 && server->ops->get_srv_inum) {
868 /* 864 /*
869 * Pass a NULL tcon to ensure we don't make a round 865 * Pass a NULL tcon to ensure we don't make a round
870 * trip to the server. This only works for SMB2+. 866 * trip to the server. This only works for SMB2+.