From patchwork Fri Jun 12 08:56:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1308081 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZkBFJS7I; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49jvjJ4qDzz9sSy for ; Fri, 12 Jun 2020 18:56:36 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726327AbgFLI4g (ORCPT ); Fri, 12 Jun 2020 04:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726319AbgFLI4f (ORCPT ); Fri, 12 Jun 2020 04:56:35 -0400 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FD98C03E96F for ; Fri, 12 Jun 2020 01:56:35 -0700 (PDT) Received: by mail-yb1-xb29.google.com with SMTP id o4so4559419ybp.0 for ; Fri, 12 Jun 2020 01:56:35 -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; bh=GljV///iV620qztHSQ6mDOi2C+U59nk6tthjY3B52gk=; b=ZkBFJS7IVh1utJ6bC3Ob8YuZrEQSHAMHZEQkxbEKEk0qIpILPX6OdkRi4eCOICkrAp XlFFxSATeRaIwmPf+9kq4iUwaz7422yWtCTks3GgeBjwY5gKgcmtImngnGkumAp4rDZv IchRC314a0CNot4FxVcSenbMt1ECOmb6sTz1vNfjRNODTgdHCzGLytmvDzzi4mSj+PCJ tENzTQIuy8AyG0uH/eGIcdfx+EAol3SXOc9S6oaAPBto1+uz1LALGeA/1gOErfbzKrZw 3G5nlgu4oYN9errTJZh3c8fxclM3McWm6yVXDEkxlpLiAjsVS/iQkQU7g/9ey+Ld34fG +JIA== 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; bh=GljV///iV620qztHSQ6mDOi2C+U59nk6tthjY3B52gk=; b=oM5lVkvtA3CEvQ/j190morYUPpgzguBvaYhgZkS5N7qZeB4ExGH5BBftYz6D6aLmQb 9tYsT31EOY1pjDmYLgGPLH6jCk1qFErZ9hbncH4AGr+BzFc1GYD0GOuAoc4gWc3XJUu7 VyVK4RBAlhzd+OugJVxMjtVFZLH0/4sMjtyXDEj/fk+cer/+zpEE6eNJrM2Qu7i7Wooq yYh+tlr/5TltMKQNk1O+gOiqj4Mi+jk1G0nJwbHxA2GYUtFgxK+YqUGh1PFfc60ssWvM 5+i/euh318HPurZQZXwJxA99Ln/VZ3ABSucwx1m9+oaxHMd2V2/fs8Rq5j5thK5hCDMy VUOg== X-Gm-Message-State: AOAM533uLWilRaBZJrg6blIMins69S9Jy66cTP5Zj7PQrxb3fMgelbsY Y8ihIzeT80f8Zt7sHLZx4SpPvjUH4F/lzVSccBokgRkw X-Google-Smtp-Source: ABdhPJyMmIkY35qcTFg/xnzar2RgqcIYGUSJpn96GXOlRIHj3UL93Ur2IHtqov8tM8jEdw4/TB459XBNtVRYmEmIE1M= X-Received: by 2002:a25:bc81:: with SMTP id e1mr9625548ybk.375.1591952193189; Fri, 12 Jun 2020 01:56:33 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Fri, 12 Jun 2020 03:56:21 -0500 Message-ID: Subject: [PATCH][SMB3] Add support for POSIX Extension info level on query info To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org We were only using level 100 (posix info level) on query dir not the compounded query file info. Reviewed-by: Aurelien Aptel From 1369daeda6c1d914fdba83a4b9627efbd8431abc Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 11 Jun 2020 20:23:38 -0500 Subject: [PATCH 2/5] smb311: Add support for SMB311 query info (non-compounded) Add worker function for non-compounded SMB3.1.1 POSIX Extensions query info. This is needed for revalidate of root (cached) directory for example. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg --- fs/cifs/smb2pdu.c | 13 +++++++++++++ fs/cifs/smb2proto.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index ded96b529a4d..a55a969673aa 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3456,6 +3456,19 @@ int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon, NULL); } +int +SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon, + u64 persistent_fid, u64 volatile_fid, struct smb311_posix_qinfo *data, u32 *plen) +{ + size_t output_len = sizeof(struct smb311_posix_qinfo *) + + (sizeof(struct cifs_sid) * 2) + (PATH_MAX * 2); + *plen = 0; + + return query_info(xid, tcon, persistent_fid, volatile_fid, + SMB_FIND_FILE_POSIX_INFO, SMB2_O_INFO_FILE, 0, + output_len, sizeof(struct smb311_posix_qinfo), (void **)&data, plen); +} + int SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, u64 volatile_fid, diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index a5c6da59847e..2f8ecbf54214 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h @@ -182,6 +182,8 @@ extern int SMB2_flush_init(const unsigned int xid, struct smb_rqst *rqst, struct TCP_Server_Info *server, u64 persistent_file_id, u64 volatile_file_id); extern void SMB2_flush_free(struct smb_rqst *rqst); +extern int SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon, + u64 persistent_fid, u64 volatile_fid, struct smb311_posix_qinfo *data, u32 *plen); extern int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_file_id, u64 volatile_file_id, struct smb2_file_all_info *data); -- 2.25.1