Skip to contentSkip to conversation

ceph: initialize superblock s_time_gran to 1

RFC PATCH In review Luis Henriques 3 participants 5 messages Jun 27, 2019 – Jun 28, 2019 Ceph client

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ceph: initialize superblock s_time_gran to 1

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.

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

fs/ceph/super.c +1 -1
index d57fa60dcd43..35dd75bc9cd0 100644
@@ -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)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines · 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.

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

fs/ceph/super.c +0 -0
index d57fa60dcd43..35dd75bc9cd0 100644

fs/ceph/super.c static int ceph_set_super(struct super_block *s, void *data) · line 986

Quoted 8 lines
fs/ceph/super.c +1 -1
@@ -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
#2 lore raw
Quoted 36 lines · Jeff Layton
Quoted 21 lines · 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.

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

fs/ceph/super.c +0 -0
index d57fa60dcd43..35dd75bc9cd0 100644

fs/ceph/super.c static int ceph_set_super(struct super_block *s, void *data) · line 986

Quoted 8 lines
fs/ceph/super.c +1 -1
@@ -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?

Quoted 1 line

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 :(

#3 lore raw
Quoted 37 lines · Sage Weil
Quoted 36 lines · Jeff Layton
Quoted 21 lines · 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.

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

fs/ceph/super.c +0 -0
index d57fa60dcd43..35dd75bc9cd0 100644

fs/ceph/super.c static int ceph_set_super(struct super_block *s, void *data) · line 986

Quoted 8 lines
fs/ceph/super.c +1 -1
@@ -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?

Quoted 6 lines
Quoted 1 line

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 :(

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

Thanks,

Signature · 1 line
Jeff Layton <[email protected]>
#4 lore raw
Quoted 40 lines · Jeff Layton
Quoted 39 lines · Sage Weil
Quoted 37 lines · Jeff Layton
Quoted 21 lines · 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.

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

fs/ceph/super.c +0 -0
index d57fa60dcd43..35dd75bc9cd0 100644

fs/ceph/super.c static int ceph_set_super(struct super_block *s, void *data) · line 986

Quoted 8 lines
fs/ceph/super.c +1 -1
@@ -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:

Quoted 7 lines
Quoted 4 lines

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

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,

Signature · 1 line
Luis