All of lore.kernel.org
 help / color / mirror / Atom feed
* [SMB3] [PATCH] statx enablement for cifs.ko
@ 2017-09-22  2:36 Steve French
  2017-09-22  3:21 ` Leif Sahlberg
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Steve French @ 2017-09-22  2:36 UTC (permalink / raw)
  To: linux-cifs, samba-technical, linux-fsdevel
  Cc: Miklos Szeredi, David Howells, Pavel Shilovskiy, ronnie sahlberg

[-- Attachment #1: Type: text/plain, Size: 19 bytes --]

-- 
Thanks,

Steve

[-- Attachment #2: 0001-SMB3-fix-statx.patch --]
[-- Type: text/x-patch, Size: 1862 bytes --]

From 8943b0149ad1f212d7220461cd0b29f7fe3ffd58 Mon Sep 17 00:00:00 2001
From: Steve French <smfrench@gmail.com>
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 <smfrench@gmail.com>
CC: Stable <stable@vger.kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [SMB3] [PATCH] statx enablement for cifs.ko
  2017-09-22  2:36 [SMB3] [PATCH] statx enablement for cifs.ko Steve French
@ 2017-09-22  3:21 ` Leif Sahlberg
  2017-09-22 13:44 ` Jeff Layton
  2017-09-22 23:48 ` Pavel Shilovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Leif Sahlberg @ 2017-09-22  3:21 UTC (permalink / raw)
  To: Steve French
  Cc: linux-cifs, samba-technical, linux-fsdevel, Miklos Szeredi,
	David Howells, Pavel Shilovskiy, ronnie sahlberg

Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>


----- Original Message -----
From: "Steve French" <smfrench@gmail.com>
To: linux-cifs@vger.kernel.org, "samba-technical" <samba-technical@lists.samba.org>, "linux-fsdevel" <linux-fsdevel@vger.kernel.org>
Cc: "Miklos Szeredi" <miklos@szeredi.hu>, "David Howells" <dhowells@redhat.com>, "Pavel Shilovskiy" <pshilov@microsoft.com>, "ronnie sahlberg" <ronniesahlberg@gmail.com>
Sent: Friday, 22 September, 2017 12:36:05 PM
Subject: [SMB3] [PATCH] statx enablement for cifs.ko

-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [SMB3] [PATCH] statx enablement for cifs.ko
  2017-09-22  2:36 [SMB3] [PATCH] statx enablement for cifs.ko Steve French
  2017-09-22  3:21 ` Leif Sahlberg
@ 2017-09-22 13:44 ` Jeff Layton
  2017-09-22 23:48 ` Pavel Shilovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2017-09-22 13:44 UTC (permalink / raw)
  To: Steve French, linux-cifs, samba-technical, linux-fsdevel
  Cc: Miklos Szeredi, David Howells, Pavel Shilovskiy, ronnie sahlberg

On Thu, 2017-09-21 at 21:36 -0500, Steve French wrote:
> 

Looks reasonable

Acked-by: Jeff Layton <jlayton@poochiereds.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [SMB3] [PATCH] statx enablement for cifs.ko
  2017-09-22  2:36 [SMB3] [PATCH] statx enablement for cifs.ko Steve French
  2017-09-22  3:21 ` Leif Sahlberg
  2017-09-22 13:44 ` Jeff Layton
@ 2017-09-22 23:48 ` Pavel Shilovsky
  2 siblings, 0 replies; 4+ messages in thread
From: Pavel Shilovsky @ 2017-09-22 23:48 UTC (permalink / raw)
  To: Steve French
  Cc: linux-cifs, samba-technical, linux-fsdevel, Miklos Szeredi,
	David Howells, Pavel Shilovskiy, ronnie sahlberg

2017-09-21 19:36 GMT-07:00 Steve French <smfrench@gmail.com>:
> --
> Thanks,
>
> Steve

Acked-by: Pavel Shilovsky <pshilov@microsoft.com>

--
Best regards,
Pavel Shilovsky

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-22 23:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22  2:36 [SMB3] [PATCH] statx enablement for cifs.ko Steve French
2017-09-22  3:21 ` Leif Sahlberg
2017-09-22 13:44 ` Jeff Layton
2017-09-22 23:48 ` Pavel Shilovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.