tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git
xlog-write-rework
head: a205e517349494d7b3ab2ca314a5a2fb4ac042ff
commit: f7646fa5fbd31e4ce42ed4873010a2ab4ef5c473 [2/16] xfs: only CIL pushes require a
start record
config: i386-randconfig-s001-20211115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git/commit/...
git remote add dgc-xfs
https://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git
git fetch --no-tags dgc-xfs xlog-write-rework
git checkout f7646fa5fbd31e4ce42ed4873010a2ab4ef5c473
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> fs/xfs/xfs_log_cil.c:863:39: sparse: sparse: incorrect type in
initializer (different base types) @@ expected unsigned int [usertype] tid @@ got
restricted __be32 [usertype] @@
fs/xfs/xfs_log_cil.c:863:39: sparse: expected
unsigned int [usertype] tid
fs/xfs/xfs_log_cil.c:863:39: sparse: got restricted __be32 [usertype]
> fs/xfs/xfs_log_cil.c:868:28: sparse: sparse: incorrect type in
assignment (different base types) @@ expected restricted __be32 [usertype] oh_tid @@
got unsigned int [usertype] tid @@
fs/xfs/xfs_log_cil.c:868:28: sparse:
expected restricted __be32 [usertype] oh_tid
fs/xfs/xfs_log_cil.c:868:28: sparse: got unsigned int [usertype] tid
fs/xfs/xfs_log_cil.c:878:28: sparse: sparse: incorrect type in assignment (different
base types) @@ expected restricted __be32 [usertype] oh_tid @@ got unsigned int
[usertype] tid @@
fs/xfs/xfs_log_cil.c:878:28: sparse: expected restricted __be32 [usertype] oh_tid
fs/xfs/xfs_log_cil.c:878:28: sparse: got unsigned int [usertype] tid
fs/xfs/xfs_log_cil.c:915:1: sparse: sparse: context imbalance in
'xlog_cil_push_work' - different lock contexts for basic block
fs/xfs/xfs_log_cil.c:1176:1: sparse: sparse: context imbalance in
'xlog_cil_push_background' - wrong count at exit
fs/xfs/xfs_log_cil.c:1360:9: sparse: sparse: context imbalance in
'xlog_cil_commit' - unexpected unlock
vim +863 fs/xfs/xfs_log_cil.c
842
843 /*
844 * Build a checkpoint transaction header to begin the journal transaction. We
845 * need to account for the space used by the transaction header here as it is
846 * not accounted for in xlog_write().
847 *
848 * This is the only place we write a transaction header, so we also build the
849 * log opheaders that indicate the start of a log transaction and wrap the
850 * transaction header. We keep the start record in it's own log vector rather
851 * than compacting them into a single region as this ends up making the logic
852 * in xlog_write() for handling empty opheaders for start, commit and unmount
853 * records much simpler.
854 */
855 static void
856 xlog_cil_build_trans_hdr(
857 struct xfs_cil_ctx *ctx,
858 struct xlog_cil_trans_hdr *hdr,
859 struct xfs_log_vec *lvhdr,
860 int num_iovecs)
861 {
862 struct xlog_ticket *tic = ctx->ticket;
863 uint32_t tid = cpu_to_be32(tic->t_tid);
864
865 memset(hdr, 0, sizeof(*hdr));
866
867 /* Log start record */
868 hdr->oph[0].oh_tid = tid;
869 hdr->oph[0].oh_clientid = XFS_TRANSACTION;
870 hdr->oph[0].oh_flags = XLOG_START_TRANS;
871
872 /* log iovec region pointer */
873 hdr->lhdr[0].i_addr = &hdr->oph[0];
874 hdr->lhdr[0].i_len = sizeof(struct xlog_op_header);
875 hdr->lhdr[0].i_type = XLOG_REG_TYPE_LRHEADER;
876
877 /* log opheader */
878 hdr->oph[1].oh_tid = tid;
879 hdr->oph[1].oh_clientid = XFS_TRANSACTION;
880
881 /* transaction header */
882 hdr->thdr.th_magic = XFS_TRANS_HEADER_MAGIC;
883 hdr->thdr.th_type = XFS_TRANS_CHECKPOINT;
884 hdr->thdr.th_tid = tid;
885 hdr->thdr.th_num_items = num_iovecs;
886
887 /* log iovec region pointer */
888 hdr->lhdr[1].i_addr = &hdr->oph[1];
889 hdr->lhdr[1].i_len = sizeof(struct xlog_op_header) +
890 sizeof(struct xfs_trans_header);
891 hdr->lhdr[1].i_type = XLOG_REG_TYPE_TRANSHDR;
892
893 tic->t_curr_res -= hdr->lhdr[0].i_len + hdr->lhdr[1].i_len;
894
895 lvhdr->lv_niovecs = 2;
896 lvhdr->lv_iovecp = &hdr->lhdr[0];
897 lvhdr->lv_next = ctx->lv_chain;
898 }
899
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org