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

Configure Feed

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

NFS: Avoid unnecessary rescanning of the per-server delegation list

If the call to nfs_delegation_grab_inode() fails, we will not have
dropped any locks that require us to rescan the list.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

Trond Myklebust and committed by
Anna Schumaker
f92214e4 d72b7963

+5 -10
+5 -10
fs/nfs/delegation.c
··· 647 647 prev = delegation; 648 648 continue; 649 649 } 650 + inode = nfs_delegation_grab_inode(delegation); 651 + if (inode == NULL) 652 + continue; 650 653 651 654 if (prev) { 652 655 struct inode *tmp = nfs_delegation_grab_inode(prev); ··· 660 657 } 661 658 } 662 659 663 - inode = nfs_delegation_grab_inode(delegation); 664 - if (inode == NULL) { 665 - rcu_read_unlock(); 666 - iput(to_put); 667 - goto restart; 668 - } 669 660 delegation = nfs_start_delegation_return_locked(NFS_I(inode)); 670 661 rcu_read_unlock(); 671 662 ··· 1181 1184 struct inode *inode; 1182 1185 restart: 1183 1186 rcu_read_lock(); 1184 - restart_locked: 1185 1187 list_for_each_entry_rcu(delegation, &server->delegations, super_list) { 1186 1188 if (test_bit(NFS_DELEGATION_INODE_FREEING, 1187 1189 &delegation->flags) || ··· 1191 1195 continue; 1192 1196 inode = nfs_delegation_grab_inode(delegation); 1193 1197 if (inode == NULL) 1194 - goto restart_locked; 1198 + continue; 1195 1199 delegation = nfs_start_delegation_return_locked(NFS_I(inode)); 1196 1200 rcu_read_unlock(); 1197 1201 if (delegation != NULL) { ··· 1314 1318 1315 1319 restart: 1316 1320 rcu_read_lock(); 1317 - restart_locked: 1318 1321 list_for_each_entry_rcu(delegation, &server->delegations, super_list) { 1319 1322 if (test_bit(NFS_DELEGATION_INODE_FREEING, 1320 1323 &delegation->flags) || ··· 1325 1330 continue; 1326 1331 inode = nfs_delegation_grab_inode(delegation); 1327 1332 if (inode == NULL) 1328 - goto restart_locked; 1333 + continue; 1329 1334 spin_lock(&delegation->lock); 1330 1335 cred = get_cred_rcu(delegation->cred); 1331 1336 nfs4_stateid_copy(&stateid, &delegation->stateid);