mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
fsstress: show the real file id and parid in rmdir() and unlink()
The source file id and parentid are overwritten by del_from_flist() call, so should show the actually values. Signed-off-by: kaixuxia <kaixuxia@tencent.com> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+14
-4
@@ -4499,6 +4499,8 @@ rmdir_f(int opno, long r)
|
||||
int e;
|
||||
pathname_t f;
|
||||
fent_t *fep;
|
||||
int oldid;
|
||||
int oldparid;
|
||||
int v;
|
||||
|
||||
init_pathname(&f);
|
||||
@@ -4510,13 +4512,16 @@ rmdir_f(int opno, long r)
|
||||
}
|
||||
e = rmdir_path(&f) < 0 ? errno : 0;
|
||||
check_cwd();
|
||||
if (e == 0)
|
||||
if (e == 0) {
|
||||
oldid = fep->id;
|
||||
oldparid = fep->parent;
|
||||
del_from_flist(FT_DIR, fep - flist[FT_DIR].fents);
|
||||
}
|
||||
if (v) {
|
||||
printf("%d/%d: rmdir %s %d\n", procid, opno, f.path, e);
|
||||
if (e == 0)
|
||||
printf("%d/%d: rmdir del entry: id=%d,parent=%d\n",
|
||||
procid, opno, fep->id, fep->parent);
|
||||
procid, opno, oldid, oldparid);
|
||||
}
|
||||
free_pathname(&f);
|
||||
}
|
||||
@@ -4746,6 +4751,8 @@ unlink_f(int opno, long r)
|
||||
pathname_t f;
|
||||
fent_t *fep;
|
||||
flist_t *flp;
|
||||
int oldid;
|
||||
int oldparid;
|
||||
int v;
|
||||
|
||||
init_pathname(&f);
|
||||
@@ -4757,13 +4764,16 @@ unlink_f(int opno, long r)
|
||||
}
|
||||
e = unlink_path(&f) < 0 ? errno : 0;
|
||||
check_cwd();
|
||||
if (e == 0)
|
||||
if (e == 0) {
|
||||
oldid = fep->id;
|
||||
oldparid = fep->parent;
|
||||
del_from_flist(flp - flist, fep - flp->fents);
|
||||
}
|
||||
if (v) {
|
||||
printf("%d/%d: unlink %s %d\n", procid, opno, f.path, e);
|
||||
if (e == 0)
|
||||
printf("%d/%d: unlink del entry: id=%d,parent=%d\n",
|
||||
procid, opno, fep->id, fep->parent);
|
||||
procid, opno, oldid, oldparid);
|
||||
}
|
||||
free_pathname(&f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user