diff mbox

[v5,30/38] SQUASHME: initialize data->task on the non-rpc io done success paths

Message ID 1306108866-29053-1-git-send-email-bhalevy@panasas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy May 23, 2011, 12:01 a.m. UTC
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
 fs/nfs/pnfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Boaz Harrosh May 23, 2011, 4:58 a.m. UTC | #1
On 05/23/2011 03:01 AM, Benny Halevy wrote:
> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
> ---
>  fs/nfs/pnfs.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
> index 0f59802..d39fcca 100644
> --- a/fs/nfs/pnfs.c
> +++ b/fs/nfs/pnfs.c
> @@ -1064,6 +1064,7 @@ pnfs_ld_write_done(struct nfs_write_data *data)
>  
>  	if (!data->pnfs_error) {
>  		pnfs_set_layoutcommit(data);
> +		memset(&data->task, 0, sizeof(data->task));

What?
We used this data task to come here. See: objlayout.c::objlayout_read/write_done()
why do you think it is invalid?

>  		data->mds_ops->rpc_call_done(&data->task, data);
>  		data->mds_ops->rpc_release(data);
>  		return 0;
> @@ -1113,6 +1114,7 @@ pnfs_ld_read_done(struct nfs_read_data *data)
>  
>  	if (!data->pnfs_error) {
>  		__nfs4_read_done_cb(data);
> +		memset(&data->task, 0, sizeof(data->task));

Same here this is called on the task thread

>  		data->mds_ops->rpc_call_done(&data->task, data);
>  		data->mds_ops->rpc_release(data);
>  		return 0;

Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benny Halevy May 23, 2011, 1:47 p.m. UTC | #2
On 2011-05-23 07:58, Boaz Harrosh wrote:
> On 05/23/2011 03:01 AM, Benny Halevy wrote:
>> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
>> ---
>>  fs/nfs/pnfs.c |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
>> index 0f59802..d39fcca 100644
>> --- a/fs/nfs/pnfs.c
>> +++ b/fs/nfs/pnfs.c
>> @@ -1064,6 +1064,7 @@ pnfs_ld_write_done(struct nfs_write_data *data)
>>  
>>  	if (!data->pnfs_error) {
>>  		pnfs_set_layoutcommit(data);
>> +		memset(&data->task, 0, sizeof(data->task));
> 
> What?
> We used this data task to come here. See: objlayout.c::objlayout_read/write_done()
> why do you think it is invalid?
>

You're right.
Apparently I got too paranoid yesterday night.
The initialization is in nfs_{read,write}data_alloc

Thanks!

Benny

>>  		data->mds_ops->rpc_call_done(&data->task, data);
>>  		data->mds_ops->rpc_release(data);
>>  		return 0;
>> @@ -1113,6 +1114,7 @@ pnfs_ld_read_done(struct nfs_read_data *data)
>>  
>>  	if (!data->pnfs_error) {
>>  		__nfs4_read_done_cb(data);
>> +		memset(&data->task, 0, sizeof(data->task));
> 
> Same here this is called on the task thread
> 
>>  		data->mds_ops->rpc_call_done(&data->task, data);
>>  		data->mds_ops->rpc_release(data);
>>  		return 0;
> 
> Boaz

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 0f59802..d39fcca 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1064,6 +1064,7 @@  pnfs_ld_write_done(struct nfs_write_data *data)
 
 	if (!data->pnfs_error) {
 		pnfs_set_layoutcommit(data);
+		memset(&data->task, 0, sizeof(data->task));
 		data->mds_ops->rpc_call_done(&data->task, data);
 		data->mds_ops->rpc_release(data);
 		return 0;
@@ -1113,6 +1114,7 @@  pnfs_ld_read_done(struct nfs_read_data *data)
 
 	if (!data->pnfs_error) {
 		__nfs4_read_done_cb(data);
+		memset(&data->task, 0, sizeof(data->task));
 		data->mds_ops->rpc_call_done(&data->task, data);
 		data->mds_ops->rpc_release(data);
 		return 0;