Skip to content

Commit

Permalink
nfsd4: Fix filp leak
Browse files Browse the repository at this point in the history
23fcf2e (nfsd4: fix oops on lock failure)

The above patch breaks free path for stp->st_file. If stp was inserted
into sop->so_stateids, we have to free stp->st_file refcount. Because
stp->st_file refcount itself is taken whether or not any refcounts are
taken on the stp->st_file->fi_fds[].

Signed-off-by: OGAWA Hirofumi <[email protected]>
Cc: [email protected]
Signed-off-by: J. Bruce Fields <[email protected]>
  • Loading branch information
OGAWAHirofumi authored and J. Bruce Fields committed Apr 19, 2011
1 parent 4ee6362 commit a96e5b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ static void free_generic_stateid(struct nfs4_stateid *stp)
if (stp->st_access_bmap) {
oflag = nfs4_access_bmap_to_omode(stp);
nfs4_file_put_access(stp->st_file, oflag);
put_nfs4_file(stp->st_file);
}
put_nfs4_file(stp->st_file);
kmem_cache_free(stateid_slab, stp);
}

Expand Down

0 comments on commit a96e5b9

Please sign in to comment.