Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 May 2022 21:10:12 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4ac2df8f4cd9 - main - ffs_use_bwrite: make the superblock snapshot more consistent
Message-ID:  <202205092110.249LACVa028278@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=4ac2df8f4cd91017c000543224204f823008f699

commit 4ac2df8f4cd91017c000543224204f823008f699
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-05-08 14:00:37 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2022-05-09 20:45:27 +0000

    ffs_use_bwrite: make the superblock snapshot more consistent
    
    Copy in-memory struct fs to the superblock buffer under the UFS mutex.
    
    Reviewed by:    chs, markj
    PR:     263765
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D35149
---
 sys/ufs/ffs/ffs_vfsops.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index e9cbc962cd78..07ae69b1b798 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -2247,7 +2247,9 @@ ffs_use_bwrite(void *devfd, off_t loc, void *buf, int size)
 	}
 	if (MOUNTEDSOFTDEP(ump->um_mountp))
 		softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp);
+	UFS_LOCK(ump);
 	bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize);
+	UFS_UNLOCK(ump);
 	fs = (struct fs *)bp->b_data;
 	ffs_oldfscompat_write(fs, ump);
 	fs->fs_si = NULL;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202205092110.249LACVa028278>