Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f17b6042 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Al Viro
Browse files

fs: Remove i_nlink check from file system link callback



Now that VFS check for inode->i_nlink == 0 and returns proper
error, remove similar check from file system

Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent aae8a97d
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -4806,9 +4806,6 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
	int err;
	int drop_inode = 0;

	if (inode->i_nlink == 0)
		return -ENOENT;

	/* do not allow sys_link's with other subvols of the same device */
	if (root->objectid != BTRFS_I(inode)->root->objectid)
		return -EPERM;
+0 −7
Original line number Diff line number Diff line
@@ -2253,13 +2253,6 @@ static int ext3_link (struct dentry * old_dentry,

	dquot_initialize(dir);

	/*
	 * Return -ENOENT if we've raced with unlink and i_nlink is 0.  Doing
	 * otherwise has the potential to corrupt the orphan inode list.
	 */
	if (inode->i_nlink == 0)
		return -ENOENT;

retry:
	handle = ext3_journal_start(dir, EXT3_DATA_TRANS_BLOCKS(dir->i_sb) +
					EXT3_INDEX_EXTRA_TRANS_BLOCKS);
+0 −7
Original line number Diff line number Diff line
@@ -2304,13 +2304,6 @@ static int ext4_link(struct dentry *old_dentry,

	dquot_initialize(dir);

	/*
	 * Return -ENOENT if we've raced with unlink and i_nlink is 0.  Doing
	 * otherwise has the potential to corrupt the orphan inode list.
	 */
	if (inode->i_nlink == 0)
		return -ENOENT;

retry:
	handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) +
					EXT4_INDEX_EXTRA_TRANS_BLOCKS);
+0 −3
Original line number Diff line number Diff line
@@ -809,9 +809,6 @@ static int jfs_link(struct dentry *old_dentry,
	if (ip->i_nlink == JFS_LINK_MAX)
		return -EMLINK;

	if (ip->i_nlink == 0)
		return -ENOENT;

	dquot_initialize(dir);

	tid = txBegin(ip->i_sb, 0);
+0 −4
Original line number Diff line number Diff line
@@ -1122,10 +1122,6 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir,
		reiserfs_write_unlock(dir->i_sb);
		return -EMLINK;
	}
	if (inode->i_nlink == 0) {
		reiserfs_write_unlock(dir->i_sb);
		return -ENOENT;
	}

	/* inc before scheduling so reiserfs_unlink knows we are here */
	inc_nlink(inode);
Loading