Whamcloud - gitweb
EX-7601 ldiskfs: fix detection of compressed extent
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 3 Jan 2024 22:23:20 +0000 (17:23 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 13 Jan 2024 02:46:01 +0000 (02:46 +0000)
commitcca275d7fead875dbb6e3e10b1ebf18ab75f4f5b
tree7db63d61b60de16abeacf06f3038ab48a4fd0aed
parentf4842791b76b69cbe665d6127915ce945188d1d2
EX-7601 ldiskfs: fix detection of compressed extent

The code in ldiskfs_map_inode_pages which detects a
compressed extent checks the first lnb for that extent, but
it's possible for some lnbs and not others to be compressed
in a given extent, so we must check all of them.  This
occurs when multiple writes have been combined in to one
RPC.

If we don't detect compression correctly, we won't set the
file size correctly and we'll get data corruption.

Fixes: b489a2a397 ("EX-7600 osc: save compressed object size")
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I11d50bdc45c40d93bb1b829fcd930165b7626432
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53588
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_io.c
lustre/tests/test-framework.sh