]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: allocate extent state and check the result properly
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Wed, 20 Apr 2011 06:44:57 +0000 (06:44 +0000)
committerChris Mason <chris.mason@oracle.com>
Mon, 23 May 2011 17:24:41 +0000 (13:24 -0400)
commit53b7b98f12a68452afa57ca458cfcb9c0f08a61d
treee37bb379b90d9754035021ad042de1970a5106fc
parent00343f4ed1d0947bc3f8799a2a448bb5120f8745
Btrfs: allocate extent state and check the result properly

It doesn't allocate extent_state and check the result properly:
- in set_extent_bit, it doesn't allocate extent_state if the path is not
  allowed wait

- in clear_extent_bit, it doesn't check the result after atomic-ly allocate,
  we trigger BUG_ON() if it's fail

- if allocate fail, we trigger BUG_ON instead of returning -ENOMEM since
  the return value of clear_extent_bit() is ignored by many callers

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent_io.c