Re: [PATCH 5/5] NFSv4.x: Allow multiple callbacks in flight

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

 



Hi Trond,

[auto build test ERROR on v4.5-rc1]
[also build test ERROR on next-20160125]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Trond-Myklebust/Convert-client-back-channel-to-use-session-slot-table/20160125-221141
config: x86_64-randconfig-x013-01250526 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

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

   In file included from include/linux/linkage.h:4:0,
                    from include/linux/kernel.h:6,
                    from fs/nfs/nfs4session.c:7:
   fs/nfs/nfs4session.c: In function 'nfs4_try_to_lock_slot':
>> fs/nfs/nfs4session.c:157:6: error: implicit declaration of function 'nfs4_test_locked_slot' [-Werror=implicit-function-declaration]
     if (nfs4_test_locked_slot(tbl, slot->slot_nr))
         ^
   include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
     if (__builtin_constant_p((cond)) ? !!(cond) :   \
                               ^
>> fs/nfs/nfs4session.c:157:2: note: in expansion of macro 'if'
     if (nfs4_test_locked_slot(tbl, slot->slot_nr))
     ^
   cc1: some warnings being treated as errors

vim +/nfs4_test_locked_slot +157 fs/nfs/nfs4session.c

     1	/*
     2	 * fs/nfs/nfs4session.c
     3	 *
     4	 * Copyright (c) 2012 Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
     5	 *
     6	 */
   > 7	#include <linux/kernel.h>
     8	#include <linux/errno.h>
     9	#include <linux/string.h>
    10	#include <linux/printk.h>
    11	#include <linux/slab.h>
    12	#include <linux/sunrpc/sched.h>
    13	#include <linux/sunrpc/bc_xprt.h>
    14	#include <linux/nfs.h>
    15	#include <linux/nfs4.h>
    16	#include <linux/nfs_fs.h>
    17	#include <linux/module.h>
    18	
    19	#include "nfs4_fs.h"
    20	#include "internal.h"
    21	#include "nfs4session.h"
    22	#include "callback.h"
    23	
    24	#define NFSDBG_FACILITY		NFSDBG_STATE
    25	
    26	static void nfs4_init_slot_table(struct nfs4_slot_table *tbl, const char *queue)
    27	{
    28		tbl->highest_used_slotid = NFS4_NO_SLOT;
    29		spin_lock_init(&tbl->slot_tbl_lock);
    30		rpc_init_priority_wait_queue(&tbl->slot_tbl_waitq, queue);
    31		init_completion(&tbl->complete);
    32	}
    33	
    34	/*
    35	 * nfs4_shrink_slot_table - free retired slots from the slot table
    36	 */
    37	static void nfs4_shrink_slot_table(struct nfs4_slot_table  *tbl, u32 newsize)
    38	{
    39		struct nfs4_slot **p;
    40		if (newsize >= tbl->max_slots)
    41			return;
    42	
    43		p = &tbl->slots;
    44		while (newsize--)
    45			p = &(*p)->next;
    46		while (*p) {
    47			struct nfs4_slot *slot = *p;
    48	
    49			*p = slot->next;
    50			kfree(slot);
    51			tbl->max_slots--;
    52		}
    53	}
    54	
    55	/**
    56	 * nfs4_slot_tbl_drain_complete - wake waiters when drain is complete
    57	 * @tbl - controlling slot table
    58	 *
    59	 */
    60	void nfs4_slot_tbl_drain_complete(struct nfs4_slot_table *tbl)
    61	{
    62		if (nfs4_slot_tbl_draining(tbl))
    63			complete(&tbl->complete);
    64	}
    65	
    66	/*
    67	 * nfs4_free_slot - free a slot and efficiently update slot table.
    68	 *
    69	 * freeing a slot is trivially done by clearing its respective bit
    70	 * in the bitmap.
    71	 * If the freed slotid equals highest_used_slotid we want to update it
    72	 * so that the server would be able to size down the slot table if needed,
    73	 * otherwise we know that the highest_used_slotid is still in use.
    74	 * When updating highest_used_slotid there may be "holes" in the bitmap
    75	 * so we need to scan down from highest_used_slotid to 0 looking for the now
    76	 * highest slotid in use.
    77	 * If none found, highest_used_slotid is set to NFS4_NO_SLOT.
    78	 *
    79	 * Must be called while holding tbl->slot_tbl_lock
    80	 */
    81	void nfs4_free_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot)
    82	{
    83		u32 slotid = slot->slot_nr;
    84	
    85		/* clear used bit in bitmap */
    86		__clear_bit(slotid, tbl->used_slots);
    87	
    88		/* update highest_used_slotid when it is freed */
    89		if (slotid == tbl->highest_used_slotid) {
    90			u32 new_max = find_last_bit(tbl->used_slots, slotid);
    91			if (new_max < slotid)
    92				tbl->highest_used_slotid = new_max;
    93			else {
    94				tbl->highest_used_slotid = NFS4_NO_SLOT;
    95				nfs4_slot_tbl_drain_complete(tbl);
    96			}
    97		}
    98		dprintk("%s: slotid %u highest_used_slotid %u\n", __func__,
    99			slotid, tbl->highest_used_slotid);
   100	}
   101	
   102	static struct nfs4_slot *nfs4_new_slot(struct nfs4_slot_table  *tbl,
   103			u32 slotid, u32 seq_init, gfp_t gfp_mask)
   104	{
   105		struct nfs4_slot *slot;
   106	
   107		slot = kzalloc(sizeof(*slot), gfp_mask);
   108		if (slot) {
   109			slot->table = tbl;
   110			slot->slot_nr = slotid;
   111			slot->seq_nr = seq_init;
   112		}
   113		return slot;
   114	}
   115	
   116	static struct nfs4_slot *nfs4_find_or_create_slot(struct nfs4_slot_table  *tbl,
   117			u32 slotid, u32 seq_init, gfp_t gfp_mask)
   118	{
   119		struct nfs4_slot **p, *slot;
   120	
   121		p = &tbl->slots;
   122		for (;;) {
   123			if (*p == NULL) {
   124				*p = nfs4_new_slot(tbl, tbl->max_slots,
   125						seq_init, gfp_mask);
   126				if (*p == NULL)
   127					break;
   128				tbl->max_slots++;
   129			}
   130			slot = *p;
   131			if (slot->slot_nr == slotid)
   132				return slot;
   133			p = &slot->next;
   134		}
   135		return ERR_PTR(-ENOMEM);
   136	}
   137	
   138	static void nfs4_lock_slot(struct nfs4_slot_table *tbl,
   139			struct nfs4_slot *slot)
   140	{
   141		u32 slotid = slot->slot_nr;
   142	
   143		__set_bit(slotid, tbl->used_slots);
   144		if (slotid > tbl->highest_used_slotid ||
   145		    tbl->highest_used_slotid == NFS4_NO_SLOT)
   146			tbl->highest_used_slotid = slotid;
   147		slot->generation = tbl->generation;
   148	}
   149	
   150	/*
   151	 * nfs4_try_to_lock_slot - Given a slot try to allocate it
   152	 *
   153	 * Note: must be called with the slot_tbl_lock held.
   154	 */
   155	bool nfs4_try_to_lock_slot(struct nfs4_slot_table *tbl, struct nfs4_slot *slot)
   156	{
 > 157		if (nfs4_test_locked_slot(tbl, slot->slot_nr))
   158			return false;
   159		nfs4_lock_slot(tbl, slot);
   160		return true;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux