[linux-cifs-client] [PATCH 3/4] cifs: use iunique() in cifs_new_inode()

Jeff Layton jlayton at redhat.com
Thu Mar 26 17:35:36 GMT 2009


...to make sure that we get unique inode numbers when we're generating
them on the fly.

Signed-off-by: Jeff Layton <jlayton at redhat.com>
---
 fs/cifs/inode.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index a8797cc..3525ea5 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -224,11 +224,12 @@ cifs_new_inode(struct super_block *sb, __u64 *inum)
 	/*
 	 * BB: Is i_ino == 0 legal? Here, we assume that it is. If it isn't we
 	 *     stop passing inum as ptr. Are there sanity checks we can use to
-	 *     ensure that the server is really filling in that field? Also,
-	 *     if serverino is disabled, perhaps we should be using iunique()?
+	 *     ensure that the server is really filling in that field?
 	 */
 	if (inum && (CIFS_SB(sb)->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))
 		inode->i_ino = (unsigned long) *inum;
+	else
+		inode->i_ino = iunique(sb, ROOT_I);
 
 	/*
 	 * must set this here instead of cifs_alloc_inode since VFS will
-- 
1.5.5.6



More information about the linux-cifs-client mailing list