浏览代码

nfs: fix oops in nfs_rename()

Recent change is missing to update "rehash".  With that change, it will
become the cause of adding dentry to hash twice.

This explains the reason of Oops (dereference the freed dentry in
__d_lookup()) on my machine.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Reported-by: Marvin <marvin24@gmx.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
OGAWA Hirofumi 15 年之前
父节点
当前提交
56335936de
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/nfs/dir.c

+ 1 - 0
fs/nfs/dir.c

@@ -1615,6 +1615,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
 				goto out;
 				goto out;
 
 
 			new_dentry = dentry;
 			new_dentry = dentry;
+			rehash = NULL;
 			new_inode = NULL;
 			new_inode = NULL;
 		}
 		}
 	}
 	}