Re: [PATCH -next] ovl: obtain fs magic from superblock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2024/8/28 23:17, Amir Goldstein wrote:
On Wed, Aug 28, 2024 at 1:57 PM Hongbo Li <lihongbo22@xxxxxxxxxx> wrote:

The sb->s_magic holds the file system magic, we can use
this to avoid use file system magic macro directly.

That we can do something, does not mean that we need to do it.
I don't see any benefit in this patch.
Please explain.
Just avoid using the macro directly.

This kind of macro definition is like a magic number; once it changes, it will affect a large amount of code.

Thanks,
Hongbo


Thanks,
Amir.


Signed-off-by: Hongbo Li <lihongbo22@xxxxxxxxxx>
---
  fs/overlayfs/super.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 06a231970cb5..c809e845765f 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -256,7 +256,7 @@ static int ovl_statfs(struct dentry *dentry, struct kstatfs *buf)
         err = vfs_statfs(&path, buf);
         if (!err) {
                 buf->f_namelen = ofs->namelen;
-               buf->f_type = OVERLAYFS_SUPER_MAGIC;
+               buf->f_type = sb->s_magic;
                 if (ovl_has_fsid(ofs))
                         buf->f_fsid = uuid_to_fsid(sb->s_uuid.b);
         }
--
2.34.1





[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux