From patchwork Tue Oct 27 15:02:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 36990 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 E873BB7BF1 for ; Wed, 28 Oct 2009 02:02:53 +1100 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id D1277AD173; Tue, 27 Oct 2009 09:01:14 -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 0958AAD073 for ; Tue, 27 Oct 2009 09:01:07 -0600 (MDT) Received: from mail.poochiereds.net ([71.70.153.3]) by cdptpa-omta02.mail.rr.com with ESMTP id <20091027150245405.TRDH12118@cdptpa-omta02.mail.rr.com>; Tue, 27 Oct 2009 15:02:45 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 2354058166; Tue, 27 Oct 2009 11:02:44 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Date: Tue, 27 Oct 2009 11:02:44 -0400 Message-Id: <1256655764-27799-2-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1256655764-27799-1-git-send-email-jlayton@redhat.com> References: <1256655764-27799-1-git-send-email-jlayton@redhat.com> Cc: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [PATCH] cifs: don't use CIFSGetSrvInodeNumber in is_path_accessible 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 Because it's lighter weight, CIFS tries to do a QPathInfo call with an infolevel of SMB_QUERY_FILE_INTERNAL_INFO to verify the accessibility of the root inode. It then falls back to using an infolevel of SMB_QUERY_FILE_ALL_INFO if that fails with -EOPNOTSUPP. There's a problem however. SMB_QUERY_FILE_INTERNAL_INFO isn't as well supported by all servers as SMB_QUERY_FILE_ALL_INFO is, and the error returns from those servers aren't well standardized. I have at least one report of a server that returns NT_STATUS_INTERNAL_ERROR (which translates to EIO) rather than something that translates to EOPNOTSUPP. Given that that function only gets called at mount time, I think it's better to do this as simply as possible. Rather than trying to be clever, just have is_path_accessible use SMB_QUERY_FILE_ALL_INFO. That call is widely supported and it shouldn't increase the overhead significantly. Unfortunately, the reporter of this problem doesn't seem to be in a hurry to test it, so I don't have any test results from it. Given what I see in the captures though, I expect that this will fix the problem. Signed-off-by: Jeff Layton --- fs/cifs/connect.c | 8 -------- 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b090980..63ea83f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2220,16 +2220,8 @@ is_path_accessible(int xid, struct cifsTconInfo *tcon, struct cifs_sb_info *cifs_sb, const char *full_path) { int rc; - __u64 inode_num; FILE_ALL_INFO *pfile_info; - rc = CIFSGetSrvInodeNumber(xid, tcon, full_path, &inode_num, - cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags & - CIFS_MOUNT_MAP_SPECIAL_CHR); - if (rc != -EOPNOTSUPP) - return rc; - pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); if (pfile_info == NULL) return -ENOMEM;