mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
nfs/write: Use common error handling code in nfs_lock_and_join_requests()
Add a jump target so that a bit of exception handling can be better reused at the end of this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
fcd8843c40
commit
0671d8f108
1 changed files with 9 additions and 8 deletions
|
@ -487,10 +487,8 @@ try_again:
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = nfs_page_group_lock(head);
|
ret = nfs_page_group_lock(head);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
nfs_unlock_and_release_request(head);
|
goto release_request;
|
||||||
return ERR_PTR(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* lock each request in the page group */
|
/* lock each request in the page group */
|
||||||
total_bytes = head->wb_bytes;
|
total_bytes = head->wb_bytes;
|
||||||
|
@ -515,8 +513,7 @@ try_again:
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
nfs_unroll_locks(inode, head, subreq);
|
nfs_unroll_locks(inode, head, subreq);
|
||||||
nfs_release_request(subreq);
|
nfs_release_request(subreq);
|
||||||
nfs_unlock_and_release_request(head);
|
goto release_request;
|
||||||
return ERR_PTR(ret);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -532,8 +529,8 @@ try_again:
|
||||||
nfs_page_group_unlock(head);
|
nfs_page_group_unlock(head);
|
||||||
nfs_unroll_locks(inode, head, subreq);
|
nfs_unroll_locks(inode, head, subreq);
|
||||||
nfs_unlock_and_release_request(subreq);
|
nfs_unlock_and_release_request(subreq);
|
||||||
nfs_unlock_and_release_request(head);
|
ret = -EIO;
|
||||||
return ERR_PTR(-EIO);
|
goto release_request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,6 +573,10 @@ try_again:
|
||||||
/* still holds ref on head from nfs_page_find_head_request
|
/* still holds ref on head from nfs_page_find_head_request
|
||||||
* and still has lock on head from lock loop */
|
* and still has lock on head from lock loop */
|
||||||
return head;
|
return head;
|
||||||
|
|
||||||
|
release_request:
|
||||||
|
nfs_unlock_and_release_request(head);
|
||||||
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nfs_write_error_remove_page(struct nfs_page *req)
|
static void nfs_write_error_remove_page(struct nfs_page *req)
|
||||||
|
|
Loading…
Add table
Reference in a new issue