@@ -903,6 +903,8 @@ static int bch2_alloc_write_key(struct btree_trans *trans,
903903 bch2_dev_usage_update (c , ca , & old_gc , & gc , 0 , true);
904904 percpu_up_read (& c -> mark_lock );
905905
906+ gc .fragmentation_lru = alloc_lru_idx_fragmentation (gc , ca );
907+
906908 if (fsck_err_on (new .data_type != gc .data_type , c ,
907909 alloc_key_data_type_wrong ,
908910 "bucket %llu:%llu gen %u has wrong data_type"
@@ -916,23 +918,19 @@ static int bch2_alloc_write_key(struct btree_trans *trans,
916918#define copy_bucket_field (_errtype , _f ) \
917919 if (fsck_err_on(new._f != gc._f, c, _errtype, \
918920 "bucket %llu:%llu gen %u data type %s has wrong " #_f \
919- ": got %u , should be %u ", \
921+ ": got %llu , should be %llu ", \
920922 iter->pos.inode, iter->pos.offset, \
921923 gc.gen, \
922924 bch2_data_type_str(gc.data_type), \
923- new._f, gc._f)) \
925+ (u64) new._f, (u64) gc._f)) \
924926 new._f = gc._f; \
925927
926- copy_bucket_field (alloc_key_gen_wrong ,
927- gen );
928- copy_bucket_field (alloc_key_dirty_sectors_wrong ,
929- dirty_sectors );
930- copy_bucket_field (alloc_key_cached_sectors_wrong ,
931- cached_sectors );
932- copy_bucket_field (alloc_key_stripe_wrong ,
933- stripe );
934- copy_bucket_field (alloc_key_stripe_redundancy_wrong ,
935- stripe_redundancy );
928+ copy_bucket_field (alloc_key_gen_wrong , gen );
929+ copy_bucket_field (alloc_key_dirty_sectors_wrong , dirty_sectors );
930+ copy_bucket_field (alloc_key_cached_sectors_wrong , cached_sectors );
931+ copy_bucket_field (alloc_key_stripe_wrong , stripe );
932+ copy_bucket_field (alloc_key_stripe_redundancy_wrong , stripe_redundancy );
933+ copy_bucket_field (alloc_key_fragmentation_lru_wrong , fragmentation_lru );
936934#undef copy_bucket_field
937935
938936 if (!bch2_alloc_v4_cmp (* old , new ))
@@ -946,7 +944,7 @@ static int bch2_alloc_write_key(struct btree_trans *trans,
946944 a -> v = new ;
947945
948946 /*
949- * The trigger normally makes sure this is set, but we're not running
947+ * The trigger normally makes sure these are set, but we're not running
950948 * triggers:
951949 */
952950 if (a -> v .data_type == BCH_DATA_cached && !a -> v .io_time [READ ])
0 commit comments