ufs_rename(): do not treat ERELOOKUP specially

Delegate handling of it to the top VFS layer, as it is done everywhere.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2022-07-02 16:15:57 +03:00
parent 231092bb6f
commit ab5ef5fb63

View File

@ -1412,18 +1412,8 @@ relock:
(tvp != NULL && (seqc_in_modify(tvp_s) ||
!vn_seqc_consistent(tvp, tvp_s))))) {
error = softdep_prerename(fdvp, fvp, tdvp, tvp);
if (error != 0) {
if (error == ERELOOKUP) {
fdvp_s = vn_seqc_read_any(fdvp);
fvp_s = vn_seqc_read_any(fvp);
tdvp_s = vn_seqc_read_any(tdvp);
if (tvp != NULL)
tvp_s = vn_seqc_read_any(tvp);
atomic_add_int(&rename_restarts, 1);
goto relock;
}
if (error != 0)
goto releout;
}
}
fdp = VTOI(fdvp);
@ -1467,11 +1457,6 @@ relock:
vref(tvp);
VOP_VPUT_PAIR(tdvp, &tvp, true);
error = ufs_sync_nlink1(mp);
if (error == ERELOOKUP) {
error = 0;
atomic_add_int(&rename_restarts, 1);
goto relock;
}
vrele(fdvp);
vrele(fvp);
vrele(tdvp);
@ -1620,11 +1605,6 @@ relock:
vref(tvp);
VOP_VPUT_PAIR(tdvp, &tvp, true);
error = ufs_sync_nlink1(mp);
if (error == ERELOOKUP) {
error = 0;
atomic_add_int(&rename_restarts, 1);
goto relock;
}
vrele(fdvp);
vrele(fvp);
vrele(tdvp);