btrfs: check link counter overflow in link(2)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
92986796d8
commit
c055e99eea
1 changed files with 3 additions and 0 deletions
|
@ -4837,6 +4837,9 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
|
|||
if (root->objectid != BTRFS_I(inode)->root->objectid)
|
||||
return -EXDEV;
|
||||
|
||||
if (inode->i_nlink == ~0U)
|
||||
return -EMLINK;
|
||||
|
||||
btrfs_inc_nlink(inode);
|
||||
inode->i_ctime = CURRENT_TIME;
|
||||
|
||||
|
|
Loading…
Reference in a new issue