]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MD: raid5 avoid unnecessary zero page for trim
authorShaohua Li <shli@kernel.org>
Thu, 27 Sep 2012 02:37:28 +0000 (12:37 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 27 Sep 2012 02:37:28 +0000 (12:37 +1000)
commita116f8e5e1a21d0b28de4084cc57a2e158a41fe1
tree3ec9595e3acaef99ab7315a3f4a5f217bdab4bab
parent48c4ec797322118b1155a8335a102492cb5e3a25
MD: raid5 avoid unnecessary zero page for trim

We want to avoid zero discarded dev page, because it's useless for discard.
But if we don't zero it, another read/write hit such page in the cache and will
get inconsistent data.

To avoid zero the page, we don't set R5_UPTODATE flag after construction is
done. In this way, discard write request is still issued and finished, but read
will not hit the page. If the stripe gets accessed soon, we need reread the
stripe, but since the chance is low, the reread isn't a big deal.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c