diff mbox

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

Message ID 1238088937-10994-4-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton March 26, 2009, 5:35 p.m. UTC
...to make sure that we get unique inode numbers when we're generating
them on the fly.

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

Patch

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