Date: Tue, 7 Sep 2021 00:39:57 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: 93c52669d510 - stable/13 - ffs_update(): Do not assume that EBUSY can only come LK_NOWAIT trylock Message-ID: <202109070039.1870dvd0062195@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=93c52669d510fe38a185c71eab7fdae990ece823 commit 93c52669d510fe38a185c71eab7fdae990ece823 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-08-26 16:17:39 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-09-07 00:39:32 +0000 ffs_update(): Do not assume that EBUSY can only come LK_NOWAIT trylock (cherry picked from commit bb536de6c0d73566e610881e12c55489a7c6ec44) --- sys/ufs/ffs/ffs_inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 96abdcd8f4b7..6bb7521cef4c 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -153,9 +153,14 @@ loop: error = ffs_breadz(VFSTOUFS(vp->v_mount), ITODEVVP(ip), bn, bn, (int) fs->fs_bsize, NULL, NULL, 0, NOCRED, flags, NULL, &bp); if (error != 0) { - if (error != EBUSY) + /* + * If EBUSY was returned without GB_LOCK_NOWAIT (which + * requests trylock for buffer lock), it is for some + * other reason and we should not handle it specially. + */ + if (error != EBUSY || (flags & GB_LOCK_NOWAIT) == 0) return (error); - KASSERT((IS_SNAPSHOT(ip)), ("EBUSY from non-snapshot")); + /* * Wait for our inode block to become available. *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109070039.1870dvd0062195>