When discard was enabled, immediate deallocations were made deferred in order to record these extents in the atom's delete set and, consequently, allow their discarding. However, this is wrong in the following way. Immediate deallocations make use of target allocation stage and ancillary flags like BA_PERMANENT and BA_FORMATTED. By converting immediate deallocations to deferred, these flags are essentially dropped, and application of deferred deallocations in reiser4_post_write_back_hook() uses an equivalent of BLOCK_NOT_COUNTED stage and BA_FORMATTED flag. Dropping this hack does not hinder efficiency of the discard procedure, because immediate deallocations are now used only to deallocate "just allocated" and not yet written blocks, which actually do not need to be discarded. Signed-off-by: Ivan Shapovalov <intelfx100@xxxxxxxxx> --- fs/reiser4/block_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/reiser4/block_alloc.c b/fs/reiser4/block_alloc.c index 6e7030a..fee1c18 100644 --- a/fs/reiser4/block_alloc.c +++ b/fs/reiser4/block_alloc.c @@ -1008,8 +1008,7 @@ reiser4_dealloc_blocks(const reiser4_block_nr * start, spin_unlock_reiser4_super(sbinfo); } - if ((flags & BA_DEFER) || - reiser4_is_set(reiser4_get_current_sb(), REISER4_DISCARD)) { + if (flags & BA_DEFER) { /* * These blocks will be later deallocated by apply_dset(). * It is equivalent to a non-deferred deallocation with target -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html