• Shaohua Li's avatar
    MD: raid5 avoid unnecessary zero page for trim · 9e444768
    Shaohua Li authored
    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: default avatarShaohua Li <shli@fusionio.com>
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    9e444768
raid5.c 179 KB