* fs/bcachefs/super.c:954:25: warning: result of comparison of constant 65536 with expression of type 'u16' (aka 'unsigned short') is always false
@ 2025-05-31 16:37 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-31 16:37 UTC (permalink / raw)
To: Kent Overstreet; +Cc: llvm, oe-kbuild-all, linux-kernel
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0f70f5b08a47a3bc1a252e5f451a137cde7c98ce
commit: 9caea9208fc3fbdbd4a41a2de8c6a0c969b030f9 bcachefs: Don't mount bs > ps without TRANSPARENT_HUGEPAGE
date: 8 days ago
config: hexagon-randconfig-2004-20250531 (https://download.01.org/0day-ci/archive/20250601/202506010012.GabD1fud-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250601/202506010012.GabD1fud-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506010012.GabD1fud-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/bcachefs/super.c:954:25: warning: result of comparison of constant 65536 with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
954 | c->opts.block_size > PAGE_SIZE) {
| ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
1 warning generated.
vim +954 fs/bcachefs/super.c
837
838 static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts *opts,
839 bch_sb_handles *sbs)
840 {
841 struct bch_fs *c;
842 struct printbuf name = PRINTBUF;
843 unsigned i, iter_size;
844 int ret = 0;
845
846 c = kvmalloc(sizeof(struct bch_fs), GFP_KERNEL|__GFP_ZERO);
847 if (!c) {
848 c = ERR_PTR(-BCH_ERR_ENOMEM_fs_alloc);
849 goto out;
850 }
851
852 c->stdio = (void *)(unsigned long) opts->stdio;
853
854 __module_get(THIS_MODULE);
855
856 closure_init(&c->cl, NULL);
857
858 c->kobj.kset = bcachefs_kset;
859 kobject_init(&c->kobj, &bch2_fs_ktype);
860 kobject_init(&c->internal, &bch2_fs_internal_ktype);
861 kobject_init(&c->opts_dir, &bch2_fs_opts_dir_ktype);
862 kobject_init(&c->time_stats, &bch2_fs_time_stats_ktype);
863 kobject_init(&c->counters_kobj, &bch2_fs_counters_ktype);
864
865 c->minor = -1;
866 c->disk_sb.fs_sb = true;
867
868 init_rwsem(&c->state_lock);
869 mutex_init(&c->sb_lock);
870 mutex_init(&c->replicas_gc_lock);
871 mutex_init(&c->btree_root_lock);
872 INIT_WORK(&c->read_only_work, bch2_fs_read_only_work);
873
874 refcount_set(&c->ro_ref, 1);
875 init_waitqueue_head(&c->ro_ref_wait);
876
877 for (i = 0; i < BCH_TIME_STAT_NR; i++)
878 bch2_time_stats_init(&c->times[i]);
879
880 bch2_fs_allocator_background_init(c);
881 bch2_fs_allocator_foreground_init(c);
882 bch2_fs_btree_cache_init_early(&c->btree_cache);
883 bch2_fs_btree_gc_init_early(c);
884 bch2_fs_btree_interior_update_init_early(c);
885 bch2_fs_btree_iter_init_early(c);
886 bch2_fs_btree_key_cache_init_early(&c->btree_key_cache);
887 bch2_fs_btree_write_buffer_init_early(c);
888 bch2_fs_copygc_init(c);
889 bch2_fs_ec_init_early(c);
890 bch2_fs_journal_init_early(&c->journal);
891 bch2_fs_journal_keys_init(c);
892 bch2_fs_move_init(c);
893 bch2_fs_nocow_locking_init_early(c);
894 bch2_fs_quota_init(c);
895 bch2_fs_recovery_passes_init(c);
896 bch2_fs_sb_errors_init_early(c);
897 bch2_fs_snapshots_init_early(c);
898 bch2_fs_subvolumes_init_early(c);
899
900 INIT_LIST_HEAD(&c->list);
901
902 mutex_init(&c->bio_bounce_pages_lock);
903 mutex_init(&c->snapshot_table_lock);
904 init_rwsem(&c->snapshot_create_lock);
905
906 spin_lock_init(&c->btree_write_error_lock);
907
908 INIT_LIST_HEAD(&c->journal_iters);
909
910 INIT_LIST_HEAD(&c->fsck_error_msgs);
911 mutex_init(&c->fsck_error_msgs_lock);
912
913 seqcount_init(&c->usage_lock);
914
915 sema_init(&c->io_in_flight, 128);
916
917 INIT_LIST_HEAD(&c->vfs_inodes_list);
918 mutex_init(&c->vfs_inodes_lock);
919
920 c->journal.flush_write_time = &c->times[BCH_TIME_journal_flush_write];
921 c->journal.noflush_write_time = &c->times[BCH_TIME_journal_noflush_write];
922 c->journal.flush_seq_time = &c->times[BCH_TIME_journal_flush_seq];
923
924 mutex_init(&c->sectors_available_lock);
925
926 ret = percpu_init_rwsem(&c->mark_lock);
927 if (ret)
928 goto err;
929
930 mutex_lock(&c->sb_lock);
931 ret = bch2_sb_to_fs(c, sb);
932 mutex_unlock(&c->sb_lock);
933
934 if (ret)
935 goto err;
936
937 /* Compat: */
938 if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_inode_v2 &&
939 !BCH_SB_JOURNAL_FLUSH_DELAY(sb))
940 SET_BCH_SB_JOURNAL_FLUSH_DELAY(sb, 1000);
941
942 if (le16_to_cpu(sb->version) <= bcachefs_metadata_version_inode_v2 &&
943 !BCH_SB_JOURNAL_RECLAIM_DELAY(sb))
944 SET_BCH_SB_JOURNAL_RECLAIM_DELAY(sb, 100);
945
946 c->opts = bch2_opts_default;
947 ret = bch2_opts_from_sb(&c->opts, sb);
948 if (ret)
949 goto err;
950
951 bch2_opts_apply(&c->opts, *opts);
952
953 if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) &&
> 954 c->opts.block_size > PAGE_SIZE) {
955 bch_err(c, "cannot mount bs > ps filesystem without CONFIG_TRANSPARENT_HUGEPAGE");
956 ret = -EINVAL;
957 goto err;
958 }
959
960 c->btree_key_cache_btrees |= 1U << BTREE_ID_alloc;
961 if (c->opts.inodes_use_key_cache)
962 c->btree_key_cache_btrees |= 1U << BTREE_ID_inodes;
963 c->btree_key_cache_btrees |= 1U << BTREE_ID_logged_ops;
964
965 c->block_bits = ilog2(block_sectors(c));
966 c->btree_foreground_merge_threshold = BTREE_FOREGROUND_MERGE_THRESHOLD(c);
967
968 if (bch2_fs_init_fault("fs_alloc")) {
969 bch_err(c, "fs_alloc fault injected");
970 ret = -EFAULT;
971 goto err;
972 }
973
974 if (c->sb.multi_device)
975 pr_uuid(&name, c->sb.user_uuid.b);
976 else
977 prt_bdevname(&name, sbs->data[0].bdev);
978
979 ret = name.allocation_failure ? -BCH_ERR_ENOMEM_fs_name_alloc : 0;
980 if (ret)
981 goto err;
982
983 strscpy(c->name, name.buf, sizeof(c->name));
984 printbuf_exit(&name);
985
986 iter_size = sizeof(struct sort_iter) +
987 (btree_blocks(c) + 1) * 2 *
988 sizeof(struct sort_iter_set);
989
990 if (!(c->btree_read_complete_wq = alloc_workqueue("bcachefs_btree_read_complete",
991 WQ_HIGHPRI|WQ_FREEZABLE|WQ_MEM_RECLAIM, 512)) ||
992 enumerated_ref_init(&c->writes, BCH_WRITE_REF_NR,
993 bch2_writes_disabled) ||
994 mempool_init_kmalloc_pool(&c->fill_iter, 1, iter_size) ||
995 bioset_init(&c->btree_bio, 1,
996 max(offsetof(struct btree_read_bio, bio),
997 offsetof(struct btree_write_bio, wbio.bio)),
998 BIOSET_NEED_BVECS) ||
999 !(c->pcpu = alloc_percpu(struct bch_fs_pcpu)) ||
1000 !(c->usage = alloc_percpu(struct bch_fs_usage_base)) ||
1001 !(c->online_reserved = alloc_percpu(u64)) ||
1002 mempool_init_kvmalloc_pool(&c->btree_bounce_pool, 1,
1003 c->opts.btree_node_size) ||
1004 mempool_init_kmalloc_pool(&c->large_bkey_pool, 1, 2048)) {
1005 ret = -BCH_ERR_ENOMEM_fs_other_alloc;
1006 goto err;
1007 }
1008
1009 ret =
1010 bch2_fs_async_obj_init(c) ?:
1011 bch2_fs_btree_cache_init(c) ?:
1012 bch2_fs_btree_iter_init(c) ?:
1013 bch2_fs_btree_key_cache_init(&c->btree_key_cache) ?:
1014 bch2_fs_buckets_waiting_for_journal_init(c) ?:
1015 bch2_io_clock_init(&c->io_clock[READ]) ?:
1016 bch2_io_clock_init(&c->io_clock[WRITE]) ?:
1017 bch2_fs_compress_init(c) ?:
1018 bch2_fs_counters_init(c) ?:
1019 bch2_fs_ec_init(c) ?:
1020 bch2_fs_encryption_init(c) ?:
1021 bch2_fs_fsio_init(c) ?:
1022 bch2_fs_fs_io_direct_init(c) ?:
1023 bch2_fs_io_read_init(c) ?:
1024 bch2_fs_rebalance_init(c) ?:
1025 bch2_fs_sb_errors_init(c) ?:
1026 bch2_fs_vfs_init(c);
1027 if (ret)
1028 goto err;
1029
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-31 16:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-31 16:37 fs/bcachefs/super.c:954:25: warning: result of comparison of constant 65536 with expression of type 'u16' (aka 'unsigned short') is always false kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.