All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [android-common:android-4.19 1/4] fs/incfs/format.c:616:3: note: in expansion of macro 'pr_warn'
Date: Sat, 30 May 2020 00:38:57 +0800	[thread overview]
Message-ID: <202005300055.9ckhAcY3%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 7079 bytes --]

tree:   https://android.googlesource.com/kernel/common android-4.19
head:   7bab03039e64ed6c26be90530e08978eab3be578
commit: 040942fc50b20325bb56737c32b303268bb6f35c [1/4] ANDROID: Initial commit of Incremental FS
config: i386-randconfig-m021-20200529 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

In file included from include/linux/printk.h:7,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/incfs/format.c:5:
fs/incfs/format.c: In function 'incfs_read_next_metadata_record':
include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
5 | #define KERN_SOH "001"  /* ASCII Start Of Header */
|                  ^~~~~~
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
12 | #define KERN_WARNING KERN_SOH "4" /* warning conditions */
|                      ^~~~~~~~
include/linux/printk.h:310:9: note: in expansion of macro 'KERN_WARNING'
310 |  printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
|         ^~~~~~~~~~~~
include/linux/printk.h:311:17: note: in expansion of macro 'pr_warning'
311 | #define pr_warn pr_warning
|                 ^~~~~~~~~~
>> fs/incfs/format.c:616:3: note: in expansion of macro 'pr_warn'
616 |   pr_warn("incfs: The record is too large. Size: %ld",
|   ^~~~~~~
fs/incfs/format.c:616:52: note: format string is defined here
616 |   pr_warn("incfs: The record is too large. Size: %ld",
|                                                  ~~^
|                                                    |
|                                                    long int
|                                                  %d
--
In file included from fs/incfs/vfs.c:22:
fs/incfs/data_mgmt.h: In function 'get_incfs_node':
fs/incfs/data_mgmt.h:263:27: warning: comparison is always true due to limited range of data type [-Wtype-limits]
263 |  if (inode->i_sb->s_magic != INCFS_MAGIC_NUMBER) {
|                           ^~
fs/incfs/vfs.c: In function 'ioctl_create_file':
fs/incfs/vfs.c:1323:4: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1323 |    (struct incfs_file_signature_info __user *)
|    ^
fs/incfs/vfs.c: At top level:
fs/incfs/vfs.c:2057:16: warning: no previous prototype for 'incfs_mount_fs' [-Wmissing-prototypes]
2057 | struct dentry *incfs_mount_fs(struct file_system_type *type, int flags,
|                ^~~~~~~~~~~~~~
In file included from fs/incfs/vfs.c:19:
fs/incfs/vfs.c: In function 'incfs_mount_fs':
>> include/uapi/linux/incrementalfs.h:21:28: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '357661101641' to '1178816073' [-Woverflow]
21 | #define INCFS_MAGIC_NUMBER (0x5346434e49ul)
|                            ^
>> fs/incfs/vfs.c:2075:16: note: in expansion of macro 'INCFS_MAGIC_NUMBER'
2075 |  sb->s_magic = INCFS_MAGIC_NUMBER;
|                ^~~~~~~~~~~~~~~~~~
fs/incfs/vfs.c: At top level:
fs/incfs/vfs.c:2176:6: warning: no previous prototype for 'incfs_kill_sb' [-Wmissing-prototypes]
2176 | void incfs_kill_sb(struct super_block *sb)
|      ^~~~~~~~~~~~~

vim +/pr_warn +616 fs/incfs/format.c

   578	
   579	/*
   580	 * Read through metadata records from the backing file one by one
   581	 * and call provided metadata handlers.
   582	 */
   583	int incfs_read_next_metadata_record(struct backing_file_context *bfc,
   584				      struct metadata_handler *handler)
   585	{
   586		const ssize_t max_md_size = INCFS_MAX_METADATA_RECORD_SIZE;
   587		ssize_t bytes_read = 0;
   588		size_t md_record_size = 0;
   589		loff_t next_record = 0;
   590		loff_t prev_record = 0;
   591		int res = 0;
   592		struct incfs_md_header *md_hdr = NULL;
   593	
   594		if (!bfc || !handler)
   595			return -EFAULT;
   596	
   597		LOCK_REQUIRED(bfc->bc_mutex);
   598	
   599		if (handler->md_record_offset == 0)
   600			return -EPERM;
   601	
   602		memset(&handler->md_buffer, 0, max_md_size);
   603		bytes_read = incfs_kread(bfc->bc_file, &handler->md_buffer,
   604					 max_md_size, handler->md_record_offset);
   605		if (bytes_read < 0)
   606			return bytes_read;
   607		if (bytes_read < sizeof(*md_hdr))
   608			return -EBADMSG;
   609	
   610		md_hdr = &handler->md_buffer.md_header;
   611		next_record = le64_to_cpu(md_hdr->h_next_md_offset);
   612		prev_record = le64_to_cpu(md_hdr->h_prev_md_offset);
   613		md_record_size = le16_to_cpu(md_hdr->h_record_size);
   614	
   615		if (md_record_size > max_md_size) {
 > 616			pr_warn("incfs: The record is too large. Size: %ld",
   617					md_record_size);
   618			return -EBADMSG;
   619		}
   620	
   621		if (bytes_read < md_record_size) {
   622			pr_warn("incfs: The record hasn't been fully read.");
   623			return -EBADMSG;
   624		}
   625	
   626		if (next_record <= handler->md_record_offset && next_record != 0) {
   627			pr_warn("incfs: Next record (%lld) points back in file.",
   628				next_record);
   629			return -EBADMSG;
   630		}
   631	
   632		if (prev_record != handler->md_prev_record_offset) {
   633			pr_warn("incfs: Metadata chain has been corrupted.");
   634			return -EBADMSG;
   635		}
   636	
   637		if (le32_to_cpu(md_hdr->h_record_crc) != calc_md_crc(md_hdr)) {
   638			pr_warn("incfs: Metadata CRC mismatch.");
   639			return -EBADMSG;
   640		}
   641	
   642		switch (md_hdr->h_md_entry_type) {
   643		case INCFS_MD_NONE:
   644			break;
   645		case INCFS_MD_BLOCK_MAP:
   646			if (handler->handle_blockmap)
   647				res = handler->handle_blockmap(
   648					&handler->md_buffer.blockmap, handler);
   649			break;
   650		case INCFS_MD_FILE_ATTR:
   651			if (handler->handle_file_attr)
   652				res = handler->handle_file_attr(
   653					&handler->md_buffer.file_attr, handler);
   654			break;
   655		case INCFS_MD_SIGNATURE:
   656			if (handler->handle_signature)
   657				res = handler->handle_signature(
   658					&handler->md_buffer.signature, handler);
   659			break;
   660		default:
   661			res = -ENOTSUPP;
   662			break;
   663		}
   664	
   665		if (!res) {
   666			if (next_record == 0) {
   667				/*
   668				 * Zero offset for the next record means that the last
   669				 * metadata record has just been processed.
   670				 */
   671				bfc->bc_last_md_record_offset =
   672					handler->md_record_offset;
   673			}
   674			handler->md_prev_record_offset = handler->md_record_offset;
   675			handler->md_record_offset = next_record;
   676		}
   677		return res;
   678	}
   679	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35732 bytes --]

                 reply	other threads:[~2020-05-29 16:38 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=202005300055.9ckhAcY3%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.