From: Darrick J. Wong Date: Wed, 7 May 2025 21:54:07 +0000 (-0700) Subject: fsstress: fix attr_set naming X-Git-Tag: v2025.05.11~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e72c9219f97797cfbfe08cfd616245b0d7e0f7e9;p=xfstests-dev.git fsstress: fix attr_set naming Back in 2020 I converted attr_set to lsetxattr, but neglected to notice that the attr name now has to have the prefix "user." which attr_set used to append for us. Unfortunately nobody runs fsstress in verbose mode so I didn't notice until now, and even then only because fuse2fs stupidly accepts any name, even if that corrupts the filesystem. Found by running generic/642 on fuse2fs. Cc: fstests@vger.kernel.org # v2022.05.01 Fixes: 808f39a416c962 ("fsstress: stop using attr_set") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 14c29921..ed9d5fa1 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -2481,7 +2481,7 @@ attr_remove_f(opnum_t opno, long r) void attr_set_f(opnum_t opno, long r) { - char aname[10]; + char aname[32]; char *aval; int e; pathname_t f; @@ -2493,7 +2493,7 @@ attr_set_f(opnum_t opno, long r) init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); - sprintf(aname, "a%x", nameseq++); + sprintf(aname, "user.a%x", nameseq++); li = (int)(random() % (sizeof(lengths) / sizeof(lengths[0]))); len = (int)(random() % lengths[li]); if (len == 0)