lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202510111059.aKceYLLH-lkp@intel.com>
Date: Sat, 11 Oct 2025 10:57:22 +0800
From: kernel test robot <lkp@...el.com>
To: Suren Baghdasaryan <surenb@...gle.com>, akpm@...ux-foundation.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev, david@...hat.com,
	lorenzo.stoakes@...cle.com, Liam.Howlett@...cle.com, vbabka@...e.cz,
	alexandru.elisei@....com, peterx@...hat.com, sj@...nel.org,
	rppt@...nel.org, mhocko@...e.com, corbet@....net, axboe@...nel.dk,
	viro@...iv.linux.org.uk, brauner@...nel.org, hch@...radead.org,
	jack@...e.cz, willy@...radead.org, m.szyprowski@...sung.com,
	robin.murphy@....com, hannes@...xchg.org,
	zhengqi.arch@...edance.com, shakeel.butt@...ux.dev,
	axelrasmussen@...gle.com, yuanchu@...gle.com, weixugc@...gle.com,
	minchan@...nel.org, surenb@...gle.com, linux-mm@...ck.org,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/8] mm/tests: add cleancache kunit test

Hi Suren,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 70478cb9da6fc4e7b987219173ba1681d5f7dd3d]

url:    https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/mm-implement-cleancache/20251010-134501
base:   70478cb9da6fc4e7b987219173ba1681d5f7dd3d
patch link:    https://lore.kernel.org/r/20251010011951.2136980-6-surenb%40google.com
patch subject: [PATCH 5/8] mm/tests: add cleancache kunit test
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20251011/202510111059.aKceYLLH-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/20251011/202510111059.aKceYLLH-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510111059.aKceYLLH-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/tests/cleancache_kunit.c:358:6: warning: variable 'unused' set but not used [-Wunused-but-set-variable]
     358 |         int unused = 0;
         |             ^
   1 warning generated.


vim +/unused +358 mm/tests/cleancache_kunit.c

   353	
   354	static void cleancache_backend_api_test(struct kunit *test)
   355	{
   356		struct folio *folio;
   357		LIST_HEAD(folios);
 > 358		int unused = 0;
   359		int used = 0;
   360	
   361		/* Store inode folios into cleancache */
   362		fill_cleancache(test);
   363	
   364		/* Get all donated folios back */
   365		for (int fidx = 0; fidx < FOLIO_COUNT; fidx++) {
   366			KUNIT_EXPECT_EQ(test, cleancache_backend_get_folio(test_data.pool_id,
   367							test_data.pool_folios[fidx]),  0);
   368			set_page_refcounted(&test_data.pool_folios[fidx]->page);
   369		}
   370	
   371		/* Try putting a refcounted folio */
   372		KUNIT_EXPECT_NE(test, cleancache_backend_put_folio(test_data.pool_id,
   373						test_data.pool_folios[0]), 0);
   374	
   375		/* Put some of the folios back into cleancache */
   376		for (int fidx = 0; fidx < FOLIOS_PER_INODE; fidx++) {
   377			folio_ref_freeze(test_data.pool_folios[fidx], 1);
   378			KUNIT_EXPECT_EQ(test, cleancache_backend_put_folio(test_data.pool_id,
   379							test_data.pool_folios[fidx]), 0);
   380		}
   381	
   382		/* Put the rest back into cleancache but keep half of folios still refcounted */
   383		for (int fidx = FOLIOS_PER_INODE; fidx < FOLIO_COUNT; fidx++) {
   384			if (fidx % 2) {
   385				folio_ref_freeze(test_data.pool_folios[fidx], 1);
   386				unused++;
   387			} else {
   388				used++;
   389			}
   390			list_add(&test_data.pool_folios[fidx]->lru, &folios);
   391		}
   392		KUNIT_EXPECT_NE(test, cleancache_backend_put_folios(test_data.pool_id,
   393						&folios), 0);
   394		/* Used folios should be still in the list */
   395		KUNIT_EXPECT_EQ(test, list_count_nodes(&folios), used);
   396	
   397		/* Release refcounts and put the remaining folios into cleancache */
   398		list_for_each_entry(folio, &folios, lru)
   399			folio_ref_freeze(folio, 1);
   400		KUNIT_EXPECT_EQ(test, cleancache_backend_put_folios(test_data.pool_id,
   401						&folios), 0);
   402		KUNIT_EXPECT_TRUE(test, list_empty(&folios));
   403	}
   404	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ