All of lore.kernel.org
 help / color / mirror / Atom feed
* [bcachefs:bcachefs-testing 112/112] fs/bcachefs/io_write.c:1127:2: error: expected expression
@ 2024-11-12 10:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-12 10:08 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: llvm, oe-kbuild-all, Kent Overstreet

tree:   https://evilpiepirate.org/git/bcachefs.git bcachefs-testing
head:   bf89bd21105c3685314ed3a68f06167ba9f198fa
commit: e661d0e153cca3184d0914da1866ef8e9c75af29 [112/112] bcachefs: bch2_inum_to_path()
config: arm-randconfig-003-20241112 (https://download.01.org/0day-ci/archive/20241112/202411121809.xSrI6EYd-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241112/202411121809.xSrI6EYd-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/202411121809.xSrI6EYd-lkp@intel.com/

All errors (new ones prefixed by >>):

>> fs/bcachefs/io_write.c:1127:2: error: expected expression
           struct printbuf buf = PRINTBUF;
           ^
>> fs/bcachefs/io_write.c:1128:23: error: use of undeclared identifier 'buf'
           bch2_write_op_error(&buf, op);
                                ^
   fs/bcachefs/io_write.c:1129:14: error: use of undeclared identifier 'buf'
           prt_printf(&buf, "error verifying existing checksum while rewriting existing data (memory corruption?)");
                       ^
   fs/bcachefs/io_write.c:1130:31: error: use of undeclared identifier 'buf'
           bch_err_ratelimited(c, "%s", buf.buf);
                                        ^
   fs/bcachefs/io_write.c:1131:17: error: use of undeclared identifier 'buf'
           printbuf_exit(&buf);
                          ^
   5 errors generated.


vim +1127 fs/bcachefs/io_write.c

   936	
   937	static int bch2_write_extent(struct bch_write_op *op, struct write_point *wp,
   938				     struct bio **_dst)
   939	{
   940		struct bch_fs *c = op->c;
   941		struct bio *src = &op->wbio.bio, *dst = src;
   942		struct bvec_iter saved_iter;
   943		void *ec_buf;
   944		unsigned total_output = 0, total_input = 0;
   945		bool bounce = false;
   946		bool page_alloc_failed = false;
   947		int ret, more = 0;
   948	
   949		BUG_ON(!bio_sectors(src));
   950	
   951		ec_buf = bch2_writepoint_ec_buf(c, wp);
   952	
   953		switch (bch2_write_prep_encoded_data(op, wp)) {
   954		case PREP_ENCODED_OK:
   955			break;
   956		case PREP_ENCODED_ERR:
   957			ret = -EIO;
   958			goto err;
   959		case PREP_ENCODED_CHECKSUM_ERR:
   960			goto csum_err;
   961		case PREP_ENCODED_DO_WRITE:
   962			/* XXX look for bug here */
   963			if (ec_buf) {
   964				dst = bch2_write_bio_alloc(c, wp, src,
   965							   &page_alloc_failed,
   966							   ec_buf);
   967				bio_copy_data(dst, src);
   968				bounce = true;
   969			}
   970			init_append_extent(op, wp, op->version, op->crc);
   971			goto do_write;
   972		}
   973	
   974		if (ec_buf ||
   975		    op->compression_opt ||
   976		    (op->csum_type &&
   977		     !(op->flags & BCH_WRITE_PAGES_STABLE)) ||
   978		    (bch2_csum_type_is_encryption(op->csum_type) &&
   979		     !(op->flags & BCH_WRITE_PAGES_OWNED))) {
   980			dst = bch2_write_bio_alloc(c, wp, src,
   981						   &page_alloc_failed,
   982						   ec_buf);
   983			bounce = true;
   984		}
   985	
   986		saved_iter = dst->bi_iter;
   987	
   988		do {
   989			struct bch_extent_crc_unpacked crc = { 0 };
   990			struct bversion version = op->version;
   991			size_t dst_len = 0, src_len = 0;
   992	
   993			if (page_alloc_failed &&
   994			    dst->bi_iter.bi_size  < (wp->sectors_free << 9) &&
   995			    dst->bi_iter.bi_size < c->opts.encoded_extent_max)
   996				break;
   997	
   998			BUG_ON(op->compression_opt &&
   999			       (op->flags & BCH_WRITE_DATA_ENCODED) &&
  1000			       bch2_csum_type_is_encryption(op->crc.csum_type));
  1001			BUG_ON(op->compression_opt && !bounce);
  1002	
  1003			crc.compression_type = op->incompressible
  1004				? BCH_COMPRESSION_TYPE_incompressible
  1005				: op->compression_opt
  1006				? bch2_bio_compress(c, dst, &dst_len, src, &src_len,
  1007						    op->compression_opt)
  1008				: 0;
  1009			if (!crc_is_compressed(crc)) {
  1010				dst_len = min(dst->bi_iter.bi_size, src->bi_iter.bi_size);
  1011				dst_len = min_t(unsigned, dst_len, wp->sectors_free << 9);
  1012	
  1013				if (op->csum_type)
  1014					dst_len = min_t(unsigned, dst_len,
  1015							c->opts.encoded_extent_max);
  1016	
  1017				if (bounce) {
  1018					swap(dst->bi_iter.bi_size, dst_len);
  1019					bio_copy_data(dst, src);
  1020					swap(dst->bi_iter.bi_size, dst_len);
  1021				}
  1022	
  1023				src_len = dst_len;
  1024			}
  1025	
  1026			BUG_ON(!src_len || !dst_len);
  1027	
  1028			if (bch2_csum_type_is_encryption(op->csum_type)) {
  1029				if (bversion_zero(version)) {
  1030					version.lo = atomic64_inc_return(&c->key_version);
  1031				} else {
  1032					crc.nonce = op->nonce;
  1033					op->nonce += src_len >> 9;
  1034				}
  1035			}
  1036	
  1037			if ((op->flags & BCH_WRITE_DATA_ENCODED) &&
  1038			    !crc_is_compressed(crc) &&
  1039			    bch2_csum_type_is_encryption(op->crc.csum_type) ==
  1040			    bch2_csum_type_is_encryption(op->csum_type)) {
  1041				u8 compression_type = crc.compression_type;
  1042				u16 nonce = crc.nonce;
  1043				/*
  1044				 * Note: when we're using rechecksum(), we need to be
  1045				 * checksumming @src because it has all the data our
  1046				 * existing checksum covers - if we bounced (because we
  1047				 * were trying to compress), @dst will only have the
  1048				 * part of the data the new checksum will cover.
  1049				 *
  1050				 * But normally we want to be checksumming post bounce,
  1051				 * because part of the reason for bouncing is so the
  1052				 * data can't be modified (by userspace) while it's in
  1053				 * flight.
  1054				 */
  1055				if (bch2_rechecksum_bio(c, src, version, op->crc,
  1056						&crc, &op->crc,
  1057						src_len >> 9,
  1058						bio_sectors(src) - (src_len >> 9),
  1059						op->csum_type))
  1060					goto csum_err;
  1061				/*
  1062				 * rchecksum_bio sets compression_type on crc from op->crc,
  1063				 * this isn't always correct as sometimes we're changing
  1064				 * an extent from uncompressed to incompressible.
  1065				 */
  1066				crc.compression_type = compression_type;
  1067				crc.nonce = nonce;
  1068			} else {
  1069				if ((op->flags & BCH_WRITE_DATA_ENCODED) &&
  1070				    bch2_rechecksum_bio(c, src, version, op->crc,
  1071						NULL, &op->crc,
  1072						src_len >> 9,
  1073						bio_sectors(src) - (src_len >> 9),
  1074						op->crc.csum_type))
  1075					goto csum_err;
  1076	
  1077				crc.compressed_size	= dst_len >> 9;
  1078				crc.uncompressed_size	= src_len >> 9;
  1079				crc.live_size		= src_len >> 9;
  1080	
  1081				swap(dst->bi_iter.bi_size, dst_len);
  1082				ret = bch2_encrypt_bio(c, op->csum_type,
  1083						       extent_nonce(version, crc), dst);
  1084				if (ret)
  1085					goto err;
  1086	
  1087				crc.csum = bch2_checksum_bio(c, op->csum_type,
  1088						 extent_nonce(version, crc), dst);
  1089				crc.csum_type = op->csum_type;
  1090				swap(dst->bi_iter.bi_size, dst_len);
  1091			}
  1092	
  1093			init_append_extent(op, wp, version, crc);
  1094	
  1095			if (dst != src)
  1096				bio_advance(dst, dst_len);
  1097			bio_advance(src, src_len);
  1098			total_output	+= dst_len;
  1099			total_input	+= src_len;
  1100		} while (dst->bi_iter.bi_size &&
  1101			 src->bi_iter.bi_size &&
  1102			 wp->sectors_free &&
  1103			 !bch2_keylist_realloc(&op->insert_keys,
  1104					      op->inline_keys,
  1105					      ARRAY_SIZE(op->inline_keys),
  1106					      BKEY_EXTENT_U64s_MAX));
  1107	
  1108		more = src->bi_iter.bi_size != 0;
  1109	
  1110		dst->bi_iter = saved_iter;
  1111	
  1112		if (dst == src && more) {
  1113			BUG_ON(total_output != total_input);
  1114	
  1115			dst = bio_split(src, total_input >> 9,
  1116					GFP_NOFS, &c->bio_write);
  1117			wbio_init(dst)->put_bio	= true;
  1118			/* copy WRITE_SYNC flag */
  1119			dst->bi_opf		= src->bi_opf;
  1120		}
  1121	
  1122		dst->bi_iter.bi_size = total_output;
  1123	do_write:
  1124		*_dst = dst;
  1125		return more;
  1126	csum_err:
> 1127		struct printbuf buf = PRINTBUF;
> 1128		bch2_write_op_error(&buf, op);
  1129		prt_printf(&buf, "error verifying existing checksum while rewriting existing data (memory corruption?)");
  1130		bch_err_ratelimited(c, "%s", buf.buf);
  1131		printbuf_exit(&buf);
  1132	
  1133		ret = -EIO;
  1134	err:
  1135		if (to_wbio(dst)->bounce)
  1136			bch2_bio_free_pages_pool(c, dst);
  1137		if (to_wbio(dst)->put_bio)
  1138			bio_put(dst);
  1139	
  1140		return ret;
  1141	}
  1142	

-- 
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:[~2024-11-12 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 10:08 [bcachefs:bcachefs-testing 112/112] fs/bcachefs/io_write.c:1127:2: error: expected expression 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.