Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Oct 2006 20:20:27 GMT
From:      Lowell Gilbert <lowell@be-well.ilk.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/86965: [ntfs] NTFS driver returns incorrect 'number of links' for directories
Message-ID:  <200610182020.k9IKKRJT045804@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/86965; it has been noted by GNATS.

From: Lowell Gilbert <lowell@be-well.ilk.org>
To: bug-followup@FreeBSD.org,cryptographite@comcast.net
Cc:  
Subject: Re: kern/86965: [ntfs] NTFS driver returns incorrect 'number of links' for directories
Date: Wed, 18 Oct 2006 16:15:10 -0400

 I prefer (and have successfully used) the following patch (against
 RELENG_6):
 
 --- /usr/src/sys/fs/ntfs/ntfs_vnops.c.ORIG      Wed Oct 18 13:43:06 2006
 +++ /usr/src/sys/fs/ntfs/ntfs_vnops.c   Wed Oct 18 15:11:51 2006
 @@ -187,8 +187,11 @@
         vap->va_fsid = dev2udev(ip->i_dev);
         vap->va_fileid = ip->i_number;
         vap->va_mode = ip->i_mp->ntm_mode;
         vap->va_nlink = ip->i_nlink;
 +        /* fake a link count if we don't know the real one */
 +        if ((vap->va_nlink == 0) && !(ip->i_flag & IN_LOADED))
 +                vap->va_nlink = 1;
         vap->va_uid = ip->i_mp->ntm_uid;
         vap->va_gid = ip->i_mp->ntm_gid;
         vap->va_rdev = 0;                               /* XXX UNODEV ? */
         vap->va_size = fp->f_size;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610182020.k9IKKRJT045804>