linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] ceph: initialize superblock s_time_gran to 1
@ 2019-06-27 13:51 Luis Henriques
  2019-06-27 14:41 ` Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Luis Henriques @ 2019-06-27 13:51 UTC (permalink / raw)
  To: Jeff Layton, Yan, Zheng, Sage Weil, Ilya Dryomov
  Cc: ceph-devel, linux-kernel, Luis Henriques

Having granularity set to 1us results in having inode timestamps with a
accurancy different from the fuse client (i.e. atime, ctime and mtime will
always end with '000').  This patch normalizes this behaviour and sets the
granularity to 1.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
---
 fs/ceph/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi!

As far as I could see there are no other side-effects of changing
s_time_gran but I'm really not sure why it was initially set to 1000 in
the first place so I may be missing something.

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index d57fa60dcd43..35dd75bc9cd0 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -980,7 +980,7 @@ static int ceph_set_super(struct super_block *s, void *data)
 	s->s_d_op = &ceph_dentry_ops;
 	s->s_export_op = &ceph_export_ops;
 
-	s->s_time_gran = 1000;  /* 1000 ns == 1 us */
+	s->s_time_gran = 1;
 
 	ret = set_anon_super(s, NULL);  /* what is that second arg for? */
 	if (ret != 0)

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

* Re: [RFC PATCH] ceph: initialize superblock s_time_gran to 1
  2019-06-27 13:51 [RFC PATCH] ceph: initialize superblock s_time_gran to 1 Luis Henriques
@ 2019-06-27 14:41 ` Jeff Layton
  2019-06-27 15:44   ` Sage Weil
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2019-06-27 14:41 UTC (permalink / raw)
  To: Luis Henriques, Yan, Zheng, Sage Weil, Ilya Dryomov
  Cc: ceph-devel, linux-kernel

On Thu, 2019-06-27 at 14:51 +0100, Luis Henriques wrote:
> Having granularity set to 1us results in having inode timestamps with a
> accurancy different from the fuse client (i.e. atime, ctime and mtime will
> always end with '000').  This patch normalizes this behaviour and sets the
> granularity to 1.
> 
> Signed-off-by: Luis Henriques <lhenriques@suse.com>
> ---
>  fs/ceph/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Hi!
> 
> As far as I could see there are no other side-effects of changing
> s_time_gran but I'm really not sure why it was initially set to 1000 in
> the first place so I may be missing something.
> 
> diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> index d57fa60dcd43..35dd75bc9cd0 100644
> --- a/fs/ceph/super.c
> +++ b/fs/ceph/super.c
> @@ -980,7 +980,7 @@ static int ceph_set_super(struct super_block *s, void *data)
>  	s->s_d_op = &ceph_dentry_ops;
>  	s->s_export_op = &ceph_export_ops;
>  
> -	s->s_time_gran = 1000;  /* 1000 ns == 1 us */
> +	s->s_time_gran = 1;
>  
>  	ret = set_anon_super(s, NULL);  /* what is that second arg for? */
>  	if (ret != 0)


Looks like it was set that way since the client code was originally
merged. Was this an earlier limitation of ceph that is no longer
applicable?

In any case, I see no need at all to keep this at 1000, so:

Reviewed-by: Jeff Layton <jlayton@kernel.org>


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

* Re: [RFC PATCH] ceph: initialize superblock s_time_gran to 1
  2019-06-27 14:41 ` Jeff Layton
@ 2019-06-27 15:44   ` Sage Weil
  2019-06-27 16:10     ` Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Sage Weil @ 2019-06-27 15:44 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Luis Henriques, Yan, Zheng, Ilya Dryomov, ceph-devel, linux-kernel

On Thu, 27 Jun 2019, Jeff Layton wrote:
> On Thu, 2019-06-27 at 14:51 +0100, Luis Henriques wrote:
> > Having granularity set to 1us results in having inode timestamps with a
> > accurancy different from the fuse client (i.e. atime, ctime and mtime will
> > always end with '000').  This patch normalizes this behaviour and sets the
> > granularity to 1.
> > 
> > Signed-off-by: Luis Henriques <lhenriques@suse.com>
> > ---
> >  fs/ceph/super.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Hi!
> > 
> > As far as I could see there are no other side-effects of changing
> > s_time_gran but I'm really not sure why it was initially set to 1000 in
> > the first place so I may be missing something.
> > 
> > diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> > index d57fa60dcd43..35dd75bc9cd0 100644
> > --- a/fs/ceph/super.c
> > +++ b/fs/ceph/super.c
> > @@ -980,7 +980,7 @@ static int ceph_set_super(struct super_block *s, void *data)
> >  	s->s_d_op = &ceph_dentry_ops;
> >  	s->s_export_op = &ceph_export_ops;
> >  
> > -	s->s_time_gran = 1000;  /* 1000 ns == 1 us */
> > +	s->s_time_gran = 1;
> >  
> >  	ret = set_anon_super(s, NULL);  /* what is that second arg for? */
> >  	if (ret != 0)
> 
> 
> Looks like it was set that way since the client code was originally
> merged. Was this an earlier limitation of ceph that is no longer
> applicable?
> 
> In any case, I see no need at all to keep this at 1000, so:

As long as the encoded on-write time value is at ns resolution, I 
agree!  No recollection of why I did this :(

Reviewed-by: Sage Weil <sage@redhat.com>

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

* Re: [RFC PATCH] ceph: initialize superblock s_time_gran to 1
  2019-06-27 15:44   ` Sage Weil
@ 2019-06-27 16:10     ` Jeff Layton
  2019-06-28  9:30       ` Luis Henriques
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Layton @ 2019-06-27 16:10 UTC (permalink / raw)
  To: Sage Weil
  Cc: Luis Henriques, Yan, Zheng, Ilya Dryomov, ceph-devel, linux-kernel

On Thu, 2019-06-27 at 15:44 +0000, Sage Weil wrote:
> On Thu, 27 Jun 2019, Jeff Layton wrote:
> > On Thu, 2019-06-27 at 14:51 +0100, Luis Henriques wrote:
> > > Having granularity set to 1us results in having inode timestamps with a
> > > accurancy different from the fuse client (i.e. atime, ctime and mtime will
> > > always end with '000').  This patch normalizes this behaviour and sets the
> > > granularity to 1.
> > > 
> > > Signed-off-by: Luis Henriques <lhenriques@suse.com>
> > > ---
> > >  fs/ceph/super.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > Hi!
> > > 
> > > As far as I could see there are no other side-effects of changing
> > > s_time_gran but I'm really not sure why it was initially set to 1000 in
> > > the first place so I may be missing something.
> > > 
> > > diff --git a/fs/ceph/super.c b/fs/ceph/super.c
> > > index d57fa60dcd43..35dd75bc9cd0 100644
> > > --- a/fs/ceph/super.c
> > > +++ b/fs/ceph/super.c
> > > @@ -980,7 +980,7 @@ static int ceph_set_super(struct super_block *s, void *data)
> > >     s->s_d_op = &ceph_dentry_ops;
> > >     s->s_export_op = &ceph_export_ops;
> > >  
> > > -   s->s_time_gran = 1000;  /* 1000 ns == 1 us */
> > > +   s->s_time_gran = 1;
> > >  
> > >     ret = set_anon_super(s, NULL);  /* what is that second arg for? */
> > >     if (ret != 0)
> > 
> > 
> > Looks like it was set that way since the client code was originally
> > merged. Was this an earlier limitation of ceph that is no longer
> > applicable?
> > 
> > In any case, I see no need at all to keep this at 1000, so:
> 
> As long as the encoded on-write time value is at ns resolution, I 
> agree!  No recollection of why I did this :(
> 
> Reviewed-by: Sage Weil <sage@redhat.com>

Good enough for me. I went ahead and merged this into the testing
branch. Assuming nothing breaks, this should make v5.3.

Thanks,
-- 
Jeff Layton <jlayton@kernel.org>


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

* Re: [RFC PATCH] ceph: initialize superblock s_time_gran to 1
  2019-06-27 16:10     ` Jeff Layton
@ 2019-06-28  9:30       ` Luis Henriques
  0 siblings, 0 replies; 5+ messages in thread
From: Luis Henriques @ 2019-06-28  9:30 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Sage Weil, Yan, Zheng, Ilya Dryomov, ceph-devel, linux-kernel

Jeff Layton <jlayton@kernel.org> writes:

> On Thu, 2019-06-27 at 15:44 +0000, Sage Weil wrote:
>> On Thu, 27 Jun 2019, Jeff Layton wrote:
>> > On Thu, 2019-06-27 at 14:51 +0100, Luis Henriques wrote:
>> > > Having granularity set to 1us results in having inode timestamps with a
>> > > accurancy different from the fuse client (i.e. atime, ctime and mtime will
>> > > always end with '000').  This patch normalizes this behaviour and sets the
>> > > granularity to 1.
>> > > 
>> > > Signed-off-by: Luis Henriques <lhenriques@suse.com>
>> > > ---
>> > >  fs/ceph/super.c | 2 +-
>> > >  1 file changed, 1 insertion(+), 1 deletion(-)
>> > > 
>> > > Hi!
>> > > 
>> > > As far as I could see there are no other side-effects of changing
>> > > s_time_gran but I'm really not sure why it was initially set to 1000 in
>> > > the first place so I may be missing something.
>> > > 
>> > > diff --git a/fs/ceph/super.c b/fs/ceph/super.c
>> > > index d57fa60dcd43..35dd75bc9cd0 100644
>> > > --- a/fs/ceph/super.c
>> > > +++ b/fs/ceph/super.c
>> > > @@ -980,7 +980,7 @@ static int ceph_set_super(struct super_block *s, void *data)
>> > >     s->s_d_op = &ceph_dentry_ops;
>> > >     s->s_export_op = &ceph_export_ops;
>> > >  
>> > > -   s->s_time_gran = 1000;  /* 1000 ns == 1 us */
>> > > +   s->s_time_gran = 1;
>> > >  
>> > >     ret = set_anon_super(s, NULL);  /* what is that second arg for? */
>> > >     if (ret != 0)
>> > 
>> > 
>> > Looks like it was set that way since the client code was originally
>> > merged. Was this an earlier limitation of ceph that is no longer
>> > applicable?
>> > 
>> > In any case, I see no need at all to keep this at 1000, so:
>> 
>> As long as the encoded on-write time value is at ns resolution, I 
>> agree!  No recollection of why I did this :(
>> 
>> Reviewed-by: Sage Weil <sage@redhat.com>
>
> Good enough for me. I went ahead and merged this into the testing
> branch. Assuming nothing breaks, this should make v5.3.

Awesome, thanks.  AFAICS it shouldn't break anything, specially because
the fuse client seems to be using ns resolution too.  But yeah
unexpected side-effects show up in unexpected ways :-)

Cheers,
-- 
Luis

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

end of thread, other threads:[~2019-06-28  9:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27 13:51 [RFC PATCH] ceph: initialize superblock s_time_gran to 1 Luis Henriques
2019-06-27 14:41 ` Jeff Layton
2019-06-27 15:44   ` Sage Weil
2019-06-27 16:10     ` Jeff Layton
2019-06-28  9:30       ` Luis Henriques

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).