From bc5219d278908550c03e8df307d1524764779432 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Wed, 6 Sep 2023 15:25:19 -0600 Subject: [PATCH] LU-13798 llite: fix LL_SBI_FLAGS array again Errors are still being printed by ll_sbi_flags_seq_show(): exa6: Revise array LL_SBI_FLAGS to match sbi flags please. This is because LL_SBI_PARALLEL_DIO is a negative int so downshift does not clear the high bits. Make ll_flags unsigned to avoid this. Move the LL_SBI_SNAPSHOT flag out of the way of other flags. This is in-memory only, so it doesn't matter what value is used. Test-Parameters: trivial Fixes: 00152903a180 ("LU-13798 llite: parallelize direct i/o issuance") Signed-off-by: Andreas Dilger Change-Id: I4b695da74a94d5f204804aa5ab16f83688f7a7f0 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/52299 --- lustre/llite/llite_internal.h | 13 ++++++++----- lustre/llite/llite_lib.c | 7 ++++--- lustre/llite/lproc_llite.c | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index e22d0ff..20eb4be 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -749,6 +749,7 @@ enum stats_track_type { #define LL_SBI_LRU_RESIZE 0x400 /* lru resize support */ #define LL_SBI_LAZYSTATFS 0x800 /* lazystatfs mount option */ /* LL_SBI_SOM_PREVIEW 0x1000 SOM preview mount option, obsolete */ +#define LL_SBI_SNAPSHOT 0x1000 /* snapshot mount */ #define LL_SBI_32BIT_API 0x2000 /* generate 32 bit inodes. */ #define LL_SBI_64BIT_HASH 0x4000 /* support 64-bits dir hash/offset */ #define LL_SBI_AGL_ENABLED 0x8000 /* enable agl */ @@ -767,6 +768,8 @@ enum stats_track_type { #define LL_SBI_FILE_HEAT 0x4000000 /* file heat support */ #define LL_SBI_TEST_DUMMY_ENCRYPTION 0x8000000 /* test dummy encryption */ #define LL_SBI_ENCRYPT 0x10000000 /* client side encryption */ +/*#define LL_SBI_FOREIGN_SYMLINK 0x20000000 * foreign fake-symlink support */ +/*#define LL_SBI_FOREIGN_UPCALL 0x40000000 * fake-symlink upcall registered */ #define LL_SBI_PARALLEL_DIO 0x80000000 /* parallel (async) submission of RPCs for DIO */ #define LL_SBI_FLAGS { \ @@ -779,10 +782,10 @@ enum stats_track_type { "name_encrypt", \ "mds_capa", \ "oss_capa", \ - "flock", \ + "localflock", \ "lru_resize", \ "lazy_statfs", \ - "som", \ + "snapshot", \ "32bit_api", \ "64bit_hash", \ "agl", \ @@ -799,8 +802,8 @@ enum stats_track_type { "file_heat", \ "test_dummy_encryption", \ "noencrypt", \ - "snapshot", \ - "???", \ + "foreign_symlink", \ + "foreign_symlink_upcall", \ "parallel_dio", \ } @@ -832,7 +835,7 @@ struct ll_sb_info { struct dentry *ll_debugfs_entry; struct lu_fid ll_root_fid; /* root object fid */ - int ll_flags; + unsigned int ll_flags; unsigned int ll_xattr_cache_enabled:1, ll_xattr_cache_set:1, /* already set to 0/1 */ ll_client_common_fill_super_succeeded:1, diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 6421abe..5832c9e 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -916,7 +916,8 @@ void ll_kill_super(struct super_block *sb) EXIT; } -static inline int ll_set_opt(const char *opt, char *data, int fl) +static inline unsigned long ll_set_opt(const char *opt, char *data, + unsigned int fl) { if (strncmp(opt, data, strlen(opt)) != 0) return 0; @@ -927,9 +928,9 @@ static inline int ll_set_opt(const char *opt, char *data, int fl) /* non-client-specific mount options are parsed in lmd_parse */ static int ll_options(char *options, struct ll_sb_info *sbi) { - int tmp; + unsigned int tmp; char *s1 = options, *s2; - int *flags = &sbi->ll_flags; + unsigned int *flags = &sbi->ll_flags; ENTRY; if (!options) diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index eeee6f9..7f57967 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -1236,8 +1236,8 @@ static int ll_sbi_flags_seq_show(struct seq_file *m, void *v) { const char *str[] = LL_SBI_FLAGS; struct super_block *sb = m->private; - int flags = ll_s2sbi(sb)->ll_flags; - int i = 0; + unsigned int flags = ll_s2sbi(sb)->ll_flags; + unsigned int i = 0; while (flags != 0) { if (ARRAY_SIZE(str) <= i) { -- 1.8.3.1