From: kernel test robot <lkp@intel.com>
To: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev,
David Hildenbrand <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
mm-commits@vger.kernel.org,
Phillip Lougher <phillip@squashfs.org.uk>
Subject: [akpm-mm:mm-nonmm-unstable 111/117] fs/squashfs/file_direct.c:121:1: warning: label 'out' defined but not used
Date: Sat, 07 Nov 2026 20:06:32 +0800 [thread overview]
Message-ID: <202611072044.cmq8jkLA-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
head: 09658a93dbdf3596b7c0edec1292ae09e58da333
commit: 024c3b9753561e3ad2d6cdd47b405126709633e0 [111/117] squashfs: fix leaked page locks when page actor allocation fails
config: i386-buildonly-randconfig-1001-20261107 (https://download.01.org/0day-ci/archive/20261107/202611072044.cmq8jkLA-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261107/202611072044.cmq8jkLA-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/202611072044.cmq8jkLA-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/squashfs/file_direct.c: In function 'squashfs_readpage_block':
>> fs/squashfs/file_direct.c:121:1: warning: label 'out' defined but not used [-Wunused-label]
121 | out:
| ^~~
vim +/out +121 fs/squashfs/file_direct.c
0d455c12c642864 Phillip Lougher 2013-11-13 20
0d455c12c642864 Phillip Lougher 2013-11-13 21 /* Read separately compressed datablock directly into page cache */
2a7aea59cf4dd4a Matthew Wilcox (Oracle 2024-12-20 22) int squashfs_readpage_block(struct folio *folio, u64 block, int bsize,
a3f94cb99a854fa Phillip Lougher 2018-08-02 23 int expected)
0d455c12c642864 Phillip Lougher 2013-11-13 24 {
2a7aea59cf4dd4a Matthew Wilcox (Oracle 2024-12-20 25) struct page *target_page = &folio->page;
2a7aea59cf4dd4a Matthew Wilcox (Oracle 2024-12-20 26) struct inode *inode = folio->mapping->host;
0d455c12c642864 Phillip Lougher 2013-11-13 27 struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
12427de9439d68b Phillip Lougher 2023-11-13 28 loff_t file_end = (i_size_read(inode) - 1) >> PAGE_SHIFT;
09cbfeaf1a5a67b Kiryl Shutsemau 2016-04-01 29 int mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1;
7f73fcde4d93072 Phillip Lougher 2024-08-19 30 loff_t start_index = folio->index & ~mask;
12427de9439d68b Phillip Lougher 2023-11-13 31 loff_t end_index = start_index | mask;
d31638ff6c5437c Phillip Lougher 2024-10-21 32 loff_t index;
d31638ff6c5437c Phillip Lougher 2024-10-21 33 int i, pages, bytes, res = -ENOMEM;
7f73fcde4d93072 Phillip Lougher 2024-08-19 34 struct page **page, *last_page;
0d455c12c642864 Phillip Lougher 2013-11-13 35 struct squashfs_page_actor *actor;
0d455c12c642864 Phillip Lougher 2013-11-13 36 void *pageaddr;
0d455c12c642864 Phillip Lougher 2013-11-13 37
0d455c12c642864 Phillip Lougher 2013-11-13 38 if (end_index > file_end)
0d455c12c642864 Phillip Lougher 2013-11-13 39 end_index = file_end;
0d455c12c642864 Phillip Lougher 2013-11-13 40
0d455c12c642864 Phillip Lougher 2013-11-13 41 pages = end_index - start_index + 1;
0d455c12c642864 Phillip Lougher 2013-11-13 42
14694888db2c1f7 Fabian Frederick 2014-08-06 43 page = kmalloc_array(pages, sizeof(void *), GFP_KERNEL);
0d455c12c642864 Phillip Lougher 2013-11-13 44 if (page == NULL)
0d455c12c642864 Phillip Lougher 2013-11-13 45 return res;
0d455c12c642864 Phillip Lougher 2013-11-13 46
0d455c12c642864 Phillip Lougher 2013-11-13 47 /* Try to grab all the pages covered by the Squashfs block */
d31638ff6c5437c Phillip Lougher 2024-10-21 48 for (i = 0, index = start_index; index <= end_index; index++) {
d31638ff6c5437c Phillip Lougher 2024-10-21 49 page[i] = (index == folio->index) ? target_page :
2a7aea59cf4dd4a Matthew Wilcox (Oracle 2024-12-20 50) grab_cache_page_nowait(folio->mapping, index);
0d455c12c642864 Phillip Lougher 2013-11-13 51
1bb1a07afad9730 Phillip Lougher 2022-06-11 52 if (page[i] == NULL)
0d455c12c642864 Phillip Lougher 2013-11-13 53 continue;
0d455c12c642864 Phillip Lougher 2013-11-13 54
0d455c12c642864 Phillip Lougher 2013-11-13 55 if (PageUptodate(page[i])) {
0d455c12c642864 Phillip Lougher 2013-11-13 56 unlock_page(page[i]);
09cbfeaf1a5a67b Kiryl Shutsemau 2016-04-01 57 put_page(page[i]);
1bb1a07afad9730 Phillip Lougher 2022-06-11 58 continue;
0d455c12c642864 Phillip Lougher 2013-11-13 59 }
0d455c12c642864 Phillip Lougher 2013-11-13 60
1bb1a07afad9730 Phillip Lougher 2022-06-11 61 i++;
0d455c12c642864 Phillip Lougher 2013-11-13 62 }
0d455c12c642864 Phillip Lougher 2013-11-13 63
1bb1a07afad9730 Phillip Lougher 2022-06-11 64 pages = i;
1bb1a07afad9730 Phillip Lougher 2022-06-11 65
f268eedddf3595e Phillip Lougher 2022-06-11 66 /*
f268eedddf3595e Phillip Lougher 2022-06-11 67 * Create a "page actor" which will kmap and kunmap the
f268eedddf3595e Phillip Lougher 2022-06-11 68 * page cache pages appropriately within the decompressor
f268eedddf3595e Phillip Lougher 2022-06-11 69 */
2258e22f05aff58 Phillip Lougher 2024-08-19 70 actor = squashfs_page_actor_init_special(msblk, page, pages, expected,
2258e22f05aff58 Phillip Lougher 2024-08-19 71 start_index << PAGE_SHIFT);
f268eedddf3595e Phillip Lougher 2022-06-11 72 if (actor == NULL)
024c3b9753561e3 Nguyen Ngoc Thang 2026-09-27 73 goto mark_errored;
f268eedddf3595e Phillip Lougher 2022-06-11 74
0d455c12c642864 Phillip Lougher 2013-11-13 75 /* Decompress directly into the page cache buffers */
0d455c12c642864 Phillip Lougher 2013-11-13 76 res = squashfs_read_data(inode->i_sb, block, bsize, NULL, actor);
f268eedddf3595e Phillip Lougher 2022-06-11 77
7f73fcde4d93072 Phillip Lougher 2024-08-19 78 last_page = squashfs_page_actor_free(actor);
f268eedddf3595e Phillip Lougher 2022-06-11 79
0d455c12c642864 Phillip Lougher 2013-11-13 80 if (res < 0)
0d455c12c642864 Phillip Lougher 2013-11-13 81 goto mark_errored;
0d455c12c642864 Phillip Lougher 2013-11-13 82
84e0e03b308816a Phillip Lougher 2024-08-23 83 if (res != expected || IS_ERR(last_page)) {
a3f94cb99a854fa Phillip Lougher 2018-08-02 84 res = -EIO;
a3f94cb99a854fa Phillip Lougher 2018-08-02 85 goto mark_errored;
a3f94cb99a854fa Phillip Lougher 2018-08-02 86 }
a3f94cb99a854fa Phillip Lougher 2018-08-02 87
1bb1a07afad9730 Phillip Lougher 2022-06-11 88 /* Last page (if present) may have trailing bytes not filled */
09cbfeaf1a5a67b Kiryl Shutsemau 2016-04-01 89 bytes = res % PAGE_SIZE;
7f73fcde4d93072 Phillip Lougher 2024-08-19 90 if (end_index == file_end && last_page && bytes) {
7f73fcde4d93072 Phillip Lougher 2024-08-19 91 pageaddr = kmap_local_page(last_page);
09cbfeaf1a5a67b Kiryl Shutsemau 2016-04-01 92 memset(pageaddr + bytes, 0, PAGE_SIZE - bytes);
1bb1a07afad9730 Phillip Lougher 2022-06-11 93 kunmap_local(pageaddr);
0d455c12c642864 Phillip Lougher 2013-11-13 94 }
0d455c12c642864 Phillip Lougher 2013-11-13 95
0d455c12c642864 Phillip Lougher 2013-11-13 96 /* Mark pages as uptodate, unlock and release */
0d455c12c642864 Phillip Lougher 2013-11-13 97 for (i = 0; i < pages; i++) {
0d455c12c642864 Phillip Lougher 2013-11-13 98 flush_dcache_page(page[i]);
0d455c12c642864 Phillip Lougher 2013-11-13 99 SetPageUptodate(page[i]);
0d455c12c642864 Phillip Lougher 2013-11-13 100 unlock_page(page[i]);
0d455c12c642864 Phillip Lougher 2013-11-13 101 if (page[i] != target_page)
09cbfeaf1a5a67b Kiryl Shutsemau 2016-04-01 102 put_page(page[i]);
0d455c12c642864 Phillip Lougher 2013-11-13 103 }
0d455c12c642864 Phillip Lougher 2013-11-13 104
0d455c12c642864 Phillip Lougher 2013-11-13 105 kfree(page);
0d455c12c642864 Phillip Lougher 2013-11-13 106
0d455c12c642864 Phillip Lougher 2013-11-13 107 return 0;
0d455c12c642864 Phillip Lougher 2013-11-13 108
0d455c12c642864 Phillip Lougher 2013-11-13 109 mark_errored:
bbf45b7e6855556 Matthew Wilcox (Oracle 2024-04-20 110) /* Decompression failed. Target_page is
0d455c12c642864 Phillip Lougher 2013-11-13 111 * dealt with by the caller
0d455c12c642864 Phillip Lougher 2013-11-13 112 */
0d455c12c642864 Phillip Lougher 2013-11-13 113 for (i = 0; i < pages; i++) {
6d565409503f4e1 Phillip Lougher 2013-11-24 114 if (page[i] == NULL || page[i] == target_page)
0d455c12c642864 Phillip Lougher 2013-11-13 115 continue;
0d455c12c642864 Phillip Lougher 2013-11-13 116 flush_dcache_page(page[i]);
0d455c12c642864 Phillip Lougher 2013-11-13 117 unlock_page(page[i]);
09cbfeaf1a5a67b Kiryl Shutsemau 2016-04-01 118 put_page(page[i]);
0d455c12c642864 Phillip Lougher 2013-11-13 119 }
0d455c12c642864 Phillip Lougher 2013-11-13 120
0d455c12c642864 Phillip Lougher 2013-11-13 @121 out:
:::::: The code at line 121 was first introduced by commit
:::::: 0d455c12c6428647547bacccaaced3cae0f35570 Squashfs: Directly decompress into the page cache for file data
:::::: TO: Phillip Lougher <phillip@squashfs.org.uk>
:::::: CC: Phillip Lougher <phillip@squashfs.org.uk>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-11-07 12:07 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=202611072044.cmq8jkLA-lkp@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=linux-mm@kvack.org \
--cc=mm-commits@vger.kernel.org \
--cc=ngocthang2710.1999@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=phillip@squashfs.org.uk \
/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.