Re: [RFC PATCH 1/1] minix: unify the v1 and v2/v3 itree code paths
kernel test robot <[email protected]>
| Newsgroups | dev.linux.lists.oe-kbuild-all |
|---|---|
| Message-ID | <[email protected]> |
Hi Jeremy, [This is a private test report for your RFC patch.] kernel test robot noticed the following build warnings: [auto build test WARNING on v7.2-rc7] [also build test WARNING on linus/master next-20260814] [cannot apply to brauner-vfs/vfs.all] [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/Jeremy-Bingham/minix-unify-the-v1-and-v2-v3-itree-code-paths/20260814-012958 base: v7.2-rc7 patch link: https://lore.kernel.org/r/d9f07a9037d019043ed24d8245d9a58ce2c669f0.1783324260.git.jbingham%40gmail.com patch subject: [RFC PATCH 1/1] minix: unify the v1 and v2/v3 itree code paths config: s390-randconfig-r062-20260817 (https://download.01.org/0day-ci/archive/20260817/[email protected]/config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) 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 <[email protected]> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ cocci warnings: (new ones prefixed by >>) >> fs/minix/itree.c:420:3-8: WARNING: NULL check before some freeing functions is not needed. fs/minix/itree.c:422:3-8: WARNING: NULL check before some freeing functions is not needed. fs/minix/itree.c:717:2-7: WARNING: NULL check before some freeing functions is not needed. fs/minix/itree.c:719:2-7: WARNING: NULL check before some freeing functions is not needed. vim +420 fs/minix/itree.c 401 402 /* offsets and chain have DEPTH elements. Since DEPTH varies between versions of 403 * the minix filesystems, instead of having two different definitions of DEPTH 404 * and two different versions of this function just allocate the offsets and 405 * chain arrays dynamically. This does require remembering to free them. 406 */ 407 int minix_get_block(struct inode *inode, sector_t block, 408 struct buffer_head *bh, int create) 409 { 410 struct super_block *sb = inode->i_sb; 411 struct minix_sb_info *sbi = minix_sb(sb); 412 u8 s_depth = sbi->s_depth; 413 int err = -EIO; 414 int *offsets = kmalloc_array(s_depth, sizeof(int), GFP_KERNEL); 415 Indirect *chain = kmalloc_array(s_depth, sizeof(Indirect), GFP_KERNEL); 416 417 if (offsets == NULL || chain == NULL) { 418 err = -ENOMEM; 419 if (offsets != NULL) > 420 kfree(offsets); 421 if (chain != NULL) 422 kfree(chain); 423 goto out; 424 } 425 426 Indirect *partial; 427 int left; 428 int depth = block_to_path(inode, block, offsets); 429 430 if (depth == 0) 431 goto out; 432 433 reread: 434 partial = get_branch(inode, depth, offsets, chain, &err); 435 436 /* Simplest case - block found, no allocation needed */ 437 if (!partial) { 438 got_it: 439 map_bh(bh, inode->i_sb, block_to_cpu(chain[depth-1].key)); 440 /* Clean up and exit */ 441 partial = chain+depth-1; /* the whole chain */ 442 goto cleanup; 443 } 444 445 /* Next simple case - plain lookup or failed read of indirect block */ 446 if (!create || err == -EIO) { 447 cleanup: 448 while (partial > chain) { 449 brelse(partial->bh); 450 partial--; 451 } 452 453 kfree(offsets); 454 kfree(chain); 455 out: 456 return err; 457 } 458 459 /* 460 * Indirect block might be removed by truncate while we were 461 * reading it. Handling of that case (forget what we've got and 462 * reread) is taken out of the main path. 463 */ 464 if (err == -EAGAIN) 465 goto changed; 466 467 left = (chain + depth) - partial; 468 err = alloc_branch(inode, left, offsets+(partial-chain), partial); 469 if (err) 470 goto cleanup; 471 472 if (splice_branch(inode, chain, partial, left) < 0) 473 goto changed; 474 475 set_buffer_new(bh); 476 goto got_it; 477 478 changed: 479 while (partial > chain) { 480 brelse(partial->bh); 481 partial--; 482 } 483 goto reread; 484 } 485 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki