The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=047905dc42996fa353e149ea5afddefe877ac701

commit 047905dc42996fa353e149ea5afddefe877ac701
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-05-30 16:52:42 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-06-06 19:27:32 +0000

    vinvalbuf: do not panic if we were unable to flush dirty buffers
    
    PR:     238565
    
    (cherry picked from commit 27006229f7a40a18a61a0e8fd270bc583326b690)
---
 sys/kern/vfs_subr.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 5de58f979e97..3e6d11624197 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1998,13 +1998,11 @@ bufobj_invalbuf(struct bufobj *bo, int flags, int 
slpflag, int slptimeo)
                        } while (error == ERELOOKUP);
                        if (error != 0)
                                return (error);
-                       /*
-                        * XXX We could save a lock/unlock if this was only
-                        * enabled under INVARIANTS
-                        */
                        BO_LOCK(bo);
-                       if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)
-                               panic("vinvalbuf: dirty bufs");
+                       if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) {
+                               BO_UNLOCK(bo);
+                               return (EBUSY);
+                       }
                }
        }
        /*
_______________________________________________
[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