Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Clear per-lwp entries whose mount is gone before th...



details:   https://anonhg.NetBSD.org/src/rev/c7e75829a297
branches:  trunk
changeset: 839528:c7e75829a297
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sun Feb 24 16:11:24 2019 +0000

description:
Clear per-lwp entries whose mount is gone before the first return
from fstrans_done().

No longer leaks "struct mount" forever.

diffstat:

 sys/kern/vfs_trans.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r 1fbc0c884be6 -r c7e75829a297 sys/kern/vfs_trans.c
--- a/sys/kern/vfs_trans.c      Sun Feb 24 12:34:00 2019 +0000
+++ b/sys/kern/vfs_trans.c      Sun Feb 24 16:11:24 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_trans.c,v 1.55 2019/02/21 08:52:53 hannken Exp $   */
+/*     $NetBSD: vfs_trans.c,v 1.56 2019/02/24 16:11:24 hannken Exp $   */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.55 2019/02/21 08:52:53 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.56 2019/02/24 16:11:24 hannken Exp $");
 
 /*
  * File system transaction operations.
@@ -543,6 +543,9 @@
                return;
        }
 
+       if (__predict_false(fstrans_gone_count > 0))
+               fstrans_clear_lwp_info();
+
        s = pserialize_read_enter();
        if (__predict_true(fmi->fmi_state == FSTRANS_NORMAL)) {
                fli->fli_trans_cnt = 0;
@@ -552,9 +555,6 @@
        }
        pserialize_read_exit(s);
 
-       if (__predict_false(fstrans_gone_count > 0))
-               fstrans_clear_lwp_info();
-
        mutex_enter(&fstrans_lock);
        fli->fli_trans_cnt = 0;
        cv_signal(&fstrans_count_cv);



Home | Main Index | Thread Index | Old Index