summaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorXue jiufei <xuejiufei@huawei.com>2015-01-08 14:32:23 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-08 15:10:51 -0800
commit53dc20b9a3d928b0744dad5aee65b610de1cc85d (patch)
tree0aa4e0a783b43b460141744d0e3f7fd1d9bd3bd0 /fs/fcntl.c
parent75dd112aac25713cd686cb4bfa78cf907519c504 (diff)
downloadlinux-53dc20b9a3d928b0744dad5aee65b610de1cc85d.tar.bz2
ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file
In ocfs2_link(), the parent directory inode passed to function ocfs2_lookup_ino_from_name() is wrong. Parameter dir is the parent of new_dentry not old_dentry. We should get old_dir from old_dentry and lookup old_dentry in old_dir in case another node remove the old dentry. With this change, hard linking works again, when paths are relative with at least one subdirectory. This is how the problem was reproducable: # mkdir a # mkdir b # touch a/test # ln a/test b/test ln: failed to create hard link `b/test' => `a/test': No such file or directory However when creating links in the same dir, it worked well. Now the link gets created. Fixes: 0e048316ff57 ("ocfs2: check existence of old dentry in ocfs2_link()") Signed-off-by: joyce.xue <xuejiufei@huawei.com> Reported-by: Szabo Aron - UBIT <aron@ubit.hu> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Tested-by: Aron Szabo <aron@ubit.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fcntl.c')
0 files changed, 0 insertions, 0 deletions