Skip to contentSkip to conversation

cifs: use sensible file nlink values if unprovided

PATCH In review David Disseldorp 4 participants 10 messages Jul 4, 2013 – Jul 6, 2013 7 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: use sensible file nlink values if unprovided

Certain servers may not set the NumberOfLinks field in query file/path info responses. In such a case, cifs_inode_needs_reval() assumes that all regular files are hardlinks and triggers revalidation, leading to excessive and unnecessary network traffic.

This change hardcodes cf_nlink (and subsequently i_nlink) when not returned by the server, similar to what already occurs in cifs_mkdir().

---
 fs/cifs/inode.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
fs/cifs/inode.c +8 -2
index 6f37228..8c48027 100644
@@ -532,6 +532,8 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
 	fattr->cf_bytes = le64_to_cpu(info->AllocationSize);
 	fattr->cf_createtime = le64_to_cpu(info->CreationTime);
 
+	fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+
 	if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
 		fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
 		fattr->cf_dtype = DT_DIR;
@@ -542,9 +544,13 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
 		/* clear write bits if ATTR_READONLY is set */
 		if (fattr->cf_cifsattrs & ATTR_READONLY)
 			fattr->cf_mode &= ~(S_IWUGO);
-	}
 
-	fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+		if (fattr->cf_nlink < 1) {
+			cFYI(1, "replacing bogus file nlink value %u",
+				fattr->cf_nlink);
+			fattr->cf_nlink = 1;
+		}
+	}
 
 	fattr->cf_uid = cifs_sb->mnt_uid;
 	fattr->cf_gid = cifs_sb->mnt_gid;
Signature · 1 line
1.8.1.4

A message that is not in the archive (sent off-list or not yet received): 1372961186-19213-1-git-send-email-ddiss-l3A5Bk7waGM@public.gmane.org

#2 lore raw

I merged an equivalent but slightly smaller version of your patch into cifs-2.6.git (see below) and added stable since we should not be returning nlink of 0. Let me know if any objections.

[CIFS] use sensible file nlink values if unprovided

Certain servers may not set the NumberOfLinks field in query file/path info responses. In such a case, cifs_inode_needs_reval() assumes that all regular files are hardlinks and triggers revalidation, leading to excessive and unnecessary network traffic.

This change hardcodes cf_nlink (and subsequently i_nlink) when not returned by the server, similar to what already occurs in cifs_mkdir().

fs/cifs/inode.c +0 -0
index 20efd81..449b6cf 100644
@@ -558,6 +558,11 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr,

FILE_ALL_INFO *info,

                        fattr->cf_mode &= ~(S_IWUGO);

                fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);

+ if (fattr->cf_nlink < 1) {
+ cifs_dbg(1, "replacing bogus file nlink value %u\n",
+ fattr->cf_nlink);
+ fattr->cf_nlink = 1;
+ }

        }

        fattr->cf_uid = cifs_sb->mnt_uid;
Quoted 49 lines · David Disseldorp

Certain servers may not set the NumberOfLinks field in query file/path info responses. In such a case, cifs_inode_needs_reval() assumes that all regular files are hardlinks and triggers revalidation, leading to excessive and unnecessary network traffic.

This change hardcodes cf_nlink (and subsequently i_nlink) when not returned by the server, similar to what already occurs in cifs_mkdir().

---
 fs/cifs/inode.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
fs/cifs/inode.c +8 -3
index 6f37228..8c48027 100644
@@ -532,6 +532,8 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
        fattr->cf_bytes = le64_to_cpu(info->AllocationSize);
        fattr->cf_createtime = le64_to_cpu(info->CreationTime);
 
+       fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+
        if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
                fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
                fattr->cf_dtype = DT_DIR;
@@ -542,9 +544,13 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
                /* clear write bits if ATTR_READONLY is set */
                if (fattr->cf_cifsattrs & ATTR_READONLY)
                        fattr->cf_mode &= ~(S_IWUGO);
-       }
 
-       fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+               if (fattr->cf_nlink < 1) {
+                       cFYI(1, "replacing bogus file nlink value %u",
+                               fattr->cf_nlink);
+                       fattr->cf_nlink = 1;
+               }
+       }
 
        fattr->cf_uid = cifs_sb->mnt_uid;
        fattr->cf_gid = cifs_sb->mnt_gid;
--

1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve

A message that is not in the archive (sent off-list or not yet received): CAH2r5mtyaufgrOssd872OZzq32TQ8fyprE82aK8FV7MbxceU7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 83 lines · Steve French

I merged an equivalent but slightly smaller version of your patch into cifs-2.6.git (see below) and added stable since we should not be returning nlink of 0. Let me know if any objections.

[CIFS] use sensible file nlink values if unprovided

Certain servers may not set the NumberOfLinks field in query file/path info responses. In such a case, cifs_inode_needs_reval() assumes that all regular files are hardlinks and triggers revalidation, leading to excessive and unnecessary network traffic.

This change hardcodes cf_nlink (and subsequently i_nlink) when not returned by the server, similar to what already occurs in cifs_mkdir().

fs/cifs/inode.c +5 -0
index 20efd81..449b6cf 100644
@@ -558,6 +558,11 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr,
 FILE_ALL_INFO *info,
                        fattr->cf_mode &= ~(S_IWUGO);
 
                fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+               if (fattr->cf_nlink < 1) {
+                       cifs_dbg(1, "replacing bogus file nlink value %u\n",
+                               fattr->cf_nlink);
+                       fattr->cf_nlink = 1;
+               }
        }
 
        fattr->cf_uid = cifs_sb->mnt_uid;
Quoted 45 lines · David Disseldorp

Certain servers may not set the NumberOfLinks field in query file/path info responses. In such a case, cifs_inode_needs_reval() assumes that all regular files are hardlinks and triggers revalidation, leading to excessive and unnecessary network traffic.

This change hardcodes cf_nlink (and subsequently i_nlink) when not returned by the server, similar to what already occurs in cifs_mkdir().

---
 fs/cifs/inode.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
fs/cifs/inode.c +8 -3
index 6f37228..8c48027 100644
@@ -532,6 +532,8 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
        fattr->cf_bytes = le64_to_cpu(info->AllocationSize);
        fattr->cf_createtime = le64_to_cpu(info->CreationTime);
 
+       fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+
        if (fattr->cf_cifsattrs & ATTR_DIRECTORY) {
                fattr->cf_mode = S_IFDIR | cifs_sb->mnt_dir_mode;
                fattr->cf_dtype = DT_DIR;
@@ -542,9 +544,13 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
                /* clear write bits if ATTR_READONLY is set */
                if (fattr->cf_cifsattrs & ATTR_READONLY)
                        fattr->cf_mode &= ~(S_IWUGO);
-       }
 
-       fattr->cf_nlink = le32_to_cpu(info->NumberOfLinks);
+               if (fattr->cf_nlink < 1) {
+                       cFYI(1, "replacing bogus file nlink value %u",
+                               fattr->cf_nlink);
+                       fattr->cf_nlink = 1;
+               }
+       }
 
        fattr->cf_uid = cifs_sb->mnt_uid;
        fattr->cf_gid = cifs_sb->mnt_gid;
--

1.8.1.4

Quoted 7 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

What about readdir? Is a similar fix needed in cifs_fill_common_info or one of its callers?

Signature · 1 line
Jeff Layton <[email protected]>
#5 lore raw
In reply to a message not in the archive
Quoted 3 lines · On Thu, 4 Jul 2013 14:43:23 -0500 Steve French…

I merged an equivalent but slightly smaller version of your patch into cifs-2.6.git (see below) and added stable since we should not be returning nlink of 0. Let me know if any objections.

Looks good to me Steve.
FWIW, I've been using the following patch to replicate the NumberOfLinks=0 behaviour on Samba:
http://gitweb.samba.org/?p=ddiss/samba.git;a=commitdiff;h=93c8795c9a9e9f

Cheers, David

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 12 lines · David Disseldorp
Quoted 3 lines · On Thu, 4 Jul 2013 14:43:23 -0500 Steve French…

I merged an equivalent but slightly smaller version of your patch into cifs-2.6.git (see below) and added stable since we should not be returning nlink of 0. Let me know if any objections.

Looks good to me Steve.
FWIW, I've been using the following patch to replicate the NumberOfLinks=0 behaviour on Samba:
http://gitweb.samba.org/?p=ddiss/samba.git;a=commitdiff;h=93c8795c9a9e9f

Quoted 5 lines

Cheers, David
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

I'm sorry, this patch is incomplete.

It ignores the readdir codepath completely. If Steve has already merged this, then it needs a follow-on patch that fixes the readdir code too, probably with the same workaround in cifs_fill_common_info.

Otherwise, you're going to end up with different st_nlink values depending on whether it got instantated by a readdir() or stat().

Signature · 1 line
Jeff Layton <[email protected]>

A message that is not in the archive (sent off-list or not yet received): 1373061027.2261.14.camel-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org

#9 lore raw

Yes - I noticed that too (although with David's patch at least it is better). For the POSIX case for readdir we are ok, but for the non-posix case for readdir there is are only two infolevels, one too big and one too small (FILE_STANDARD_INFORMATION) that seem to return nlinks so we should be setting them to default values if we can't get them from the server (ie if cf_attr->nlink is 0). This patch should fix it by catching it when we are about to update the inode to make sure we are putting a legal value in (I have not tested it yet). Thoughts on this minor followon patch?

fs/cifs/inode.c +7 -1
index 449b6cf..8329c18 100644
@@ -134,7 +134,13 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr
        inode->i_mtime = fattr->cf_mtime;
        inode->i_ctime = fattr->cf_ctime;
        inode->i_rdev = fattr->cf_rdev;
-       set_nlink(inode, fattr->cf_nlink);
+       /* number of links on a directory is at least 2, at least 1 for file */
+       if ((fattr->cf_cifsattrs & ATTR_DIRECTORY) && (fattr->cf_nlink < 2))
+               set_nlink(inode, 2);
+       else if (fattr->cf_nlink < 1)
+               set_nlink(inode, 1);
+       else
+               set_nlink(inode, fattr->cf_nlink);
        inode->i_uid = fattr->cf_uid;
        inode->i_gid = fattr->cf_gid;
 
Quoted 31 lines · Jeff Layton
Quoted 12 lines · David Disseldorp
Quoted 3 lines · On Thu, 4 Jul 2013 14:43:23 -0500 Steve French…

I merged an equivalent but slightly smaller version of your patch into cifs-2.6.git (see below) and added stable since we should not be returning nlink of 0. Let me know if any objections.

Looks good to me Steve.
FWIW, I've been using the following patch to replicate the NumberOfLinks=0 behaviour on Samba:
http://gitweb.samba.org/?p=ddiss/samba.git;a=commitdiff;h=93c8795c9a9e9f

Quoted 5 lines

Cheers, David
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

I'm sorry, this patch is incomplete.

It ignores the readdir codepath completely. If Steve has already merged this, then it needs a follow-on patch that fixes the readdir code too, probably with the same workaround in cifs_fill_common_info.

Otherwise, you're going to end up with different st_nlink values depending on whether it got instantated by a readdir() or stat().

--
Jeff Layton <[email protected]>

Signature · 3 lines
Thanks,

Steve

A message that is not in the archive (sent off-list or not yet received): CAH2r5msgztCnAZyvgmU3Y5Yupv-S=m1FXVzfN-RBQJbp0dRcyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#11 lore raw
Quoted 19 lines · Steve French

Yes - I noticed that too (although with David's patch at least it is better). For the POSIX case for readdir we are ok, but for the non-posix case for readdir there is are only two infolevels, one too big and one too small (FILE_STANDARD_INFORMATION) that seem to return nlinks so we should be setting them to default values if we can't get them from the server (ie if cf_attr->nlink is 0). This patch should fix it by catching it when we are about to update the inode to make sure we are putting a legal value in (I have not tested it yet). Thoughts on this minor followon patch?

fs/cifs/inode.c +0 -1
index 449b6cf..8329c18 100644
@@ -134,7 +134,13 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr
        inode->i_mtime = fattr->cf_mtime;
        inode->i_ctime = fattr->cf_ctime;
        inode->i_rdev = fattr->cf_rdev;
-       set_nlink(inode, fattr->cf_nlink);

fs/cifs/inode.c cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr · line 146

Quoted 10 lines
fs/cifs/inode.c +7 -0
+       /* number of links on a directory is at least 2, at least 1 for file */
+       if ((fattr->cf_cifsattrs & ATTR_DIRECTORY) && (fattr->cf_nlink < 2))
+               set_nlink(inode, 2);
+       else if (fattr->cf_nlink < 1)
+               set_nlink(inode, 1);
+       else
+               set_nlink(inode, fattr->cf_nlink);
        inode->i_uid = fattr->cf_uid;
        inode->i_gid = fattr->cf_gid;
 

There are cases where you might see a legit i_nlink value of 0. For instance...

client> fd = open("file", ...);
server> unlink("file");
client> fstat(file, ...);

...now the server may legitimately report a link count of 0, but with this patch we'll end up fudging it to something higher. Hence, I'm a little leery of doing this sort of blanket overriding of cf_nlink value, especially in the case where POSIX extensions are in force.

I think we should only do this when we really think we can't trust this value -- i.e. the non-POSIX case. Experience has shown that NumberOfLinks value is not *exactly* a 1:1 match with an i_nlink value when talking to windows-y servers.

I dunno...maybe it's time to ask dochelp for clarification on what sort of semantics we should be expecting from this field?

Signature · 1 line
Jeff Layton <[email protected]>

A message that is not in the archive (sent off-list or not yet received): 1373063192.2261.21.camel-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org

#13 lore raw
Quoted 2 lines

I dunno...maybe it's time to ask dochelp for clarification on what sort of semantics we should be expecting from this field?

It'll all be in MS-FSA, which is pretty simple:

2.1.5.11.27 FileStandardInformation
OutputBuffer is of type FILE_STANDARD_INFORMATION, as described in [MS-FSCC] section 2.4.38. Pseudocode for the operation is as follows:
...
 OutputBuffer.NumberOfLinks set to the number of Link elements in Open.File.LinkList, except if Link.IsDeleted field is TRUE (that is, the number of not-deleted links to the file).<116>
 If OutputBuffer.NumberOfLinks is 0, set OutputBuffer.DeletePending to 1.

WBN 116 has an important statement however:

<116> Section 2.1.5.11.27: This algorithm is only implemented by NTFS and ReFS. The FAT, EXFAT, CDFS, and UDFS file systems always return 1.

Quoted 67 lines

-----Original Message-----
From: [email protected] [mailto:linux-cifs- [email protected]] On Behalf Of Jeff Layton
Sent: Friday, July 5, 2013 6:27 PM
To: Steve French
Cc: David Disseldorp; [email protected]
Subject: Re: [PATCH] cifs: use sensible file nlink values if unprovided

Quoted 4 lines · Steve French

Yes - I noticed that too (although with David's patch at least it is better). For the POSIX case for readdir we are ok, but for the non-posix case for readdir there is are only two infolevels, one too big and one too small (FILE_STANDARD_INFORMATION) that seem to

return

fs/cifs/inode.c cifs_fattr_to_inode(struct inode *inode, struct

Quoted 11 lines

nlinks so we should be setting them to default values if we can't get them from the server (ie if cf_attr->nlink is 0). This patch should fix it by catching it when we are about to update the inode to make sure we are putting a legal value in (I have not tested it yet). Thoughts on this minor followon patch?

fs/cifs/inode.c index 449b6cf..8329c18 renamed from fs/cifs/inode.c +0 -0

100644

fs/cifs/inode.c +0 -0
@@ -134,7 +134,13 @@ cifs_fattr_to_inode(struct inode *inode, struct

cifs_fattr

Quoted 4 lines
fs/cifs/inode.c +0 -1
        inode->i_mtime = fattr->cf_mtime;
        inode->i_ctime = fattr->cf_ctime;
        inode->i_rdev = fattr->cf_rdev;
-       set_nlink(inode, fattr->cf_nlink);

fs/cifs/inode.c cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr · line 146

Quoted 10 lines
fs/cifs/inode.c +7 -0
+       /* number of links on a directory is at least 2, at least 1 for file */
+       if ((fattr->cf_cifsattrs & ATTR_DIRECTORY) && (fattr->cf_nlink < 2))
+               set_nlink(inode, 2);
+       else if (fattr->cf_nlink < 1)
+               set_nlink(inode, 1);
+       else
+               set_nlink(inode, fattr->cf_nlink);
        inode->i_uid = fattr->cf_uid;
        inode->i_gid = fattr->cf_gid;
 

There are cases where you might see a legit i_nlink value of 0. For instance...

client> fd = open("file", ...);
server> unlink("file");
client> fstat(file, ...);

...now the server may legitimately report a link count of 0, but with this patch we'll end up fudging it to something higher. Hence, I'm a little leery of doing this sort of blanket overriding of cf_nlink value, especially in the case where POSIX extensions are in force.

I think we should only do this when we really think we can't trust this value -- i.e. the non-POSIX case. Experience has shown that NumberOfLinks value is not *exactly* a 1:1 match with an i_nlink value when talking to windows-y servers.

I dunno...maybe it's time to ask dochelp for clarification on what sort of semantics we should be expecting from this field?

--
Jeff Layton <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at
http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 614F550557B82C44AC27C492ADA391AA11ECE73C-Jfd81uAzPQtJjAzVvmUwVFir+X/St4rqwBk/1ggFUS45P9zcU8sUGwC/[email protected]

#15 lore raw
Quoted 12 lines · Tom Talpey
Quoted 2 lines

I dunno...maybe it's time to ask dochelp for clarification on what sort of semantics we should be expecting from this field?

It'll all be in MS-FSA, which is pretty simple:

2.1.5.11.27 FileStandardInformation
OutputBuffer is of type FILE_STANDARD_INFORMATION, as described in [MS-FSCC] section 2.4.38. Pseudocode for the operation is as follows:
...
 OutputBuffer.NumberOfLinks set to the number of Link elements in Open.File.LinkList, except if Link.IsDeleted field is TRUE (that is, the number of not-deleted links to the file).<116>
 If OutputBuffer.NumberOfLinks is 0, set OutputBuffer.DeletePending to 1.

Quoted 5 lines

WBN 116 has an important statement however:

<116> Section 2.1.5.11.27: This algorithm is only implemented by NTFS and ReFS. The FAT, EXFAT, CDFS, and UDFS file systems always return 1.

Thanks! I probably should have read the spec before crying to dochelp ;)

I think that makes sense. So what we probably want to do is something like (pseudocode):

if (nlink == 0) {
	if (directory)
		nlink = 2;
	else if (regular file && !delete pending)
		nlink = 1;
}

...IOW, leave it at 0 if delete pending is set. It would be preferable to encapsulate this logic in a function too and call it from all of the places where we want to fake up this value.

readdir is tricky since none of the non-POSIX infolevels seem to return a NumberOfLinks value or a DeletePending flag. Probably best to just fake them up as best we can and hope that a later getattr fetches the correct value. If the dirent didn't have a link count of at least 1, then it presumably wouldn't be visible to a FIND_* call.

Note too that this does mean that the server that David is trying to work around is arguably broken. It's probably reasonable to go ahead and work around it since we need to do something similar for the readdir case anyway, but it would be best to have them fix their server as well.

Signature · 1 line
Jeff Layton <[email protected]>
#16 lore raw
In reply to a message not in the archive
Quoted 43 lines · Jeff Layton
Quoted 19 lines · Steve French

Yes - I noticed that too (although with David's patch at least it is better). For the POSIX case for readdir we are ok, but for the non-posix case for readdir there is are only two infolevels, one too big and one too small (FILE_STANDARD_INFORMATION) that seem to return nlinks so we should be setting them to default values if we can't get them from the server (ie if cf_attr->nlink is 0). This patch should fix it by catching it when we are about to update the inode to make sure we are putting a legal value in (I have not tested it yet). Thoughts on this minor followon patch?

fs/cifs/inode.c +0 -1
index 449b6cf..8329c18 100644
@@ -134,7 +134,13 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr
        inode->i_mtime = fattr->cf_mtime;
        inode->i_ctime = fattr->cf_ctime;
        inode->i_rdev = fattr->cf_rdev;
-       set_nlink(inode, fattr->cf_nlink);

fs/cifs/inode.c cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr · line 146

Quoted 10 lines
fs/cifs/inode.c +7 -0
+       /* number of links on a directory is at least 2, at least 1 for file */
+       if ((fattr->cf_cifsattrs & ATTR_DIRECTORY) && (fattr->cf_nlink < 2))
+               set_nlink(inode, 2);
+       else if (fattr->cf_nlink < 1)
+               set_nlink(inode, 1);
+       else
+               set_nlink(inode, fattr->cf_nlink);
        inode->i_uid = fattr->cf_uid;
        inode->i_gid = fattr->cf_gid;
 

There are cases where you might see a legit i_nlink value of 0. For instance...

client> fd = open("file", ...);
server> unlink("file");
client> fstat(file, ...);

...now the server may legitimately report a link count of 0, but with this patch we'll end up fudging it to something higher. Hence, I'm a little leery of doing this sort of blanket overriding of cf_nlink value, especially in the case where POSIX extensions are in force.

Quoted 4 lines

I think we should only do this when we really think we can't trust this value -- i.e. the non-POSIX case. Experience has shown that NumberOfLinks value is not *exactly* a 1:1 match with an i_nlink value when talking to windows-y servers.

Makes sense - but as Tom notes we should check for the delete pending case when number of links is zero, and as you note we should nont be overriding number of links everywhere - but should fix the non-posix readdir case

Signature · 3 lines
Thanks,

Steve