]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: make the extent_status code more robust against ENOMEM failures
authorTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jul 2013 04:12:14 +0000 (00:12 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 15 Jul 2013 04:12:14 +0000 (00:12 -0400)
commitdecae3aab04735f660c60d07a28d16658477123d
tree9b8cdd8b38b4041889dc721e147d96fa2312fae6
parent839ffb2667d0ccb593efd74b42219fcc1d2b18f6
ext4: make the extent_status code more robust against ENOMEM failures

Some callers of ext4_es_remove_extent() and ext4_es_insert_extent()
may not be completely robust against ENOMEM failures (or the
consequences of reflecting ENOMEM back up to userspace may lead to
xfstest or user application failure).

To mitigate against this, when trying to insert an entry in the extent
status tree, try to shrink the inode's extent status tree before
returning ENOMEM.  If there are entries which don't record information
about extents under delayed allocations, freeing one of them is
preferable to returning ENOMEM.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Zheng Liu <wenqing.lz@taobao.com>
fs/ext4/extents_status.c