]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfs: fix pnfs direct write memory leak
authorPeng Tao <tao.peng@primarydata.com>
Wed, 5 Nov 2014 14:36:50 +0000 (22:36 +0800)
committerJiri Slaby <jslaby@suse.cz>
Wed, 19 Nov 2014 17:38:20 +0000 (18:38 +0100)
commitd0c8187c16fa9294a2ff8fbbe85c15776ca3fa72
tree223a8e30ce8b0dad87ac3ded457db39948cd4967
parent9fb5f68e66142ca36cb0958a12b2f1af47a723bc
nfs: fix pnfs direct write memory leak

commit 8c393f9a721c30a030049a680e1bf896669bb279 upstream.

For pNFS direct writes, layout driver may dynamically allocate ds_cinfo.buckets.
So we need to take care to free them when freeing dreq.

Ideally this needs to be done inside layout driver where ds_cinfo.buckets
are allocated. But buckets are attached to dreq and reused across LD IO iterations.
So I feel it's OK to free them in the generic layer.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/direct.c
include/linux/nfs_xdr.h