1
0
Fork 0

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>
wifi-calibration
Al Viro 2011-03-04 17:15:18 +00:00 committed by root
parent 92986796d8
commit c055e99eea
1 changed files with 3 additions and 0 deletions

View File

@ -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;