]> git.baikalelectronics.ru Git - kernel.git/commit
fs: Don't allow to create hardlink for deleted file
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sat, 29 Jan 2011 13:13:27 +0000 (18:43 +0530)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 15 Mar 2011 06:21:44 +0000 (02:21 -0400)
commita96d49364e3bcce1900781edf4e60e2af0e89975
tree12dbe7afc10da3eee7ce5dfcf389b655634737e0
parent15928ab95d045000e1e5dff3060f8b6dc89dca36
fs: Don't allow to create hardlink for deleted file

Add inode->i_nlink == 0 check in VFS. Some of the file systems
do this internally. A followup patch will remove those instance.
This is needed to ensure that with link by handle we don't allow
to create hardlink of an unlinked file. The check also prevent a race
between unlink and link

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c