From patchwork Tue Oct 27 15:02:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 36989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id D27F4B7BF1 for ; Wed, 28 Oct 2009 02:02:52 +1100 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id A8683AD0F4; Tue, 27 Oct 2009 09:01:13 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=3.8 tests=AWL, BAYES_00, NO_MORE_FUNN, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.121]) by lists.samba.org (Postfix) with ESMTP id 094C1AC424 for ; Tue, 27 Oct 2009 09:01:07 -0600 (MDT) Received: from mail.poochiereds.net ([71.70.153.3]) by cdptpa-omta03.mail.rr.com with ESMTP id <20091027150245404.SDLX6016@cdptpa-omta03.mail.rr.com>; Tue, 27 Oct 2009 15:02:45 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 195B358183; Tue, 27 Oct 2009 11:02:44 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Date: Tue, 27 Oct 2009 11:02:43 -0400 Message-Id: <1256655764-27799-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.0.6 Cc: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [PATCH] cifs: fix server returning zeroed out FileID's in SMB_FIND_FILE_ID_FULL_DIR_INFO X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org It's possible that a server will return a valid FileID when we query the FILE_INTERNAL_INFO for the root inode, but then zeroed out inode numbers when we do a FindFile with an infolevel of SMB_FIND_FILE_ID_FULL_DIR_INFO. In this situation turn off querying for server inode numbers, and just generate an inode number using iunique. While I've given this patch to the reporter and asked him to test it, he hasn't yet come back with the results. So I can't confirm whether this really fixes the problem or not. I expect that it will, but I'll understand if you'd rather wait to commit this until we have confirmation. Reported-by: Timothy Normand Miller Signed-off-by: Jeff Layton --- fs/cifs/readdir.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 1f098ca..bafef8b 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -727,11 +727,13 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir, cifs_dir_info_to_fattr(&fattr, (FILE_DIRECTORY_INFO *) pfindEntry, cifs_sb); - /* FIXME: make _to_fattr functions fill this out */ - if (pCifsF->srch_inf.info_level == SMB_FIND_FILE_ID_FULL_DIR_INFO) + if (inum) { fattr.cf_uniqueid = inum; - else + } else { fattr.cf_uniqueid = iunique(sb, ROOT_I); + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) + cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM; + } ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid); tmp_dentry = cifs_readdir_lookup(file->f_dentry, &qstring, &fattr);