From patchwork Tue Jun 16 15:36:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sachin Prabhu X-Patchwork-Id: 6618931 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F2CC9F1C1 for ; Tue, 16 Jun 2015 15:36:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38553207B9 for ; Tue, 16 Jun 2015 15:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F14920768 for ; Tue, 16 Jun 2015 15:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751158AbbFPPgU (ORCPT ); Tue, 16 Jun 2015 11:36:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49782 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752907AbbFPPgT (ORCPT ); Tue, 16 Jun 2015 11:36:19 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id C03E52F14B7 for ; Tue, 16 Jun 2015 15:36:19 +0000 (UTC) Received: from sprabhu-lp.redhat.com (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5GFaH9U002519 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 16 Jun 2015 11:36:19 -0400 From: Sachin Prabhu To: linux-cifs Subject: [PATCH] cifs: Unset CIFS_MOUNT_POSIX_PATHS flag when following dfs mounts Date: Tue, 16 Jun 2015 16:36:17 +0100 Message-Id: <1434468977-25651-1-git-send-email-sprabhu@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In a dfs setup where the client transitions from a server which supports posix paths to a server which doesn't support posix paths, the flag CIFS_MOUNT_POSIX_PATHS is not reset. This leads to the wrong directory separator being used causing smb commands to fail. Consider the following case where a dfs share on a samba server points to a share on windows smb server. # mount -t cifs -o .. //vm140-31/dfsroot/testwin/ # ls -l /mnt; touch /mnt/a total 0 touch: cannot touch ‘/mnt/a’: No such file or directory Signed-off-by: Sachin Prabhu Acked-by: Jeff Layton --- fs/cifs/connect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 8383d5e..a59370b 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -3461,6 +3461,8 @@ try_mount_again: else if (ses) cifs_put_smb_ses(ses); + cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_POSIX_PATHS; + free_xid(xid); } #endif