From: Yan, Zheng Date: Thu, 24 Sep 2009 13:17:31 +0000 (-0400) Subject: Btrfs: check size of inode backref before adding hardlink X-Git-Tag: v2.6.32-rc1~57^2^2~3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a57195214358b75807a74bad96a8601a36262af7;p=pandora-kernel.git Btrfs: check size of inode backref before adding hardlink For every hardlink in btrfs, there is a corresponding inode back reference. All inode back references for hardlinks in a given directory are stored in single b-tree item. The size of b-tree item is limited by the size of b-tree leaf, so we can only create limited number of hardlinks to a given file in a directory. The original code lacks of the check, it oops if the number of hardlinks goes over the limit. This patch fixes the issue by adding check to btrfs_link and btrfs_rename. Signed-off-by: Yan Zheng Signed-off-by: Chris Mason --- Reading git-diff-tree failed