Btrfs: fix wrong return value of btrfs_truncate_page()
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 5 Dec 2012 10:56:13 +0000 (10:56 +0000)
committerChris Mason <chris.mason@fusionio.com>
Mon, 17 Dec 2012 01:46:20 +0000 (20:46 -0500)
commitac6a2b36f9fcfbe4865550afb6d333dec6b57578
tree7e6212618664d645a5954ddcd8de58267e0f916c
parent7426cc04d407621773af3a0403e57642e40c36bf
Btrfs: fix wrong return value of btrfs_truncate_page()

ret variant may be set to 0 if we read page successfully, but it might be
released before we lock it again. On this case, if we fail to allocate a
new page, we will return 0, it is wrong, fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/inode.c