Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFS: simplify error handling in nfs_end_delegation_return

Drop the pointless delegation->lock held over setting multiple
atomic bits in different structures, and use separate labels
for the delay vs abort cases.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>

authored by

Christoph Hellwig and committed by
Anna Schumaker
94b88865 f7550318

+10 -13
+10 -13
fs/nfs/delegation.c
··· 570 570 break; 571 571 err = nfs_delegation_claim_opens(inode, &delegation->stateid, 572 572 delegation->type); 573 - if (!issync || err != -EAGAIN) 573 + if (!err) 574 574 break; 575 + if (err != -EAGAIN) 576 + goto abort; 577 + if (!issync) 578 + goto delay; 579 + 575 580 /* 576 581 * Guard against state recovery 577 582 */ 578 583 err = nfs4_wait_clnt_recover(server->nfs_client); 579 584 } 580 585 581 - if (err) 582 - goto abort; 583 - 584 586 out_return: 585 587 return nfs_do_return_delegation(inode, delegation, issync); 588 + delay: 589 + set_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags); 590 + set_bit(NFS4SERV_DELEGRETURN_DELAYED, &server->delegation_flags); 591 + set_bit(NFS4CLNT_DELEGRETURN_DELAYED, &server->nfs_client->cl_state); 586 592 abort: 587 - spin_lock(&delegation->lock); 588 593 clear_bit(NFS_DELEGATION_RETURNING, &delegation->flags); 589 - if (err == -EAGAIN) { 590 - set_bit(NFS_DELEGATION_RETURN_DELAYED, &delegation->flags); 591 - set_bit(NFS4SERV_DELEGRETURN_DELAYED, 592 - &server->delegation_flags); 593 - set_bit(NFS4CLNT_DELEGRETURN_DELAYED, 594 - &server->nfs_client->cl_state); 595 - } 596 - spin_unlock(&delegation->lock); 597 594 return err; 598 595 } 599 596