git: 5304b996818b - stable/13 - ffs_update(): recalculate flags after relocking the vnode
Konstantin Belousov
kib at FreeBSD.org
Tue Sep 7 00:39:56 UTC 2021
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=5304b996818bde364b3ed436cfcc5fa49fdb4677
commit 5304b996818bde364b3ed436cfcc5fa49fdb4677
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-08-26 16:12:58 +0000
Commit: Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-09-07 00:39:32 +0000
ffs_update(): recalculate flags after relocking the vnode
(cherry picked from commit f822d4feb87a7bd7747679aa779942d24fff08e0)
---
sys/ufs/ffs/ffs_inode.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c
index 12ab3ca0a5e1..96abdcd8f4b7 100644
--- a/sys/ufs/ffs/ffs_inode.c
+++ b/sys/ufs/ffs/ffs_inode.c
@@ -145,10 +145,10 @@ ffs_update(vp, waitfor)
* snapshot vnode to prevent it from being removed while we are
* waiting for the buffer.
*/
+loop:
flags = 0;
if (IS_SNAPSHOT(ip))
flags = GB_LOCK_NOWAIT;
-loop:
bn = fsbtodb(fs, ino_to_fsba(fs, ip->i_number));
error = ffs_breadz(VFSTOUFS(vp->v_mount), ITODEVVP(ip), bn, bn,
(int) fs->fs_bsize, NULL, NULL, 0, NOCRED, flags, NULL, &bp);
@@ -176,6 +176,11 @@ loop:
vrele(vp);
if (VN_IS_DOOMED(vp))
return (ENOENT);
+
+ /*
+ * Recalculate flags, because the vnode was relocked and
+ * could no longer be a snapshot.
+ */
goto loop;
}
if (DOINGSOFTDEP(vp))
More information about the dev-commits-src-all
mailing list