aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/link.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r--fs/cifs/link.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index bde0fabfece0..214aa816f669 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -49,8 +49,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
49 BB note DFS case in future though (when we may have to check) */ 49 BB note DFS case in future though (when we may have to check) */
50 50
51 down(&inode->i_sb->s_vfs_rename_sem); 51 down(&inode->i_sb->s_vfs_rename_sem);
52 fromName = build_path_from_dentry(old_file); 52 fromName = build_path_from_dentry(old_file, cifs_sb_target);
53 toName = build_path_from_dentry(direntry); 53 toName = build_path_from_dentry(direntry, cifs_sb_target);
54 up(&inode->i_sb->s_vfs_rename_sem); 54 up(&inode->i_sb->s_vfs_rename_sem);
55 if((fromName == NULL) || (toName == NULL)) { 55 if((fromName == NULL) || (toName == NULL)) {
56 rc = -ENOMEM; 56 rc = -ENOMEM;
@@ -105,16 +105,17 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
105 105
106 xid = GetXid(); 106 xid = GetXid();
107 107
108 cifs_sb = CIFS_SB(inode->i_sb);
109 pTcon = cifs_sb->tcon;
110
108 down(&direntry->d_sb->s_vfs_rename_sem); 111 down(&direntry->d_sb->s_vfs_rename_sem);
109 full_path = build_path_from_dentry(direntry); 112 full_path = build_path_from_dentry(direntry, cifs_sb);
110 up(&direntry->d_sb->s_vfs_rename_sem); 113 up(&direntry->d_sb->s_vfs_rename_sem);
111 114
112 if (!full_path) 115 if (!full_path)
113 goto out_no_free; 116 goto out_no_free;
114 117
115 cFYI(1, ("Full path: %s inode = 0x%p", full_path, inode)); 118 cFYI(1, ("Full path: %s inode = 0x%p", full_path, inode));
116 cifs_sb = CIFS_SB(inode->i_sb);
117 pTcon = cifs_sb->tcon;
118 target_path = kmalloc(PATH_MAX, GFP_KERNEL); 119 target_path = kmalloc(PATH_MAX, GFP_KERNEL);
119 if (!target_path) { 120 if (!target_path) {
120 target_path = ERR_PTR(-ENOMEM); 121 target_path = ERR_PTR(-ENOMEM);
@@ -167,7 +168,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
167 pTcon = cifs_sb->tcon; 168 pTcon = cifs_sb->tcon;
168 169
169 down(&inode->i_sb->s_vfs_rename_sem); 170 down(&inode->i_sb->s_vfs_rename_sem);
170 full_path = build_path_from_dentry(direntry); 171 full_path = build_path_from_dentry(direntry, cifs_sb);
171 up(&inode->i_sb->s_vfs_rename_sem); 172 up(&inode->i_sb->s_vfs_rename_sem);
172 173
173 if(full_path == NULL) { 174 if(full_path == NULL) {
@@ -233,7 +234,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
233/* BB would it be safe against deadlock to grab this sem 234/* BB would it be safe against deadlock to grab this sem
234 even though rename itself grabs the sem and calls lookup? */ 235 even though rename itself grabs the sem and calls lookup? */
235/* down(&inode->i_sb->s_vfs_rename_sem);*/ 236/* down(&inode->i_sb->s_vfs_rename_sem);*/
236 full_path = build_path_from_dentry(direntry); 237 full_path = build_path_from_dentry(direntry, cifs_sb);
237/* up(&inode->i_sb->s_vfs_rename_sem);*/ 238/* up(&inode->i_sb->s_vfs_rename_sem);*/
238 239
239 if(full_path == NULL) { 240 if(full_path == NULL) {