commit | c055e99eea6e4f614267632fac546e7896c0227b | [log] [tgz] |
---|---|---|
author | Al Viro <viro@ZenIV.linux.org.uk> | Fri Mar 04 17:15:18 2011 +0000 |
committer | root <Chris Mason chris.mason@oracle.com> | Mon Mar 28 05:37:56 2011 -0400 |
tree | df65ff7c1a3b0c4301edffbadd9f23f9023e5159 | |
parent | 92986796d84ef939e304099dece32572a755b280 [diff] |
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>
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4822b31..04babaf 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c
@@ -4837,6 +4837,9 @@ 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;