From patchwork Wed Feb 11 13:08:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 6666 Received: from lists.samba.org (mail.samba.org [66.70.73.150]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1BD9EXV032277 for ; Wed, 11 Feb 2009 13:09:14 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 23CB4163C69 for ; Wed, 11 Feb 2009 13:09:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on dp.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.8 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.1.7 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mx2.redhat.com (mx2.redhat.com [66.187.237.31]) by lists.samba.org (Postfix) with ESMTP id C108A163B66 for ; Wed, 11 Feb 2009 13:08:21 +0000 (GMT) Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1BD8WDs006326; Wed, 11 Feb 2009 08:08:32 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1BD8UL9028569; Wed, 11 Feb 2009 08:08:32 -0500 Received: from dantu.rdu.redhat.com (dantu.rdu.redhat.com [10.11.228.66]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1BD8UC3002495; Wed, 11 Feb 2009 08:08:30 -0500 Received: from dantu.rdu.redhat.com ([127.0.0.1]) by dantu.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1BD8TiB024649; Wed, 11 Feb 2009 08:08:29 -0500 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.13.8/8.13.8/Submit) id n1BD8Tj1024648; Wed, 11 Feb 2009 08:08:29 -0500 From: Jeff Layton To: smfrench@gmail.com Date: Wed, 11 Feb 2009 08:08:27 -0500 Message-Id: <1234357708-24624-2-git-send-email-jlayton@redhat.com> In-Reply-To: <1234357708-24624-1-git-send-email-jlayton@redhat.com> References: <1234357708-24624-1-git-send-email-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Cc: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [PATCH 2/3] cifs: use iunique() in cifs_new_inode() X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org Errors-To: linux-cifs-client-bounces+patchwork-cifs-client=patchwork.kernel.org@lists.samba.org ...to make sure that we get unique inode numbers when we're generating them on the fly. Signed-off-by: Jeff Layton --- 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 475115c..91d63f3 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, 2); /* * must set this here instead of cifs_alloc_inode since VFS will