From: kaixuxia Date: Thu, 31 Oct 2019 06:41:46 +0000 (+0800) Subject: fsstress: show the real file id and parid in rename_f() X-Git-Tag: v2022.05.01~970 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=266e3c91d6490b0d8fc33a2576c93f6945f05a21;p=xfstests-dev.git fsstress: show the real file id and parid in rename_f() The source file id and parentid are overwritten by del_from_flist() call, and should show the actually values. Signed-off-by: kaixuxia Reviewed-by: Brian Foster Signed-off-by: Eryu Guan --- diff --git a/ltp/fsstress.c b/ltp/fsstress.c index 51976f56..95285f17 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -4227,6 +4227,7 @@ rename_f(int opno, long r) pathname_t newf; int oldid; int parid; + int oldparid; int v; int v1; @@ -4265,10 +4266,12 @@ rename_f(int opno, long r) if (e == 0) { int xattr_counter = fep->xattr_counter; - if (flp - flist == FT_DIR) { - oldid = fep->id; + oldid = fep->id; + oldparid = fep->parent; + + if (flp - flist == FT_DIR) fix_parent(oldid, id); - } + del_from_flist(flp - flist, fep - flp->fents); add_to_flist(flp - flist, id, parid, xattr_counter); } @@ -4277,7 +4280,7 @@ rename_f(int opno, long r) newf.path, e); if (e == 0) { printf("%d/%d: rename del entry: id=%d,parent=%d\n", - procid, opno, fep->id, fep->parent); + procid, opno, oldid, oldparid); printf("%d/%d: rename add entry: id=%d,parent=%d\n", procid, opno, id, parid); }