The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=5304b996818bde364b3ed436cfcc5fa49fdb4677

commit 5304b996818bde364b3ed436cfcc5fa49fdb4677
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-08-26 16:12:58 +0000
Commit:     Konstantin Belousov <[email protected]>
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))
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to