Re: [PATCH 1/3] cifs: always revalidate hardlinked inodes

Jeff Layton <[email protected]> Mon, 17 May 2010 15:01:20 -0400
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
On Mon, 17 May 2010 07:18:56 -0400
Jeff Layton <[email protected]> wrote:

> The old cifs_revalidate logic always revalidated hardlinked inodes.
> This hack allowed CIFS to pass some connectathon tests when server inode
> numbers aren't used (basic test7, in particular).
> 
> Signed-off-by: Jeff Layton <[email protected]>
> ---
>  fs/cifs/inode.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index b35cb03..f52161a 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -1511,6 +1511,10 @@ cifs_inode_needs_reval(struct inode *inode)
>  	if (time_after_eq(jiffies, cifs_i->time + HZ))
>  		return true;
>  
> +	/* hardlinked files get "special" treatment */
> +	if (S_ISREG(inode->i_mode) && inode->i_nlink != 1)
> +		return true;
> +
>  	return false;
>  }
>  

Steve mentioned on IRC that we should limit this behavior to the
noserverino case. Replacement patch attached.

-- 
Jeff Layton <[email protected]>

_______________________________________________
linux-cifs-client mailing list
[email protected]
https://lists.samba.org/mailman/listinfo/linux-cifs-client
0001-cifs-always-revalidate-hardlinked-inodes-when-using-.patch (text/x-patch, 1 KB)
From 3b4c8849e6126849cd6aea33ff52679403bc2f87 Mon Sep 17 00:00:00 2001
From: Jeff Layton <[email protected]>
Date: Mon, 17 May 2010 14:51:49 -0400
Subject: [PATCH] cifs: always revalidate hardlinked inodes when using noserverino

The old cifs_revalidate logic always revalidated hardlinked inodes.
This hack allowed CIFS to pass some connectathon tests when server inode
numbers aren't used (basic test7, in particular).

Signed-off-by: Jeff Layton <[email protected]>
---
 fs/cifs/inode.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 5b042fc..8e05e8a 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1528,6 +1528,11 @@ cifs_inode_needs_reval(struct inode *inode)
 	if (time_after_eq(jiffies, cifs_i->time + HZ))
 		return true;
 
+	/* hardlinked files w/ noserverino get "special" treatment */
+	if (!(CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) &&
+	    S_ISREG(inode->i_mode) && inode->i_nlink != 1)
+		return true;
+
 	return false;
 }
 
-- 
1.6.6.1