* [PATCH 1/2] pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception
@ 2018-06-15 22:42 Trond Myklebust
2018-06-15 22:42 ` [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid Trond Myklebust
0 siblings, 1 reply; 4+ messages in thread
From: Trond Myklebust @ 2018-06-15 22:42 UTC (permalink / raw)
To: linux-nfs
Right now, we can call nfs_commit_inode() while holding the session slot,
which could lead to NFSv4 deadlocks. Ensure we only keep the slot if
the server returned a layout that we have to process.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
fs/nfs/nfs4proc.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ed45090e4df6..2c8c2696415e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -8650,6 +8650,8 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
dprintk("--> %s tk_status => %d\n", __func__, -task->tk_status);
+ nfs4_sequence_free_slot(&lgp->res.seq_res);
+
switch (nfs4err) {
case 0:
goto out;
@@ -8714,7 +8716,6 @@ nfs4_layoutget_handle_exception(struct rpc_task *task,
goto out;
}
- nfs4_sequence_free_slot(&lgp->res.seq_res);
err = nfs4_handle_exception(server, nfs4err, exception);
if (!status) {
if (exception->retry)
@@ -8786,20 +8787,22 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout)
if (IS_ERR(task))
return ERR_CAST(task);
status = rpc_wait_for_completion_task(task);
- if (status == 0) {
+ if (status != 0)
+ goto out;
+
+ /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */
+ if (task->tk_status < 0 || lgp->res.layoutp->len == 0) {
status = nfs4_layoutget_handle_exception(task, lgp, &exception);
*timeout = exception.timeout;
- }
-
+ } else
+ lseg = pnfs_layout_process(lgp);
+out:
trace_nfs4_layoutget(lgp->args.ctx,
&lgp->args.range,
&lgp->res.range,
&lgp->res.stateid,
status);
- /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */
- if (status == 0 && lgp->res.layoutp->len)
- lseg = pnfs_layout_process(lgp);
rpc_put_task(task);
dprintk("<-- %s status=%d\n", __func__, status);
if (status)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid
2018-06-15 22:42 [PATCH 1/2] pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception Trond Myklebust
@ 2018-06-15 22:42 ` Trond Myklebust
2018-06-16 1:37 ` kbuild test robot
2018-06-16 1:37 ` kbuild test robot
0 siblings, 2 replies; 4+ messages in thread
From: Trond Myklebust @ 2018-06-15 22:42 UTC (permalink / raw)
To: linux-nfs
If the layout was invalidated due to a reboot, then don't try to send
a layoutreturn for it.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
---
fs/nfs/nfs4proc.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 2c8c2696415e..6dd146885da9 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3294,6 +3294,7 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
struct nfs4_closedata *calldata = data;
struct nfs4_state *state = calldata->state;
struct inode *inode = calldata->inode;
+ struct pnfs_layout_hdr *lo;
bool is_rdonly, is_wronly, is_rdwr;
int call_close = 0;
@@ -3337,6 +3338,12 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
goto out_wait;
}
+ lo = calldata->arg.lr_args ? calldata->arg.lr_args->layout : NULL;
+ if (lo && !pnfs_layout_is_valid(lo)) {
+ calldata->arg.lr_args = NULL;
+ calldata->res.lr_res = NULL;
+ }
+
if (calldata->arg.fmode == 0)
task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE];
@@ -5972,12 +5979,19 @@ static void nfs4_delegreturn_release(void *calldata)
static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data)
{
struct nfs4_delegreturndata *d_data;
+ struct pnfs_layout_hdr *lo;
d_data = (struct nfs4_delegreturndata *)data;
if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task))
return;
+ lo = d_data->args.lr_args ? d_data->args.lr_args->layout : NULL;
+ if (lo && !pnfs_layout_is_valid(lo)) {
+ d_data->args.lr_args = NULL;
+ d_data->res.lr_res = NULL;
+ }
+
nfs4_setup_sequence(d_data->res.server->nfs_client,
&d_data->args.seq_args,
&d_data->res.seq_res,
@@ -8820,6 +8834,8 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata)
&lrp->args.seq_args,
&lrp->res.seq_res,
task);
+ if (!pnfs_layout_is_valid(lrp->args.layout))
+ rpc_exit(task, 0);
}
static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid
2018-06-15 22:42 ` [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid Trond Myklebust
2018-06-16 1:37 ` kbuild test robot
@ 2018-06-16 1:37 ` kbuild test robot
1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2018-06-16 1:37 UTC (permalink / raw)
To: Trond Myklebust; +Cc: kbuild-all, linux-nfs
[-- Attachment #1: Type: text/plain, Size: 11483 bytes --]
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: i386-randconfig-s0-201823 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
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' [-Werror=implicit-function-declaration]
if (lo && !pnfs_layout_is_valid(lo)) {
^~~~~~~~~~~~~~~~~~~~
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:fls
Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32
Cyclomatic Complexity 1 arch/x86/include/asm/current.h:get_current
Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_check
Cyclomatic Complexity 1 include/linux/cpumask.h:cpumask_test_cpu
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 2 arch/x86/include/asm/atomic.h:arch_atomic_try_cmpxchg
Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_32.h:arch_atomic64_set
Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_32.h:arch_atomic64_read
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_try_cmpxchg
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 2 include/linux/jump_label.h:static_key_false
Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:arch_local_save_flags
Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:arch_local_irq_restore
Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:arch_local_irq_disable
Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:arch_local_irq_save
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:IS_ERR
Cyclomatic Complexity 1 include/linux/err.h:ERR_CAST
Cyclomatic Complexity 1 arch/x86/include/asm/irqflags.h:arch_irqs_disabled_flags
Cyclomatic Complexity 1 arch/x86/include/asm/processor.h:rep_nop
Cyclomatic Complexity 1 arch/x86/include/asm/processor.h:cpu_relax
Cyclomatic Complexity 2 include/linux/thread_info.h:test_ti_thread_flag
Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_add
Cyclomatic Complexity 1 arch/x86/include/asm/preempt.h:__preempt_count_dec_and_test
Cyclomatic Complexity 1 arch/x86/include/asm/preempt.h:should_resched
Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock
Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
Cyclomatic Complexity 2 include/linux/seqlock.h:seqcount_lockdep_reader_access
Cyclomatic Complexity 2 include/linux/seqlock.h:__read_seqcount_begin
Cyclomatic Complexity 1 include/linux/seqlock.h:raw_read_seqcount_begin
Cyclomatic Complexity 1 include/linux/seqlock.h:read_seqcount_begin
Cyclomatic Complexity 1 include/linux/seqlock.h:raw_seqcount_begin
Cyclomatic Complexity 1 include/linux/seqlock.h:__read_seqcount_retry
Cyclomatic Complexity 1 include/linux/seqlock.h:read_seqcount_retry
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/seqlock.h:write_seqcount_begin_nested
Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqcount_begin
Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqcount_end
Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqlock
Cyclomatic Complexity 1 include/linux/seqlock.h:write_sequnlock
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_lock_acquire
Cyclomatic Complexity 1 include/linux/rcupdate.h:rcu_lock_release
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/rcupdate.h:rcu_read_lock_sched_notrace
Cyclomatic Complexity 2 include/linux/rcupdate.h:rcu_read_unlock_sched_notrace
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/gfp.h:__alloc_pages
Cyclomatic Complexity 1 include/linux/gfp.h:__alloc_pages_node
Cyclomatic Complexity 2 include/linux/gfp.h:alloc_pages_node
Cyclomatic Complexity 2 include/linux/page-flags.h:compound_head
Cyclomatic Complexity 1 include/linux/page_ref.h:page_ref_dec_and_test
Cyclomatic Complexity 2 include/linux/dcache.h:dget
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 2 include/linux/fs.h:i_size_read
Cyclomatic Complexity 1 include/linux/mm.h:put_page_testzero
Cyclomatic Complexity 2 include/linux/mm.h:put_page
Cyclomatic Complexity 1 include/linux/mm.h:lowmem_page_address
Cyclomatic Complexity 1 include/linux/delay.h:ssleep
Cyclomatic Complexity 1 include/linux/refcount.h:refcount_set
Cyclomatic Complexity 1 include/linux/refcount.h:refcount_read
Cyclomatic Complexity 1 arch/x86/include/asm/refcount.h:refcount_inc
Cyclomatic Complexity 1 arch/x86/include/asm/refcount.h:refcount_dec_and_test
Cyclomatic Complexity 5 arch/x86/include/asm/refcount.h:refcount_add_not_zero
Cyclomatic Complexity 1 arch/x86/include/asm/refcount.h:refcount_inc_not_zero
Cyclomatic Complexity 1 arch/x86/include/asm/signal.h:__const_sigismember
Cyclomatic Complexity 1 include/linux/sched.h:task_thread_info
Cyclomatic Complexity 1 include/linux/sched.h:test_tsk_thread_flag
Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index
Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large
Cyclomatic Complexity 5 include/linux/slab.h:kmalloc
Cyclomatic Complexity 1 include/linux/slab.h:kzalloc
Cyclomatic Complexity 1 include/linux/uaccess.h:pagefault_disabled_inc
vim +/pnfs_layout_is_valid +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 #2: .config.gz --]
[-- Type: application/gzip, Size: 34867 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid
2018-06-15 22:42 ` [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid Trond Myklebust
@ 2018-06-16 1:37 ` kbuild test robot
2018-06-16 1:37 ` kbuild test robot
1 sibling, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2018-06-16 1:37 UTC (permalink / raw)
To: Trond Myklebust; +Cc: kbuild-all, linux-nfs
[-- Attachment #1: Type: text/plain, Size: 11210 bytes --]
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 #2: .config.gz --]
[-- Type: application/gzip, Size: 20396 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-06-16 1:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15 22:42 [PATCH 1/2] pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception Trond Myklebust
2018-06-15 22:42 ` [PATCH 2/2] pNFS: Don't send layoutreturn if the layout is already invalid Trond Myklebust
2018-06-16 1:37 ` kbuild test robot
2018-06-16 1:37 ` kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).