linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Alex Markuze <amarkuze@redhat.com>, ceph-devel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	idryomov@gmail.com, linux-fsdevel@vger.kernel.org,
	amarkuze@redhat.com, vdubeyko@redhat.com
Subject: Re: [PATCH 1/3] ceph: handle InodeStat v8 versioned field in reply parsing
Date: Fri, 28 Nov 2025 09:48:53 +0800	[thread overview]
Message-ID: <202511280915.HZ1rLMsq-lkp@intel.com> (raw)
In-Reply-To: <20251127134620.2035796-2-amarkuze@redhat.com>

Hi Alex,

kernel test robot noticed the following build warnings:

[auto build test WARNING on ceph-client/for-linus]
[also build test WARNING on linus/master v6.18-rc7 next-20251127]
[cannot apply to ceph-client/testing]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Alex-Markuze/ceph-handle-InodeStat-v8-versioned-field-in-reply-parsing/20251127-214928
base:   https://github.com/ceph/ceph-client.git for-linus
patch link:    https://lore.kernel.org/r/20251127134620.2035796-2-amarkuze%40redhat.com
patch subject: [PATCH 1/3] ceph: handle InodeStat v8 versioned field in reply parsing
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20251128/202511280915.HZ1rLMsq-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251128/202511280915.HZ1rLMsq-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/202511280915.HZ1rLMsq-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ceph/mds_client.c:237:7: warning: variable 'v8_struct_v' set but not used [-Wunused-but-set-variable]
     237 |                         u8 v8_struct_v, v8_struct_compat;
         |                            ^
>> fs/ceph/mds_client.c:237:20: warning: variable 'v8_struct_compat' set but not used [-Wunused-but-set-variable]
     237 |                         u8 v8_struct_v, v8_struct_compat;
         |                                         ^
   2 warnings generated.


vim +/v8_struct_v +237 fs/ceph/mds_client.c

    97	
    98	/*
    99	 * parse individual inode info
   100	 */
   101	static int parse_reply_info_in(void **p, void *end,
   102				       struct ceph_mds_reply_info_in *info,
   103				       u64 features)
   104	{
   105		int err = 0;
   106		u8 struct_v = 0;
   107	
   108		if (features == (u64)-1) {
   109			u32 struct_len;
   110			u8 struct_compat;
   111			ceph_decode_8_safe(p, end, struct_v, bad);
   112			ceph_decode_8_safe(p, end, struct_compat, bad);
   113			/* struct_v is expected to be >= 1. we only understand
   114			 * encoding with struct_compat == 1. */
   115			if (!struct_v || struct_compat != 1)
   116				goto bad;
   117			ceph_decode_32_safe(p, end, struct_len, bad);
   118			ceph_decode_need(p, end, struct_len, bad);
   119			end = *p + struct_len;
   120		}
   121	
   122		ceph_decode_need(p, end, sizeof(struct ceph_mds_reply_inode), bad);
   123		info->in = *p;
   124		*p += sizeof(struct ceph_mds_reply_inode) +
   125			sizeof(*info->in->fragtree.splits) *
   126			le32_to_cpu(info->in->fragtree.nsplits);
   127	
   128		ceph_decode_32_safe(p, end, info->symlink_len, bad);
   129		ceph_decode_need(p, end, info->symlink_len, bad);
   130		info->symlink = *p;
   131		*p += info->symlink_len;
   132	
   133		ceph_decode_copy_safe(p, end, &info->dir_layout,
   134				      sizeof(info->dir_layout), bad);
   135		ceph_decode_32_safe(p, end, info->xattr_len, bad);
   136		ceph_decode_need(p, end, info->xattr_len, bad);
   137		info->xattr_data = *p;
   138		*p += info->xattr_len;
   139	
   140		if (features == (u64)-1) {
   141			/* inline data */
   142			ceph_decode_64_safe(p, end, info->inline_version, bad);
   143			ceph_decode_32_safe(p, end, info->inline_len, bad);
   144			ceph_decode_need(p, end, info->inline_len, bad);
   145			info->inline_data = *p;
   146			*p += info->inline_len;
   147			/* quota */
   148			err = parse_reply_info_quota(p, end, info);
   149			if (err < 0)
   150				goto out_bad;
   151			/* pool namespace */
   152			ceph_decode_32_safe(p, end, info->pool_ns_len, bad);
   153			if (info->pool_ns_len > 0) {
   154				ceph_decode_need(p, end, info->pool_ns_len, bad);
   155				info->pool_ns_data = *p;
   156				*p += info->pool_ns_len;
   157			}
   158	
   159			/* btime */
   160			ceph_decode_need(p, end, sizeof(info->btime), bad);
   161			ceph_decode_copy(p, &info->btime, sizeof(info->btime));
   162	
   163			/* change attribute */
   164			ceph_decode_64_safe(p, end, info->change_attr, bad);
   165	
   166			/* dir pin */
   167			if (struct_v >= 2) {
   168				ceph_decode_32_safe(p, end, info->dir_pin, bad);
   169			} else {
   170				info->dir_pin = -ENODATA;
   171			}
   172	
   173			/* snapshot birth time, remains zero for v<=2 */
   174			if (struct_v >= 3) {
   175				ceph_decode_need(p, end, sizeof(info->snap_btime), bad);
   176				ceph_decode_copy(p, &info->snap_btime,
   177						 sizeof(info->snap_btime));
   178			} else {
   179				memset(&info->snap_btime, 0, sizeof(info->snap_btime));
   180			}
   181	
   182			/* snapshot count, remains zero for v<=3 */
   183			if (struct_v >= 4) {
   184				ceph_decode_64_safe(p, end, info->rsnaps, bad);
   185			} else {
   186				info->rsnaps = 0;
   187			}
   188	
   189			if (struct_v >= 5) {
   190				u32 alen;
   191	
   192				ceph_decode_32_safe(p, end, alen, bad);
   193	
   194				while (alen--) {
   195					u32 len;
   196	
   197					/* key */
   198					ceph_decode_32_safe(p, end, len, bad);
   199					ceph_decode_skip_n(p, end, len, bad);
   200					/* value */
   201					ceph_decode_32_safe(p, end, len, bad);
   202					ceph_decode_skip_n(p, end, len, bad);
   203				}
   204			}
   205	
   206			/* fscrypt flag -- ignore */
   207			if (struct_v >= 6)
   208				ceph_decode_skip_8(p, end, bad);
   209	
   210			info->fscrypt_auth = NULL;
   211			info->fscrypt_auth_len = 0;
   212			info->fscrypt_file = NULL;
   213			info->fscrypt_file_len = 0;
   214			if (struct_v >= 7) {
   215				ceph_decode_32_safe(p, end, info->fscrypt_auth_len, bad);
   216				if (info->fscrypt_auth_len) {
   217					info->fscrypt_auth = kmalloc(info->fscrypt_auth_len,
   218								     GFP_KERNEL);
   219					if (!info->fscrypt_auth)
   220						return -ENOMEM;
   221					ceph_decode_copy_safe(p, end, info->fscrypt_auth,
   222							      info->fscrypt_auth_len, bad);
   223				}
   224				ceph_decode_32_safe(p, end, info->fscrypt_file_len, bad);
   225				if (info->fscrypt_file_len) {
   226					info->fscrypt_file = kmalloc(info->fscrypt_file_len,
   227								     GFP_KERNEL);
   228					if (!info->fscrypt_file)
   229						return -ENOMEM;
   230					ceph_decode_copy_safe(p, end, info->fscrypt_file,
   231							      info->fscrypt_file_len, bad);
   232				}
   233			}
   234	
   235			/* struct_v 8 added a versioned field - skip it */
   236			if (struct_v >= 8) {
 > 237				u8 v8_struct_v, v8_struct_compat;
   238				u32 v8_struct_len;
   239	
   240				ceph_decode_8_safe(p, end, v8_struct_v, bad);
   241				ceph_decode_8_safe(p, end, v8_struct_compat, bad);
   242				ceph_decode_32_safe(p, end, v8_struct_len, bad);
   243				ceph_decode_skip_n(p, end, v8_struct_len, bad);
   244			}
   245	
   246			*p = end;
   247		} else {
   248			/* legacy (unversioned) struct */
   249			if (features & CEPH_FEATURE_MDS_INLINE_DATA) {
   250				ceph_decode_64_safe(p, end, info->inline_version, bad);
   251				ceph_decode_32_safe(p, end, info->inline_len, bad);
   252				ceph_decode_need(p, end, info->inline_len, bad);
   253				info->inline_data = *p;
   254				*p += info->inline_len;
   255			} else
   256				info->inline_version = CEPH_INLINE_NONE;
   257	
   258			if (features & CEPH_FEATURE_MDS_QUOTA) {
   259				err = parse_reply_info_quota(p, end, info);
   260				if (err < 0)
   261					goto out_bad;
   262			} else {
   263				info->max_bytes = 0;
   264				info->max_files = 0;
   265			}
   266	
   267			info->pool_ns_len = 0;
   268			info->pool_ns_data = NULL;
   269			if (features & CEPH_FEATURE_FS_FILE_LAYOUT_V2) {
   270				ceph_decode_32_safe(p, end, info->pool_ns_len, bad);
   271				if (info->pool_ns_len > 0) {
   272					ceph_decode_need(p, end, info->pool_ns_len, bad);
   273					info->pool_ns_data = *p;
   274					*p += info->pool_ns_len;
   275				}
   276			}
   277	
   278			if (features & CEPH_FEATURE_FS_BTIME) {
   279				ceph_decode_need(p, end, sizeof(info->btime), bad);
   280				ceph_decode_copy(p, &info->btime, sizeof(info->btime));
   281				ceph_decode_64_safe(p, end, info->change_attr, bad);
   282			}
   283	
   284			info->dir_pin = -ENODATA;
   285			/* info->snap_btime and info->rsnaps remain zero */
   286		}
   287		return 0;
   288	bad:
   289		err = -EIO;
   290	out_bad:
   291		return err;
   292	}
   293	

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

  reply	other threads:[~2025-11-28  1:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27 13:46 [PATCH 0/3] ceph: add subvolume metrics reporting support Alex Markuze
2025-11-27 13:46 ` [PATCH 1/3] ceph: handle InodeStat v8 versioned field in reply parsing Alex Markuze
2025-11-28  1:48   ` kernel test robot [this message]
2025-12-01 20:20   ` Viacheslav Dubeyko
2025-12-02 10:39     ` Alex Markuze
2025-11-27 13:46 ` [PATCH 2/3] ceph: parse subvolume_id from InodeStat v9 and store in inode Alex Markuze
2025-12-01 23:27   ` Viacheslav Dubeyko
2025-11-27 13:46 ` [PATCH 3/3] ceph: add subvolume metrics collection and reporting Alex Markuze
2025-11-29 16:51   ` Dan Carpenter
2025-12-01 20:14 ` [PATCH 0/3] ceph: add subvolume metrics reporting support Viacheslav Dubeyko

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=202511280915.HZ1rLMsq-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=amarkuze@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=vdubeyko@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).