Skip to contentSkip to conversation

ceph: correct superblock flags

PATCH In review Yangtao Li 2 participants 2 messages May 30, 2025 Ceph client

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 ceph: correct superblock flags

SB_NOATIME includes SB_NODIRATIME as a subset. Therefore, setting SB_NOATIME is sufficient to disable atime updates for all files and directories.

---
 fs/ceph/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/super.c +1 -1
index f3951253e393..7c9e4987adf4 100644
@@ -1226,7 +1226,7 @@ static int ceph_set_super(struct super_block *s, struct fs_context *fc)
 	s->s_time_gran = 1;
 	s->s_time_min = 0;
 	s->s_time_max = U32_MAX;
-	s->s_flags |= SB_NODIRATIME | SB_NOATIME;
+	s->s_flags |= SB_NOATIME;
 
 	ceph_fscrypt_set_ops(s);
 
Signature · 1 line
2.48.1
#1 lore raw
Quoted 14 lines · Yangtao Li

SB_NOATIME includes SB_NODIRATIME as a subset. Therefore, setting SB_NOATIME is sufficient to disable atime updates for all files and directories.

---
 fs/ceph/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/super.c +0 -0
index f3951253e393..7c9e4987adf4 100644

fs/ceph/super.c static int ceph_set_super(struct super_block *s, struct fs_context *fc) · line 1232

Quoted 8 lines
fs/ceph/super.c +1 -1
@@ -1226,7 +1226,7 @@ static int ceph_set_super(struct super_block *s, struct fs_context *fc)
 	s->s_time_gran = 1;
 	s->s_time_min = 0;
 	s->s_time_max = U32_MAX;
-	s->s_flags |= SB_NODIRATIME | SB_NOATIME;
+	s->s_flags |= SB_NOATIME;
 
 	ceph_fscrypt_set_ops(s);
 

This modification doesn't make sense to me. And I prefer to be more conservative here. Moreover, from my point of view, SB_NODIRATIME flag is associated with nodiratime mount option and SB_NOATIME is associated with noatime mount option. By setting these flags, we instruct how file system needs to behave for the case of nodiratime and noatime mounts. So, semantically, this modification sounds wrong to me. I don't think that we need to accept this modification, otherwise, something could be broken.

Thanks,
Slava.