Date: Sat, 14 Aug 2021 10:22:19 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 88156d89fbc5 - stable/13 - simplify journal_mount: move the out label after success block Message-ID: <202108141022.17EAMJDp029609@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=88156d89fbc5f0fd43aeb58eafbf16aec833c77d commit 88156d89fbc5f0fd43aeb58eafbf16aec833c77d Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-03-04 18:55:33 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-08-14 10:21:58 +0000 simplify journal_mount: move the out label after success block (cherry picked from commit 25aac48d2ce322355e7890a1de0f045a15d1cc09) --- sys/ufs/ffs/ffs_softdep.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index c53ba7c70d2f..e03f88029340 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -3013,26 +3013,26 @@ journal_mount(mp, fs, cred) jblocks->jb_low = jblocks->jb_free / 3; /* Reserve 33%. */ jblocks->jb_min = jblocks->jb_free / 10; /* Suspend at 10%. */ ump->softdep_jblocks = jblocks; -out: - if (error == 0) { - MNT_ILOCK(mp); - mp->mnt_flag |= MNT_SUJ; - mp->mnt_flag &= ~MNT_SOFTDEP; - MNT_IUNLOCK(mp); - /* - * Only validate the journal contents if the - * filesystem is clean, otherwise we write the logs - * but they'll never be used. If the filesystem was - * still dirty when we mounted it the journal is - * invalid and a new journal can only be valid if it - * starts from a clean mount. - */ - if (fs->fs_clean) { - DIP_SET(ip, i_modrev, fs->fs_mtime); - ip->i_flags |= IN_MODIFIED; - ffs_update(vp, 1); - } + + MNT_ILOCK(mp); + mp->mnt_flag |= MNT_SUJ; + mp->mnt_flag &= ~MNT_SOFTDEP; + MNT_IUNLOCK(mp); + + /* + * Only validate the journal contents if the + * filesystem is clean, otherwise we write the logs + * but they'll never be used. If the filesystem was + * still dirty when we mounted it the journal is + * invalid and a new journal can only be valid if it + * starts from a clean mount. + */ + if (fs->fs_clean) { + DIP_SET(ip, i_modrev, fs->fs_mtime); + ip->i_flags |= IN_MODIFIED; + ffs_update(vp, 1); } +out: vput(vp); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108141022.17EAMJDp029609>