Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/union When mounting a union file system set its lower...



details:   https://anonhg.NetBSD.org/src/rev/b845fd60ce97
branches:  trunk
changeset: 373494:b845fd60ce97
user:      hannken <hannken%NetBSD.org@localhost>
date:      Mon Feb 13 08:39:40 2023 +0000

description:
When mounting a union file system set its lower mount only on success.

Reported-by: syzbot+b81b69971581b4f4db00%syzkaller.appspotmail.com@localhost

diffstat:

 sys/fs/union/union_vfsops.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r ea1a0824c16e -r b845fd60ce97 sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c       Sun Feb 12 22:48:02 2023 +0000
+++ b/sys/fs/union/union_vfsops.c       Mon Feb 13 08:39:40 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vfsops.c,v 1.86 2023/02/06 10:33:32 hannken Exp $        */
+/*     $NetBSD: union_vfsops.c,v 1.87 2023/02/13 08:39:40 hannken Exp $        */
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.86 2023/02/06 10:33:32 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.87 2023/02/13 08:39:40 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -255,12 +255,13 @@
 
        mp->mnt_data = um;
        vfs_getnewfsid(mp);
-       error = vfs_set_lowermount(mp, um->um_uppervp->v_mount);
+
+       error = set_statvfs_info(path, UIO_USERSPACE, NULL, UIO_USERSPACE,
+           mp->mnt_op->vfs_name, mp, l);
        if (error)
                goto bad;
 
-       error = set_statvfs_info(path, UIO_USERSPACE, NULL, UIO_USERSPACE,
-           mp->mnt_op->vfs_name, mp, l);
+       error = vfs_set_lowermount(mp, um->um_uppervp->v_mount);
        if (error)
                goto bad;
 



Home | Main Index | Thread Index | Old Index