From nobody@FreeBSD.org  Thu Oct  6 01:53:35 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id C5FBA16A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Oct 2005 01:53:35 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 98DAF43D46
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  6 Oct 2005 01:53:35 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j961rZLl059289
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 6 Oct 2005 01:53:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j961rZON059288;
	Thu, 6 Oct 2005 01:53:35 GMT
	(envelope-from nobody)
Message-Id: <200510060153.j961rZON059288@www.freebsd.org>
Date: Thu, 6 Oct 2005 01:53:35 GMT
From: Jay Rossiter <cryptographite@comcast.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: NTFS driver returns incorrect 'number of links' for directories
X-Send-Pr-Version: www-2.3

>Number:         86965
>Category:       kern
>Synopsis:       [ntfs] NTFS driver returns incorrect 'number of links' for directories
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 06 02:00:29 GMT 2005
>Closed-Date:    Sat Feb 09 13:13:05 UTC 2008
>Last-Modified:  Sat Feb 09 13:13:05 UTC 2008
>Originator:     Jay Rossiter
>Release:        6.0-BETA5
>Organization:
>Environment:
FreeBSD zen.cothlamadh.net 6.0-BETA5 FreeBSD 6.0-BETA5 #9: Wed Oct  5 14:39:15 PDT 2005     root@zen.cothlamadh.net:/usr/obj/usr/src/sys/ZEN  i386 
>Description:
Original problem, which appeared to be the fault of Samba, can be found here: 
https://bugzilla.samba.org/show_bug.cgi?id=2794

The NTFS driver is returning an incorrect link count when giving information about directory structures on disk.  
>How-To-Repeat:
Mount an NTFS drive
Install Samba 3.0
Share NTFS drive
Connect from another system via samba and attempt to navigate directory structure.
>Fix:
Comment https://bugzilla.samba.org/show_bug.cgi?id=2794#c1 in the above defect link lists a possible fix to the NTFS driver
>Release-Note:
>Audit-Trail:

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;

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/86965: commit references a PR
Date: Sat, 21 Oct 2006 08:17:39 +0000 (UTC)

 trhodes     2006-10-21 08:17:17 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/fs/ntfs          ntfs_vnops.c 
   Log:
   Fake the link count until we have no choice but to load data from the
   MFT.
   
   PR:             86965
   Submitted by:   Lowell Gilbert <lgfbsd@be-well.ilk.org>
   
   Revision  Changes    Path
   1.58      +1 -1      src/sys/fs/ntfs/ntfs_vnops.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/86965: commit references a PR
Date: Tue, 14 Nov 2006 20:48:50 +0000 (UTC)

 trhodes     2006-11-14 20:42:40 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/fs/ntfs          ntfs_vnops.c 
   Log:
   MFC 1.58:
   Fake the link count until we have no choice but to load data from the
   MFT.
   
   PR:             86965
   Submitted by:   Lowell Gilbert <lgfbsd@be-well.ilk.org>
   Approved by:    re (kensmith)
   
   Revision  Changes    Path
   1.55.2.3  +1 -1      src/sys/fs/ntfs/ntfs_vnops.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Fri Jun 15 11:37:55 UTC 2007 
State-Changed-Why:  
Needs MFC to 5. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86965 
State-Changed-From-To: patched->closed 
State-Changed-By: remko 
State-Changed-When: Sat Feb 9 13:13:04 UTC 2008 
State-Changed-Why:  
This needs MFC to RELENG_5, though I would like people facing this to 
encourage them to use FreeBSD-6 and/or FreeBSD-7 (preferred) since in 
the not too long future REL_5 will no longer be supported. Close the 
ticket for those reasons 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86965 
>Unformatted:
