From patchwork Fri Oct 19 06:11:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10648699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EDAD13A4 for ; Fri, 19 Oct 2018 06:11:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4978E289D8 for ; Fri, 19 Oct 2018 06:11:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DB2E289EB; Fri, 19 Oct 2018 06:11:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3025289D8 for ; Fri, 19 Oct 2018 06:11:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726542AbeJSOQO (ORCPT ); Fri, 19 Oct 2018 10:16:14 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:41221 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726340AbeJSOQO (ORCPT ); Fri, 19 Oct 2018 10:16:14 -0400 Received: by mail-pg1-f195.google.com with SMTP id 23-v6so15303523pgc.8 for ; Thu, 18 Oct 2018 23:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=RP82DXTzMH+zIYFkjForjU5/tV3cSC3vI/sV23VdliY=; b=pMpGFTQz2a7pyAgBhA4XAVzCAhX44p5M6rLGyEy1GZFJDWy69lJljgDmSTYvFOG7er /KRYBtZPZBRNVrGnTAmBBFP+HocEYTpUnsDhfuoj6/Q3S4R7I3VP3il4HEaUtdzQsSUv ZrgAQ03DVxKL7/2F8rkjngu70NYCNQSot3vINYCuJJL81nVQHHDbrHC30mVCf6LClkYg TxMfDt1tVyDpQnqki1g0jCwh9nVZbgXZE3Q4wJeosAb6nNesZDL9BI7rLT1GWLam2G2E jwONusMlIKC6qAQhEZLBh24oNHw3103v2syd67oaKhiV/cLYGZCPJ746pksItWHjEpzD rfeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=RP82DXTzMH+zIYFkjForjU5/tV3cSC3vI/sV23VdliY=; b=YoIrZI3Yd/9eqHEqZSY0cbnU0lN+cHXJLI7q0V9hqxuGVWEhhC1iSkVkHlZAF3VWo3 zb8tcLp5O30RxAscXowUUWr3IdL54Mc71lDhzaisXfiNBrsyIFxcH8lBfoAjc7B4HOet Povip+kKYgDk9op6F/5QheemkjqldDtukeR01XLEZsxYHFF/LPDpoBsD3WFbIu8dBb40 njz1BejzgIXmF3II7uvwzZj8eqUrAl418QMNurCph7WoSxxXlJ62//LSUvVhs32dZh0Y iBcmg2MVV4gV/7Wf9iL7n0vNoD+ngi8SDF3VQqKpMrNH8gOdUlmolxt2BqYWliFNgvi7 HQyw== X-Gm-Message-State: ABuFfoixmh7UN4KbzBeFYhDKYPvmbxvJb96d2bIgMzh2yKnaNHkN6e03 RQB0C6um26HuO0OaXBAji9KRLQ4YHBOYOkZNdodM961/ X-Google-Smtp-Source: ACcGV61jwF6AQDVZh57W3VGYIcdMF1FwOO1RQeO3BqStJYn9V8gjhuWiXyfEQKfJoT2gSC6XT+I9Tr3U2k9jS7c5IPA= X-Received: by 2002:a63:2503:: with SMTP id l3-v6mr31169621pgl.69.1539929498090; Thu, 18 Oct 2018 23:11:38 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Fri, 19 Oct 2018 01:11:26 -0500 Message-ID: Subject: [SMB3][PATCH] smb3: send backup intent on compounded query info To: CIFS Cc: ronnie sahlberg Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When mounting with backupuid set, we should be setting CREATE_OPEN_BACKUP_INTENT flag on compounded opens as well, especially the case of compounded smb2_query_path_info. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg --- fs/cifs/smb2inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) *symlink = false; @@ -301,16 +302,20 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, GFP_KERNEL); if (smb2_data == NULL) return -ENOMEM; + if (backup_cred(cifs_sb)) + create_options |= CREATE_OPEN_BACKUP_INTENT; rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, - FILE_READ_ATTRIBUTES, FILE_OPEN, 0, + FILE_READ_ATTRIBUTES, FILE_OPEN, create_options, smb2_data, SMB2_OP_QUERY_INFO); if (rc == -EOPNOTSUPP) { *symlink = true; + create_options |= OPEN_REPARSE_POINT; + /* Failed on a symbolic link - query a reparse point info */ rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, FILE_READ_ATTRIBUTES, FILE_OPEN, - OPEN_REPARSE_POINT, smb2_data, + create_options, smb2_data, SMB2_OP_QUERY_INFO); } if (rc) From 452e4b304ef0ad043193202004997da998d045a7 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 19 Oct 2018 00:32:41 -0500 Subject: [PATCH 1/2] smb3: send backup intent on compounded query info When mounting with backupuid set, we should be setting CREATE_OPEN_BACKUP_INTENT flag on compounded opens as well, especially the case of compounded smb2_query_path_info. Signed-off-by: Steve French --- fs/cifs/smb2inode.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index 50d4a9afb36a..9e7ef7ec2d70 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c @@ -293,6 +293,7 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, { int rc; struct smb2_file_all_info *smb2_data; + __u32 create_options = 0; *adjust_tz = false; *symlink = false; @@ -301,16 +302,20 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, GFP_KERNEL); if (smb2_data == NULL) return -ENOMEM; + if (backup_cred(cifs_sb)) + create_options |= CREATE_OPEN_BACKUP_INTENT; rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, - FILE_READ_ATTRIBUTES, FILE_OPEN, 0, + FILE_READ_ATTRIBUTES, FILE_OPEN, create_options, smb2_data, SMB2_OP_QUERY_INFO); if (rc == -EOPNOTSUPP) { *symlink = true; + create_options |= OPEN_REPARSE_POINT; + /* Failed on a symbolic link - query a reparse point info */ rc = smb2_compound_op(xid, tcon, cifs_sb, full_path, FILE_READ_ATTRIBUTES, FILE_OPEN, - OPEN_REPARSE_POINT, smb2_data, + create_options, smb2_data, SMB2_OP_QUERY_INFO); } if (rc) -- 2.17.1