From patchwork Thu Mar 26 17:35:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 14585 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 n2QHaHtK010396 for ; Thu, 26 Mar 2009 17:36:17 GMT Received: from dp.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 9A881163D10 for ; Thu, 26 Mar 2009 17:35:58 +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 904A5163AF4 for ; Thu, 26 Mar 2009 17:35:29 +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 n2QHZd5F024980; Thu, 26 Mar 2009 13:35:39 -0400 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 n2QHZWLH031960; Thu, 26 Mar 2009 13:35:32 -0400 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 n2QHZdDr010655; Thu, 26 Mar 2009 13:35:39 -0400 Received: from dantu.rdu.redhat.com ([127.0.0.1]) by dantu.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2QHZcGj011027; Thu, 26 Mar 2009 13:35:38 -0400 Received: (from jlayton@localhost) by dantu.rdu.redhat.com (8.13.8/8.13.8/Submit) id n2QHZcGG011026; Thu, 26 Mar 2009 13:35:38 -0400 From: Jeff Layton To: smfrench@gmail.com Date: Thu, 26 Mar 2009 13:35:36 -0400 Message-Id: <1238088937-10994-4-git-send-email-jlayton@redhat.com> In-Reply-To: <1238088937-10994-1-git-send-email-jlayton@redhat.com> References: <1238088937-10994-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 3/4] 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 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