Skip to content

Commit

Permalink
Merge tag 'nfs-for-5.19-3' of git://git.linux-nfs.org/projects/anna/l…
Browse files Browse the repository at this point in the history
…inux-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.
  • Loading branch information
Linus Torvalds committed Jul 1, 2022
2 parents 6f8693e + 4f40a5b commit 76ff294
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
19 changes: 13 additions & 6 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 76ff294

Please sign in to comment.