All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [chrome-os:chromeos-6.6 73/78] drivers/md/dm-verity-chromeos.c:418:26: warning: passing argument 2 of 'blkdev_put' makes pointer from integer without a cast
Date: Thu, 31 Oct 2024 14:24:15 +0800	[thread overview]
Message-ID: <202410311431.I3CLLBIb-lkp@intel.com> (raw)

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-6.6
head:   c177bfa506750a08f31510adc2d3aa8ceec0f6c4
commit: 1963b113a7341f89f48813b72c9d9022970e0560 [73/78] CHROMIUM: dm-verity: use GPT try counter for integrity retries
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20241031/202410311431.I3CLLBIb-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241031/202410311431.I3CLLBIb-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/202410311431.I3CLLBIb-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/md/dm-verity-chromeos.c: In function 'chromeos_handle_retries':
>> drivers/md/dm-verity-chromeos.c:418:26: warning: passing argument 2 of 'blkdev_put' makes pointer from integer without a cast [-Wint-conversion]
     418 |         blkdev_put(bdev, dev_mode);
         |                          ^~~~~~~~
         |                          |
         |                          fmode_t {aka unsigned int}
   In file included from drivers/md/dm-verity-chromeos.c:20:
   include/linux/blkdev.h:1511:50: note: expected 'void *' but argument is of type 'fmode_t' {aka 'unsigned int'}
    1511 | void blkdev_put(struct block_device *bdev, void *holder);
         |                                            ~~~~~~^~~~~~
   drivers/md/dm-verity-chromeos.c:445:34: warning: passing argument 2 of 'blkdev_put' makes pointer from integer without a cast [-Wint-conversion]
     445 |                 blkdev_put(bdev, dev_mode);
         |                                  ^~~~~~~~
         |                                  |
         |                                  fmode_t {aka unsigned int}
   include/linux/blkdev.h:1511:50: note: expected 'void *' but argument is of type 'fmode_t' {aka 'unsigned int'}
    1511 | void blkdev_put(struct block_device *bdev, void *holder);
         |                                            ~~~~~~^~~~~~
   In file included from include/linux/highmem.h:5,
                    from include/linux/bvec.h:10,
                    from include/linux/blk_types.h:10,
                    from include/linux/bio.h:10,
                    from drivers/md/dm-verity-chromeos.c:19:
   drivers/md/dm-verity-chromeos.c: In function 'chromeos_update_tries':
>> include/linux/fs.h:111:33: warning: passing argument 2 of 'blkdev_put' makes pointer from integer without a cast [-Wint-conversion]
     111 | #define FMODE_READ              ((__force fmode_t)0x1)
         |                                 ^~~~~~~~~~~~~~~~~~~~~~
         |                                 |
         |                                 unsigned int
   drivers/md/dm-verity-chromeos.c:481:33: note: in expansion of macro 'FMODE_READ'
     481 |         blkdev_put(kernel_bdev, FMODE_READ);
         |                                 ^~~~~~~~~~
   include/linux/blkdev.h:1511:50: note: expected 'void *' but argument is of type 'unsigned int'
    1511 | void blkdev_put(struct block_device *bdev, void *holder);
         |                                            ~~~~~~^~~~~~


vim +/blkdev_put +418 drivers/md/dm-verity-chromeos.c

   373	
   374	static int chromeos_handle_retries(struct bio *bio,
   375					   dev_t devt,
   376					   u8 active_gpt_entry_id,
   377					   sector_t hdr_lba,
   378					   struct page *hdr_page,
   379					   struct page *tbl_pages)
   380	{
   381		struct block_device *bdev;
   382		fmode_t dev_mode = 0;
   383		int ret = 0;
   384	
   385		dev_mode = FMODE_READ;
   386		bdev = blkdev_get_by_dev(devt, dev_mode,
   387					 chromeos_handle_retries, NULL);
   388		if (IS_ERR(bdev)) {
   389			DMERR("update_tries: could not open device for reading: %ld",
   390			      PTR_ERR(bdev));
   391			dev_mode = 0;
   392			ret = -1;
   393			goto failed;
   394		}
   395	
   396		/*
   397		 * Request read operation with REQ_PREFLUSH flag to ensure that the
   398		 * cache of non-volatile storage device has been flushed before read is
   399		 * started.
   400		 */
   401		if (chromeos_gpt_io_submit(bio, bdev, REQ_OP_READ,
   402					   REQ_SYNC | REQ_PREFLUSH, hdr_lba,
   403					   hdr_page, tbl_pages)) {
   404			DMERR("update_tries: failed reading %s GPT",
   405			      hdr_lba == 1 ? "primary" : "secondary");
   406			ret = -1;
   407			goto failed;
   408		}
   409	
   410		if (chromeos_increment_gpt_err_count(hdr_page, tbl_pages,
   411						     active_gpt_entry_id)) {
   412			DMERR("update_tries: retries exceeded");
   413			ret = -1;
   414			goto failed;
   415		}
   416	
   417		/* The block dev was being changed on read. Let's reopen here. */
 > 418		blkdev_put(bdev, dev_mode);
   419		dev_mode = FMODE_WRITE;
   420		bdev = blkdev_get_by_dev(devt, dev_mode,
   421					 chromeos_handle_retries, NULL);
   422		if (IS_ERR(bdev)) {
   423			DMERR("update_tries: could not open device for writing");
   424			dev_mode = 0;
   425			ret = -1;
   426			goto failed;
   427		}
   428	
   429		/*
   430		 * Request write operation with REQ_FUA flag to ensure that I/O
   431		 * completion for the write is signaled only after the data has been
   432		 * committed to non-volatile storage.
   433		 */
   434		if (chromeos_gpt_io_submit(bio, bdev, REQ_OP_WRITE,
   435					   REQ_SYNC | REQ_FUA, hdr_lba,
   436					   hdr_page, tbl_pages)) {
   437			DMERR("update_tries: failed writing %s GPT",
   438			      hdr_lba == 1 ? "primary" : "secondary");
   439			ret = -1;
   440			goto failed;
   441		}
   442	
   443	failed:
   444		if (dev_mode)
   445			blkdev_put(bdev, dev_mode);
   446	
   447		if (!ret)
   448			DMERR("update_tries: updated %s GPT",
   449			      hdr_lba == 1 ? "primary" : "secondary");
   450	
   451		return ret;
   452	}
   453	

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

                 reply	other threads:[~2024-10-31  6:24 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=202410311431.I3CLLBIb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --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 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.