2011-01-19 19:19:08

by Fred Isaman

[permalink] [raw]
Subject: [PATCH 1/1] NFS: fix handling of malloc failure during nfs_flush_multi()

Cleanup of the allocated list entries should not call
put_nfs_open_context() on each entry, as the context will
always be NULL, causing an oops.

Signed-off-by: Fred Isaman <[email protected]>
---
fs/nfs/write.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 10d648e..c8278f4 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -932,7 +932,7 @@ out_bad:
while (!list_empty(&list)) {
data = list_entry(list.next, struct nfs_write_data, pages);
list_del(&data->pages);
- nfs_writedata_release(data);
+ nfs_writedata_free(data);
}
nfs_redirty_request(req);
return -ENOMEM;
--
1.7.2.1



2011-01-19 19:42:47

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH 1/1] NFS: fix handling of malloc failure during nfs_flush_multi()

On Wed, 2011-01-19 at 14:18 -0500, Fred Isaman wrote:
> Cleanup of the allocated list entries should not call
> put_nfs_open_context() on each entry, as the context will
> always be NULL, causing an oops.
>
> Signed-off-by: Fred Isaman <[email protected]>
> ---
> fs/nfs/write.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 10d648e..c8278f4 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -932,7 +932,7 @@ out_bad:
> while (!list_empty(&list)) {
> data = list_entry(list.next, struct nfs_write_data, pages);
> list_del(&data->pages);
> - nfs_writedata_release(data);
> + nfs_writedata_free(data);
> }
> nfs_redirty_request(req);
> return -ENOMEM;

Yep. That looks like a long standing bug. Will apply...

--
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
http://www.netapp.com