Pull up following revision(s) (requested by hannken in ticket #1272):

sys/fs/ntfs/ntfs_subr.c: revision 1.64

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)
This commit is contained in:
martin 2021-05-17 15:48:57 +00:00
parent 42352fce30
commit a718c32c6a
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntfs_subr.c,v 1.61.22.1 2019/10/21 20:15:02 martin Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.61.22.2 2021/05/17 15:48:57 martin Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko (semenu@FreeBSD.org)
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.61.22.1 2019/10/21 20:15:02 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.61.22.2 2021/05/17 15:48:57 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -267,7 +267,8 @@ ntfs_loadntnode(struct ntfsmount *ntmp, struct ntnode *ip)
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;