]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: cleanup the read failure record after write or when the inode is freeing
authorMiao Xie <miaox@cn.fujitsu.com>
Fri, 12 Sep 2014 10:44:04 +0000 (18:44 +0800)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:39:02 +0000 (13:39 -0700)
commit85992f2d68a64fcddd3692a98b014077537f1f65
treed74da9c3d7c60a4ceb29c70be9a5d114eb7c8cc2
parent8d5ac818581aca85ff362d300a7da1a4a9c829c3
Btrfs: cleanup the read failure record after write or when the inode is freeing

After the data is written successfully, we should cleanup the read failure record
in that range because
- If we set data COW for the file, the range that the failure record pointed to is
  mapped to a new place, so it is invalid.
- If we set no data COW for the file, and if there is no error during writting,
  the corrupted data is corrected, so the failure record can be removed. And if
  some errors happen on the mirrors, we also needn't worry about it because the
  failure record will be recreated if we read the same place again.

Sometimes, we may fail to correct the data, so the failure records will be left
in the tree, we need free them when we free the inode or the memory leak happens.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/inode.c