Commit 81e7229
NFSD: fix problems with cleanup on errors in nfsd4_copy
When nfsd4_copy fails to allocate memory for async_copy->cp_src, or
nfs4_init_copy_state fails, it calls cleanup_async_copy to do the
cleanup for the async_copy which causes page fault since async_copy
is not yet initialized.
This patche rearranges the order of initializing the fields in
async_copy and adds checks in cleanup_async_copy to skip un-initialized
fields.
Fixes: ce0887a ("NFSD add nfs4 inter ssc to nfsd4_copy")
Fixes: 87689df ("NFSD: Shrink size of struct nfsd4_copy")
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>1 parent fb610c4 commit 81e7229
2 files changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1687 | 1687 | | |
1688 | 1688 | | |
1689 | 1689 | | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1693 | 1696 | | |
1694 | 1697 | | |
1695 | 1698 | | |
| |||
1786 | 1789 | | |
1787 | 1790 | | |
1788 | 1791 | | |
| 1792 | + | |
| 1793 | + | |
1789 | 1794 | | |
1790 | 1795 | | |
1791 | 1796 | | |
1792 | 1797 | | |
1793 | 1798 | | |
1794 | | - | |
1795 | 1799 | | |
1796 | 1800 | | |
1797 | 1801 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
975 | 975 | | |
976 | 976 | | |
977 | 977 | | |
978 | | - | |
979 | 978 | | |
980 | 979 | | |
981 | 980 | | |
| |||
986 | 985 | | |
987 | 986 | | |
988 | 987 | | |
| 988 | + | |
989 | 989 | | |
990 | 990 | | |
991 | 991 | | |
| |||
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
1022 | | - | |
| 1022 | + | |
| 1023 | + | |
1023 | 1024 | | |
1024 | 1025 | | |
1025 | 1026 | | |
| |||
0 commit comments