Date: Wed, 24 Feb 2021 07:57:02 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: 6f30ac9995ff - main - Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing Message-ID: <202102240757.11O7v20J045816@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=6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba commit 6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-02-21 10:11:54 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-02-24 07:55:21 +0000 Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing softdep_prealloc() must be called to ensure enough journal space is available, before ffs_extwrite(). Also it must be done before taking ffs_lock_ea(), because it calls ffs_syncvnode(), potentially dropping the vnode lock. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/ufs/ffs/ffs_vnops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 9be46951c04e..050a6f66be17 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1552,6 +1552,12 @@ struct vop_closeextattr_args { if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); + if (ap->a_commit && DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_closeextattr commit"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } @@ -1600,6 +1606,13 @@ vop_deleteextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1801,6 +1814,13 @@ vop_setextattr { return (error); } + if (DOINGSUJ(vp)) { + ASSERT_VOP_ELOCKED(vp, "ffs_deleteextattr"); + softdep_prealloc(vp, MNT_WAIT); + if (vp->v_data == NULL) + return (EBADF); + } + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102240757.11O7v20J045816>