Revert "NFSv4: Prevent NULL-pointer dereference in nfs42_complete_copies()"

This reverts commit 4bb48602f3.
This commit is contained in:
Ksawlii 2024-11-24 00:22:57 +01:00
parent ef7d05955f
commit 0381b2073a
4 changed files with 2 additions and 4 deletions

View file

@ -927,7 +927,6 @@ struct nfs_server *nfs_alloc_server(void)
INIT_LIST_HEAD(&server->layouts);
INIT_LIST_HEAD(&server->state_owners_lru);
INIT_LIST_HEAD(&server->ss_copies);
INIT_LIST_HEAD(&server->ss_src_copies);
atomic_set(&server->active, 0);

View file

@ -210,7 +210,7 @@ static int handle_async_copy(struct nfs42_copy_res *res,
if (dst_server != src_server) {
spin_lock(&src_server->nfs_client->cl_lock);
list_add_tail(&copy->src_copies, &src_server->ss_src_copies);
list_add_tail(&copy->src_copies, &src_server->ss_copies);
spin_unlock(&src_server->nfs_client->cl_lock);
}

View file

@ -1596,7 +1596,7 @@ static void nfs42_complete_copies(struct nfs4_state_owner *sp, struct nfs4_state
complete(&copy->completion);
}
}
list_for_each_entry(copy, &sp->so_server->ss_src_copies, src_copies) {
list_for_each_entry(copy, &sp->so_server->ss_copies, src_copies) {
if ((test_bit(NFS_CLNT_SRC_SSC_COPY_STATE, &state->flags) &&
!nfs4_stateid_match_other(&state->stateid,
&copy->parent_src_state->stateid)))

View file

@ -230,7 +230,6 @@ struct nfs_server {
struct list_head layouts;
struct list_head delegations;
struct list_head ss_copies;
struct list_head ss_src_copies;
unsigned long mig_gen;
unsigned long mig_status;