From patchwork Fri Sep 22 02:36:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 9965049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FEEF602D8 for ; Fri, 22 Sep 2017 02:36:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C060296D8 for ; Fri, 22 Sep 2017 02:36:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 007C9296DA; Fri, 22 Sep 2017 02:36:28 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, T_TVD_MIME_EPI 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 A0956296D8 for ; Fri, 22 Sep 2017 02:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751788AbdIVCg1 (ORCPT ); Thu, 21 Sep 2017 22:36:27 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:50704 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780AbdIVCg0 (ORCPT ); Thu, 21 Sep 2017 22:36:26 -0400 Received: by mail-pg0-f46.google.com with SMTP id p5so4561621pgn.7; Thu, 21 Sep 2017 19:36:26 -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=1wc8/sHVtfNqKBMmNJNUZ0bb6HZCzpgE2A1y0OSPpQM=; b=H9upslbJI2o7g5SjEgPUBMDWO1OcYN0mITyu1OtSx5DTJhNWemGkr8n7XcF/UrLsal 7LZPyw0ESVE7SWTO21OcDtFq3uujJ9FbZQ2o9hZuy63uplSdmxcAC3Ia3ZLTseBh0S+B Ga/gh31LCWwSmvuKruisOnF4ds4AzEBshB03R+PHL17JBGGsKtXWZaI7Q55js7b+RW57 T0CGZHBlFcqvdAX352ypuSNRdMJaBahrFqyAJCnLvZQ9QrbpYfsYGoIRSLTPt5XKcR+f rysS+u7/iN2BYc53sm6kFnbf2JB7r5FywXTJhpoUQd7K+39OcYv2mSPyX3iFvjwjgZrI c5Iw== 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=1wc8/sHVtfNqKBMmNJNUZ0bb6HZCzpgE2A1y0OSPpQM=; b=M+Pcxxg+IQRRMGVS5021FLKk3CPiEUOU4E+Tm87FMEf2PiUwhv6fBav/2nBrbsFhwR dRmSi5SzpehBGVukyrfkBkeyRN9GkAGzadfwgVJGEJjA9lsgdONQxrKdWkFFR/6CJ4JX xvrLAbLPuF6z437TaPT+vt3OZCi6S16QT1PvG2C6ZimQ7r0Tdt7ftbVdxDsJOGJvUtjQ Ui8G90spPuZr5OIrIzn5mR+kJf05bFpeC6T7aDEHx/BDos5fbKZwWlX/IAIPv6GSNMaU BNNICd3Pj8yoJVY2LUqBM7FOvq/pDZFH35g+5MSu52yR5jNi2l9a9qA6CWU82gv09DfX 8LOw== X-Gm-Message-State: AHPjjUjiEB3vsJk/vShYmoSPda7pZmsyXCaF0m7hmklIzWllxDESu4ry 7PxL2rKf8fvovw1s7a0WkcQnfSmq3Qw3yj1PwLrZkw== X-Google-Smtp-Source: AOwi7QBFJqcomzh79TVJ1q0Gn6aeuDlB6+IW3xxHG8Y4JZQu1Y4Z0tFZaCaTG+PXPLNqelJL3WAdk/irWEN1rMwiYa8= X-Received: by 10.101.72.65 with SMTP id i1mr7895860pgs.184.1506047785995; Thu, 21 Sep 2017 19:36:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.142.1 with HTTP; Thu, 21 Sep 2017 19:36:05 -0700 (PDT) From: Steve French Date: Thu, 21 Sep 2017 21:36:05 -0500 Message-ID: Subject: [SMB3] [PATCH] statx enablement for cifs.ko To: "linux-cifs@vger.kernel.org" , samba-technical , linux-fsdevel Cc: Miklos Szeredi , David Howells , Pavel Shilovskiy , 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 Reviewed-by: Ronnie Sahlberg Acked-by: Jeff Layton Acked-by: Pavel Shilovsky From 8943b0149ad1f212d7220461cd0b29f7fe3ffd58 Mon Sep 17 00:00:00 2001 From: Steve French Date: Thu, 21 Sep 2017 21:32:29 -0500 Subject: [PATCH] [SMB3] fix statx We weren't returning the creation time or the two easily supported attributes (ENCRYPTED or COMPRESSED) for the getattr call to allow statx to return these fields. Signed-off-by: Steve French CC: Stable --- fs/cifs/inode.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index a869363..7c732cb4 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -234,6 +234,8 @@ cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, FILE_UNIX_BASIC_INFO *info, fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime); fattr->cf_mtime = cifs_NTtimeToUnix(info->LastModificationTime); fattr->cf_ctime = cifs_NTtimeToUnix(info->LastStatusChange); + /* old POSIX extensions don't get create time */ + fattr->cf_mode = le64_to_cpu(info->Permissions); /* @@ -2024,6 +2026,19 @@ int cifs_getattr(const struct path *path, struct kstat *stat, stat->blksize = CIFS_MAX_MSGSIZE; stat->ino = CIFS_I(inode)->uniqueid; + /* old CIFS Unix Extensions doesn't return create time */ + if (CIFS_I(inode)->createtime) { + stat->result_mask |= STATX_BTIME; + stat->btime = + cifs_NTtimeToUnix(cpu_to_le64(CIFS_I(inode)->createtime)); + } + + stat->attributes_mask |= (STATX_ATTR_COMPRESSED | STATX_ATTR_ENCRYPTED); + if (CIFS_I(inode)->cifsAttrs & FILE_ATTRIBUTE_COMPRESSED) + stat->attributes |= STATX_ATTR_COMPRESSED; + if (CIFS_I(inode)->cifsAttrs & FILE_ATTRIBUTE_ENCRYPTED) + stat->attributes |= STATX_ATTR_ENCRYPTED; + /* * If on a multiuser mount without unix extensions or cifsacl being * enabled, and the admin hasn't overridden them, set the ownership -- 2.7.4