mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: fs/bcachefs/super.c:1096:59-60: Unneeded semicolon
Date: Wed, 11 Sep 2024 16:59:44 +0800	[thread overview]
Message-ID: <202409111620.WGpinYej-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8d8d276ba2fb5f9ac4984f5c10ae60858090babc
commit: 0d529663f04be744d6af879889c5b16e46286ce1 bcachefs: Split brain detection
date:   8 months ago
config: loongarch-randconfig-r063-20240911 (https://download.01.org/0day-ci/archive/20240911/202409111620.WGpinYej-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.1.0

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/202409111620.WGpinYej-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/bcachefs/super.c:1096:59-60: Unneeded semicolon
   fs/bcachefs/super.c:1100:59-60: Unneeded semicolon

vim +1096 fs/bcachefs/super.c

  1065	
  1066	static int bch2_dev_in_fs(struct bch_sb_handle *fs,
  1067				  struct bch_sb_handle *sb)
  1068	{
  1069		if (fs == sb)
  1070			return 0;
  1071	
  1072		if (!uuid_equal(&fs->sb->uuid, &sb->sb->uuid))
  1073			return -BCH_ERR_device_not_a_member_of_filesystem;
  1074	
  1075		if (!bch2_dev_exists(fs->sb, sb->sb->dev_idx))
  1076			return -BCH_ERR_device_has_been_removed;
  1077	
  1078		if (fs->sb->block_size != sb->sb->block_size)
  1079			return -BCH_ERR_mismatched_block_size;
  1080	
  1081		if (le16_to_cpu(fs->sb->version) < bcachefs_metadata_version_member_seq ||
  1082		    le16_to_cpu(sb->sb->version) < bcachefs_metadata_version_member_seq)
  1083			return 0;
  1084	
  1085		if (fs->sb->seq == sb->sb->seq &&
  1086		    fs->sb->write_time != sb->sb->write_time) {
  1087			struct printbuf buf = PRINTBUF;
  1088	
  1089			prt_printf(&buf, "Split brain detected between %pg and %pg:",
  1090				   sb->bdev, fs->bdev);
  1091			prt_newline(&buf);
  1092			prt_printf(&buf, "seq=%llu but write_time different, got", le64_to_cpu(sb->sb->seq));
  1093			prt_newline(&buf);
  1094	
  1095			prt_printf(&buf, "%pg ", fs->bdev);
> 1096			bch2_prt_datetime(&buf, le64_to_cpu(fs->sb->write_time));;
  1097			prt_newline(&buf);
  1098	
  1099			prt_printf(&buf, "%pg ", sb->bdev);
  1100			bch2_prt_datetime(&buf, le64_to_cpu(sb->sb->write_time));;
  1101			prt_newline(&buf);
  1102	
  1103			prt_printf(&buf, "Not using older sb");
  1104	
  1105			pr_err("%s", buf.buf);
  1106			printbuf_exit(&buf);
  1107			return -BCH_ERR_device_splitbrain;
  1108		}
  1109	
  1110		struct bch_member m = bch2_sb_member_get(fs->sb, sb->sb->dev_idx);
  1111		u64 seq_from_fs		= le64_to_cpu(m.seq);
  1112		u64 seq_from_member	= le64_to_cpu(sb->sb->seq);
  1113	
  1114		if (seq_from_fs && seq_from_fs < seq_from_member) {
  1115			pr_err("Split brain detected between %pg and %pg:\n"
  1116			       "%pg believes seq of %pg to be %llu, but %pg has %llu\n"
  1117			       "Not using %pg",
  1118			       sb->bdev, fs->bdev,
  1119			       fs->bdev, sb->bdev, seq_from_fs,
  1120			       sb->bdev, seq_from_member,
  1121			       sb->bdev);
  1122			return -BCH_ERR_device_splitbrain;
  1123		}
  1124	
  1125		return 0;
  1126	}
  1127	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-09-11  9:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202409111620.WGpinYej-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kent.overstreet@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®