Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/ntfs ntfs_loadntnode(): Use bread() when ntm_sysvn[NT...



details:   https://anonhg.NetBSD.org/src/rev/d4ae3c32d769
branches:  trunk
changeset: 983276:d4ae3c32d769
user:      hannken <hannken%NetBSD.org@localhost>
date:      Thu May 13 08:57:29 2021 +0000

description:
ntfs_loadntnode(): Use bread() when ntm_sysvn[NTFS_MFTINO] is NULL.

May happen when loading node 0 (MFT) during mount and some
attributes are stored in another ntnode.

PR kern/56160 (Mount ntfs usb disk)

diffstat:

 sys/fs/ntfs/ntfs_subr.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 91c0adf0383e -r d4ae3c32d769 sys/fs/ntfs/ntfs_subr.c
--- a/sys/fs/ntfs/ntfs_subr.c   Thu May 13 08:47:21 2021 +0000
+++ b/sys/fs/ntfs/ntfs_subr.c   Thu May 13 08:57:29 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ntfs_subr.c,v 1.63 2020/01/17 20:08:08 ad Exp $        */
+/*     $NetBSD: ntfs_subr.c,v 1.64 2021/05/13 08:57:29 hannken Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 Semen Ustimenko (semenu%FreeBSD.org@localhost)
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.63 2020/01/17 20:08:08 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.64 2021/05/13 08:57:29 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -267,7 +267,8 @@
 
        mfrp = malloc(ntfs_bntob(ntmp->ntm_bpmftrec), M_TEMP, M_WAITOK);
 
-       if (ip->i_number < NTFS_SYSNODESNUM) {
+       if (ip->i_number < NTFS_SYSNODESNUM ||
+           ntmp->ntm_sysvn[NTFS_MFTINO] == NULL) {
                struct buf *bp;
                daddr_t bn;
                off_t boff;



Home | Main Index | Thread Index | Old Index