linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ceph: fix snapshot directory timestamps
@ 2020-03-11 11:05 Luis Henriques
  2020-03-16 17:34 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Henriques @ 2020-03-11 11:05 UTC (permalink / raw)
  To: Jeff Layton, Sage Weil, Ilya Dryomov; +Cc: Marc Roos, ceph-devel, linux-kernel

The .snap directory timestamps are kept at 0 (1970-01-01 00:00), which
isn't consistent with what the fuse client does.  This patch makes the
behaviour consistent, by setting these timestamps (atime, btime, ctime,
mtime) to those of the parent directory.

Cc: Marc Roos <M.Roos@f1-outsourcing.eu>
Signed-off-by: Luis Henriques <lhenriques@suse.com>
---
 fs/ceph/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index d01710a16a4a..968d55ca898d 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -82,10 +82,14 @@ struct inode *ceph_get_snapdir(struct inode *parent)
 	inode->i_mode = parent->i_mode;
 	inode->i_uid = parent->i_uid;
 	inode->i_gid = parent->i_gid;
+	inode->i_mtime = parent->i_mtime;
+	inode->i_ctime = parent->i_ctime;
+	inode->i_atime = parent->i_atime;
 	inode->i_op = &ceph_snapdir_iops;
 	inode->i_fop = &ceph_snapdir_fops;
 	ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */
 	ci->i_rbytes = 0;
+	ci->i_btime = ceph_inode(parent)->i_btime;
 
 	if (inode->i_state & I_NEW)
 		unlock_new_inode(inode);

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

* Re: [PATCH v2] ceph: fix snapshot directory timestamps
  2020-03-11 11:05 [PATCH v2] ceph: fix snapshot directory timestamps Luis Henriques
@ 2020-03-16 17:34 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2020-03-16 17:34 UTC (permalink / raw)
  To: Luis Henriques, Sage Weil, Ilya Dryomov
  Cc: Marc Roos, ceph-devel, linux-kernel

On Wed, 2020-03-11 at 11:05 +0000, Luis Henriques wrote:
> The .snap directory timestamps are kept at 0 (1970-01-01 00:00), which
> isn't consistent with what the fuse client does.  This patch makes the
> behaviour consistent, by setting these timestamps (atime, btime, ctime,
> mtime) to those of the parent directory.
> 
> Cc: Marc Roos <M.Roos@f1-outsourcing.eu>
> Signed-off-by: Luis Henriques <lhenriques@suse.com>
> ---
>  fs/ceph/inode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index d01710a16a4a..968d55ca898d 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -82,10 +82,14 @@ struct inode *ceph_get_snapdir(struct inode *parent)
>  	inode->i_mode = parent->i_mode;
>  	inode->i_uid = parent->i_uid;
>  	inode->i_gid = parent->i_gid;
> +	inode->i_mtime = parent->i_mtime;
> +	inode->i_ctime = parent->i_ctime;
> +	inode->i_atime = parent->i_atime;
>  	inode->i_op = &ceph_snapdir_iops;
>  	inode->i_fop = &ceph_snapdir_fops;
>  	ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */
>  	ci->i_rbytes = 0;
> +	ci->i_btime = ceph_inode(parent)->i_btime;
>  
>  	if (inode->i_state & I_NEW)
>  		unlock_new_inode(inode);

Merged into testing branch -- thanks for the patch!
-- 
Jeff Layton <jlayton@kernel.org>


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

end of thread, other threads:[~2020-03-16 17:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 11:05 [PATCH v2] ceph: fix snapshot directory timestamps Luis Henriques
2020-03-16 17:34 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).