Commit 76ff294e authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfs-for-5.19-3' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull NFS client fixes from Anna Schumaker:

 - Allocate a fattr for _nfs4_discover_trunking()

 - Fix module reference count leak in nfs4_run_state_manager()

* tag 'nfs-for-5.19-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
  NFSv4: Add an fattr allocation to _nfs4_discover_trunking()
  NFS: restore module put when manager exits.
parents 6f8693ea 4f40a5b5
......@@ -4012,22 +4012,29 @@ static int _nfs4_discover_trunking(struct nfs_server *server,
}
page = alloc_page(GFP_KERNEL);
if (!page)
return -ENOMEM;
locations = kmalloc(sizeof(struct nfs4_fs_locations), GFP_KERNEL);
if (page == NULL || locations == NULL)
goto out;
if (!locations)
goto out_free;
locations->fattr = nfs_alloc_fattr();
if (!locations->fattr)
goto out_free_2;
status = nfs4_proc_get_locations(server, fhandle, locations, page,
cred);
if (status)
goto out;
goto out_free_3;
for (i = 0; i < locations->nlocations; i++)
test_fs_location_for_trunking(&locations->locations[i], clp,
server);
out:
if (page)
__free_page(page);
out_free_3:
kfree(locations->fattr);
out_free_2:
kfree(locations);
out_free:
__free_page(page);
return status;
}
......
......@@ -2753,5 +2753,6 @@ static int nfs4_run_state_manager(void *ptr)
goto again;
nfs_put_client(clp);
module_put_and_kthread_exit(0);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment