>From fd33ede1ca0b157ecf26711bdf12c2b15336e0cd Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 16 May 2008 13:24:59 +0400 Subject: [PATCH] Fixed inode lookup code (DFS related part) to support new build_path_from_dentry behaviour. Signed-off-by: Igor Mammedov --- fs/cifs/inode.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 9d9b56a..c7c5242 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -184,6 +184,9 @@ try_again_CIFSSMBUnixQPathInfo: if (rc) { if (rc == -EREMOTE && !is_dfs_referral) { is_dfs_referral = true; + full_path = strchr(full_path + 2, '/'); + full_path++; + full_path = strchr(full_path + 2, '/'); goto try_again_CIFSSMBUnixQPathInfo; } goto cgiiu_exit; @@ -230,6 +233,11 @@ try_again_CIFSSMBUnixQPathInfo: (unsigned long) inode->i_size, (unsigned long long)inode->i_blocks)); + if (is_dfs_referral && ((inode->i_mode & S_IFMT) == S_IFLNK)) { + inode->i_mode &= ~S_IFLNK; + inode->i_mode |= S_IFDIR; + } + cifs_set_ops(inode, is_dfs_referral); } cgiiu_exit: @@ -389,6 +397,9 @@ try_again_CIFSSMBQPathInfo: if (rc) { if (rc == -EREMOTE && !is_dfs_referral) { is_dfs_referral = true; + full_path = strchr(full_path + 2, '\\'); + full_path++; + full_path = strchr(full_path + 2, '\\'); goto try_again_CIFSSMBQPathInfo; } goto cgii_exit; -- 1.5.3.7