xfs/018: test log attr replay with zero-length attr value

Kernel commit d72f2084e309 ("xfs: fix ri_total validation in
xlog_recover_attri_commit_pass2") fixed a bug where setting a
zero-length attribute value would cause incorrect ri_total
validation during log recovery.

Add test cases to xfs/018 to cover this scenario across attr
fork formats: extent and remote.

Using echo -n "" | attr -s is unreliable for empty values since
attr may treat stdin EOF as no value provided. Instead, handle
zero-length values explicitly in test_attr_replay() by using
attr -s -V "" when the value is empty.

Signed-off-by: Long Li <leo.lilong@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
2 files changed