Explorar o código

[CIFS] Fix unlink oops when indirectly called in rename error path
under heavy stress.

Signed-off-by: Steve French <sfrench@us.ibm.com>

Steve French %!s(int64=19) %!d(string=hai) anos
pai
achega
6910ab30a2
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      fs/cifs/inode.c

+ 4 - 1
fs/cifs/inode.c

@@ -569,7 +569,10 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
 
 	xid = GetXid();
 
-	cifs_sb = CIFS_SB(inode->i_sb);
+	if(inode)
+		cifs_sb = CIFS_SB(inode->i_sb);
+	else
+		cifs_sb = CIFS_SB(dentry->d_sb);
 	pTcon = cifs_sb->tcon;
 
 	/* Unlink can be called from rename so we can not grab the sem here