Re: [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid

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

 



Hi Trond,

I love your patch! Yet something to improve:

[auto build test ERROR on nfs/linux-next]
[also build test ERROR on v4.17 next-20180615]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Trond-Myklebust/pNFS-Always-free-the-session-slot-on-error-in-nfs4_layoutget_handle_exception/20180616-064706
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: x86_64-randconfig-x011-201823 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   fs/nfs/nfs4proc.c: In function 'nfs4_close_prepare':
>> fs/nfs/nfs4proc.c:3342:13: error: implicit declaration of function 'pnfs_layout_is_valid'; did you mean 'pnfs_layoutcommit_inode'? [-Werror=implicit-function-declaration]
     if (lo && !pnfs_layout_is_valid(lo)) {
                ^~~~~~~~~~~~~~~~~~~~
                pnfs_layoutcommit_inode
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
   Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_write
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:set_bit
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:clear_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:test_and_clear_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 arch/x86/include/asm/current.h:get_current
   Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_set
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_dec_and_test
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_64.h:arch_atomic64_read
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_64.h:arch_atomic64_set
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic64_read
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_set
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic64_set
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_dec_and_test
   Cyclomatic Complexity 1 include/linux/jump_label.h:static_key_count
   Cyclomatic Complexity 1 include/linux/string.h:strnlen
   Cyclomatic Complexity 4 include/linux/string.h:strlen
   Cyclomatic Complexity 3 include/linux/string.h:memset
   Cyclomatic Complexity 4 include/linux/string.h:memcpy
   Cyclomatic Complexity 4 include/linux/string.h:memcmp
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 1 include/linux/err.h:ERR_CAST
   Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_add
   Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_sub
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
   Cyclomatic Complexity 1 include/linux/seqlock.h:raw_seqcount_begin
   Cyclomatic Complexity 1 include/linux/seqlock.h:raw_write_seqcount_begin
   Cyclomatic Complexity 1 include/linux/seqlock.h:raw_write_seqcount_end
   Cyclomatic Complexity 1 include/linux/nodemask.h:node_state
   Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_lock
   Cyclomatic Complexity 1 include/linux/rcupdate.h:__rcu_read_unlock
   Cyclomatic Complexity 1 include/linux/rcutiny.h:rcu_is_watching
   Cyclomatic Complexity 1 arch/x86/include/asm/topology.h:numa_node_id
   Cyclomatic Complexity 1 include/linux/topology.h:numa_mem_id
   Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_count
   Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test
   Cyclomatic Complexity 1 include/linux/dcache.h:d_really_is_negative
   Cyclomatic Complexity 1 include/linux/dcache.h:d_really_is_positive
   Cyclomatic Complexity 1 include/linux/dcache.h:d_inode
   Cyclomatic Complexity 1 include/linux/fs.h:i_size_read
   Cyclomatic Complexity 1 include/linux/mm.h:page_zonenum
   Cyclomatic Complexity 1 include/linux/mm.h:is_zone_device_page
   Cyclomatic Complexity 3 include/linux/memremap.h:is_device_private_page
   Cyclomatic Complexity 3 include/linux/memremap.h:is_device_public_page
   Cyclomatic Complexity 1 include/linux/mm.h:lowmem_page_address
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_set
   Cyclomatic Complexity 1 include/linux/refcount.h:refcount_read
   Cyclomatic Complexity 1 include/linux/sched.h:task_thread_info
   Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace
   Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large
   Cyclomatic Complexity 3 include/linux/slab.h:kmalloc
   Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
   Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_inc
   Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_dec
   Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disable
   Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_enable
   Cyclomatic Complexity 1 include/linux/kref.h:kref_init
   Cyclomatic Complexity 1 include/linux/signal.h:sigismember
   Cyclomatic Complexity 1 include/linux/unaligned/access_ok.h:put_unaligned_be64
   Cyclomatic Complexity 1 include/linux/sunrpc/xdr.h:xdr_encode_hyper
   Cyclomatic Complexity 2 include/linux/sunrpc/auth.h:get_rpccred
   Cyclomatic Complexity 1 include/linux/nfs.h:nfs_copy_fh
   Cyclomatic Complexity 2 include/linux/nfs4.h:seqid_mutating_err
   Cyclomatic Complexity 1 include/linux/highmem.h:kmap_atomic
   Cyclomatic Complexity 1 include/linux/highmem.h:__kunmap_atomic
   Cyclomatic Complexity 3 include/linux/nfs_xdr.h:nfs_fsid_equal
   Cyclomatic Complexity 1 include/linux/nfs_fs.h:NFS_SB
   Cyclomatic Complexity 1 include/linux/nfs_fs.h:NFS_SERVER
   Cyclomatic Complexity 1 include/linux/nfs_fs.h:NFS_CLIENT
   Cyclomatic Complexity 1 include/linux/nfs_fs.h:nfs_set_verifier
   Cyclomatic Complexity 1 include/linux/nfs_fs.h:nfs_display_fhandle
   Cyclomatic Complexity 1 include/linux/nfs_fs.h:nfs_file_open_context
   Cyclomatic Complexity 1 include/linux/iversion.h:inode_set_iversion_raw
   Cyclomatic Complexity 1 include/linux/iversion.h:inode_peek_iversion_raw
   Cyclomatic Complexity 2 fs/nfs/nfs4_fs.h:nfs_confirm_seqid
   Cyclomatic Complexity 1 fs/nfs/nfs4_fs.h:nfs4_state_protect
   Cyclomatic Complexity 1 fs/nfs/nfs4_fs.h:nfs4_state_protect_write
   Cyclomatic Complexity 1 fs/nfs/nfs4_fs.h:nfs4_schedule_session_recovery
   Cyclomatic Complexity 1 fs/nfs/nfs4_fs.h:nfs4_stateid_copy
   Cyclomatic Complexity 2 fs/nfs/nfs4_fs.h:nfs4_stateid_match
   Cyclomatic Complexity 1 fs/nfs/nfs4_fs.h:nfs4_stateid_match_other
   Cyclomatic Complexity 1 fs/nfs/nfs4_fs.h:nfs4_valid_open_stateid
   Cyclomatic Complexity 3 fs/nfs/nfs4_fs.h:nfs4_state_match_open_stateid_other
   Cyclomatic Complexity 1 fs/nfs/internal.h:nfs4_label_alloc

vim +3342 fs/nfs/nfs4proc.c

  3291	
  3292	static void nfs4_close_prepare(struct rpc_task *task, void *data)
  3293	{
  3294		struct nfs4_closedata *calldata = data;
  3295		struct nfs4_state *state = calldata->state;
  3296		struct inode *inode = calldata->inode;
  3297		struct pnfs_layout_hdr *lo;
  3298		bool is_rdonly, is_wronly, is_rdwr;
  3299		int call_close = 0;
  3300	
  3301		dprintk("%s: begin!\n", __func__);
  3302		if (nfs_wait_on_sequence(calldata->arg.seqid, task) != 0)
  3303			goto out_wait;
  3304	
  3305		task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_DOWNGRADE];
  3306		spin_lock(&state->owner->so_lock);
  3307		is_rdwr = test_bit(NFS_O_RDWR_STATE, &state->flags);
  3308		is_rdonly = test_bit(NFS_O_RDONLY_STATE, &state->flags);
  3309		is_wronly = test_bit(NFS_O_WRONLY_STATE, &state->flags);
  3310		/* Calculate the change in open mode */
  3311		calldata->arg.fmode = 0;
  3312		if (state->n_rdwr == 0) {
  3313			if (state->n_rdonly == 0)
  3314				call_close |= is_rdonly;
  3315			else if (is_rdonly)
  3316				calldata->arg.fmode |= FMODE_READ;
  3317			if (state->n_wronly == 0)
  3318				call_close |= is_wronly;
  3319			else if (is_wronly)
  3320				calldata->arg.fmode |= FMODE_WRITE;
  3321			if (calldata->arg.fmode != (FMODE_READ|FMODE_WRITE))
  3322				call_close |= is_rdwr;
  3323		} else if (is_rdwr)
  3324			calldata->arg.fmode |= FMODE_READ|FMODE_WRITE;
  3325	
  3326		if (!nfs4_valid_open_stateid(state) ||
  3327		    !nfs4_refresh_open_stateid(&calldata->arg.stateid, state))
  3328			call_close = 0;
  3329		spin_unlock(&state->owner->so_lock);
  3330	
  3331		if (!call_close) {
  3332			/* Note: exit _without_ calling nfs4_close_done */
  3333			goto out_no_action;
  3334		}
  3335	
  3336		if (!calldata->lr.roc && nfs4_wait_on_layoutreturn(inode, task)) {
  3337			nfs_release_seqid(calldata->arg.seqid);
  3338			goto out_wait;
  3339		}
  3340	
  3341		lo = calldata->arg.lr_args ? calldata->arg.lr_args->layout : NULL;
> 3342		if (lo && !pnfs_layout_is_valid(lo)) {
  3343			calldata->arg.lr_args = NULL;
  3344			calldata->res.lr_res = NULL;
  3345		}
  3346	
  3347		if (calldata->arg.fmode == 0)
  3348			task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE];
  3349	
  3350		if (calldata->arg.fmode == 0 || calldata->arg.fmode == FMODE_READ) {
  3351			/* Close-to-open cache consistency revalidation */
  3352			if (!nfs4_have_delegation(inode, FMODE_READ))
  3353				calldata->arg.bitmask = NFS_SERVER(inode)->cache_consistency_bitmask;
  3354			else
  3355				calldata->arg.bitmask = NULL;
  3356		}
  3357	
  3358		calldata->arg.share_access =
  3359			nfs4_map_atomic_open_share(NFS_SERVER(inode),
  3360					calldata->arg.fmode, 0);
  3361	
  3362		if (calldata->res.fattr == NULL)
  3363			calldata->arg.bitmask = NULL;
  3364		else if (calldata->arg.bitmask == NULL)
  3365			calldata->res.fattr = NULL;
  3366		calldata->timestamp = jiffies;
  3367		if (nfs4_setup_sequence(NFS_SERVER(inode)->nfs_client,
  3368					&calldata->arg.seq_args,
  3369					&calldata->res.seq_res,
  3370					task) != 0)
  3371			nfs_release_seqid(calldata->arg.seqid);
  3372		dprintk("%s: done!\n", __func__);
  3373		return;
  3374	out_no_action:
  3375		task->tk_action = NULL;
  3376	out_wait:
  3377		nfs4_sequence_done(task, &calldata->res.seq_res);
  3378	}
  3379	

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

Attachment: .config.gz
Description: application/gzip


[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