Re: [PATCH 10/13] jfs: Convert inc_io and mp_anchor to take a folio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matthew,

kernel test robot noticed the following build errors:

[auto build test ERROR on kleikamp-shaggy/jfs-next]
[also build test ERROR on linus/master v6.8-rc2 next-20240202]
[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/Matthew-Wilcox-Oracle/jfs-Convert-metapage_read_folio-to-use-folio-APIs/20240202-064805
base:   https://github.com/kleikamp/linux-shaggy jfs-next
patch link:    https://lore.kernel.org/r/20240201224605.4055895-11-willy%40infradead.org
patch subject: [PATCH 10/13] jfs: Convert inc_io and mp_anchor to take a folio
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240203/202402030956.qthlo2BE-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240203/202402030956.qthlo2BE-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402030956.qthlo2BE-lkp@xxxxxxxxx/

All error/warnings (new ones prefixed by >>):

   fs/jfs/jfs_metapage.c: In function 'remove_metapage':
   fs/jfs/jfs_metapage.c:130:38: error: passing argument 1 of 'folio_detach_private' from incompatible pointer type [-Werror=incompatible-pointer-types]
     130 |                 folio_detach_private(&folio->page);
         |                                      ^~~~~~~~~~~~
         |                                      |
         |                                      struct page *
   In file included from include/linux/buffer_head.h:15,
                    from fs/jfs/jfs_metapage.c:14:
   include/linux/pagemap.h:508:56: note: expected 'struct folio *' but argument is of type 'struct page *'
     508 | static inline void *folio_detach_private(struct folio *folio)
         |                                          ~~~~~~~~~~~~~~^~~~~
   fs/jfs/jfs_metapage.c: In function 'inc_io':
>> fs/jfs/jfs_metapage.c:137:37: warning: dereferencing 'void *' pointer
     137 |         atomic_inc(&mp_anchor(folio)->io_count);
         |                                     ^~
>> fs/jfs/jfs_metapage.c:137:37: error: request for member 'io_count' in something not a structure or union
   cc1: some warnings being treated as errors


vim +/io_count +137 fs/jfs/jfs_metapage.c

  > 14	#include <linux/buffer_head.h>
    15	#include <linux/mempool.h>
    16	#include <linux/seq_file.h>
    17	#include <linux/writeback.h>
    18	#include "jfs_incore.h"
    19	#include "jfs_superblock.h"
    20	#include "jfs_filsys.h"
    21	#include "jfs_metapage.h"
    22	#include "jfs_txnmgr.h"
    23	#include "jfs_debug.h"
    24	
    25	#ifdef CONFIG_JFS_STATISTICS
    26	static struct {
    27		uint	pagealloc;	/* # of page allocations */
    28		uint	pagefree;	/* # of page frees */
    29		uint	lockwait;	/* # of sleeping lock_metapage() calls */
    30	} mpStat;
    31	#endif
    32	
    33	#define metapage_locked(mp) test_bit(META_locked, &(mp)->flag)
    34	#define trylock_metapage(mp) test_and_set_bit_lock(META_locked, &(mp)->flag)
    35	
    36	static inline void unlock_metapage(struct metapage *mp)
    37	{
    38		clear_bit_unlock(META_locked, &mp->flag);
    39		wake_up(&mp->wait);
    40	}
    41	
    42	static inline void __lock_metapage(struct metapage *mp)
    43	{
    44		DECLARE_WAITQUEUE(wait, current);
    45		INCREMENT(mpStat.lockwait);
    46		add_wait_queue_exclusive(&mp->wait, &wait);
    47		do {
    48			set_current_state(TASK_UNINTERRUPTIBLE);
    49			if (metapage_locked(mp)) {
    50				unlock_page(mp->page);
    51				io_schedule();
    52				lock_page(mp->page);
    53			}
    54		} while (trylock_metapage(mp));
    55		__set_current_state(TASK_RUNNING);
    56		remove_wait_queue(&mp->wait, &wait);
    57	}
    58	
    59	/*
    60	 * Must have mp->page locked
    61	 */
    62	static inline void lock_metapage(struct metapage *mp)
    63	{
    64		if (trylock_metapage(mp))
    65			__lock_metapage(mp);
    66	}
    67	
    68	#define METAPOOL_MIN_PAGES 32
    69	static struct kmem_cache *metapage_cache;
    70	static mempool_t *metapage_mempool;
    71	
    72	#define MPS_PER_PAGE (PAGE_SIZE >> L2PSIZE)
    73	
    74	#if MPS_PER_PAGE > 1
    75	
    76	struct meta_anchor {
    77		int mp_count;
    78		atomic_t io_count;
    79		struct metapage *mp[MPS_PER_PAGE];
    80	};
    81	#define mp_anchor(folio) (folio->private)
    82	
    83	static inline struct metapage *folio_to_mp(struct folio *folio, int offset)
    84	{
    85		struct meta_anchor *anchor = folio->private;
    86	
    87		if (!anchor)
    88			return NULL;
    89		return anchor->mp[offset >> L2PSIZE];
    90	}
    91	
    92	static inline int insert_metapage(struct folio *folio, struct metapage *mp)
    93	{
    94		struct meta_anchor *a;
    95		int index;
    96		int l2mp_blocks;	/* log2 blocks per metapage */
    97	
    98		a = folio->private;
    99		if (!a) {
   100			a = kzalloc(sizeof(struct meta_anchor), GFP_NOFS);
   101			if (!a)
   102				return -ENOMEM;
   103			folio_attach_private(folio, a);
   104			kmap(&folio->page);
   105		}
   106	
   107		if (mp) {
   108			l2mp_blocks = L2PSIZE - folio->mapping->host->i_blkbits;
   109			index = (mp->index >> l2mp_blocks) & (MPS_PER_PAGE - 1);
   110			a->mp_count++;
   111			a->mp[index] = mp;
   112		}
   113	
   114		return 0;
   115	}
   116	
   117	static inline void remove_metapage(struct folio *folio, struct metapage *mp)
   118	{
   119		struct meta_anchor *a = mp_anchor(folio);
   120		int l2mp_blocks = L2PSIZE - folio->mapping->host->i_blkbits;
   121		int index;
   122	
   123		index = (mp->index >> l2mp_blocks) & (MPS_PER_PAGE - 1);
   124	
   125		BUG_ON(a->mp[index] != mp);
   126	
   127		a->mp[index] = NULL;
   128		if (--a->mp_count == 0) {
   129			kfree(a);
   130			folio_detach_private(&folio->page);
   131			kunmap(&folio->page);
   132		}
   133	}
   134	
   135	static inline void inc_io(struct folio *folio)
   136	{
 > 137		atomic_inc(&mp_anchor(folio)->io_count);
   138	}
   139	

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux