All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them.
@ 2009-04-17  7:38 wengang wang
  2009-04-17 21:48 ` Sunil Mushran
  0 siblings, 1 reply; 6+ messages in thread
From: wengang wang @ 2009-04-17  7:38 UTC (permalink / raw)
  To: ocfs2-devel

This patch logs(ERROR) -EIO errors just when they are hitted.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
--
diff -up ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c.orig ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c
--- ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c.orig	2009-04-17 13:55:52.000000000 +0800
+++ ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c	2009-04-17 14:19:54.000000000 +0800
@@ -91,6 +91,8 @@ int ocfs2_write_block(struct ocfs2_super
 		 * information for this bh as it's not marked locally
 		 * uptodate. */
 		ret = -EIO;
+		mlog(ML_ERROR, "writing block %llu failed with %d\n",
+		     (u64)bh->b_blocknr, ret);
 		put_bh(bh);
 	}
 
@@ -168,6 +170,8 @@ int ocfs2_read_blocks_sync(struct ocfs2_
 			 * so we can safely record this and loop back
 			 * to cleanup the other buffers. */
 			status = -EIO;
+			mlog(ML_ERROR, "reading block %llu failed with %d\n",
+			     (u64)bh->b_blocknr, status);
 			put_bh(bh);
 			bhs[i - 1] = NULL;
 		}
@@ -340,6 +344,9 @@ int ocfs2_read_blocks(struct inode *inod
 				 * for this bh as it's not marked locally
 				 * uptodate. */
 				status = -EIO;
+				mlog(ML_ERROR, "reading block %llu failed with"
+				     " %d\n",
+				     (u64)bh->b_blocknr, status);
 				put_bh(bh);
 				bhs[i] = NULL;
 				continue;
@@ -431,6 +438,8 @@ int ocfs2_write_super_or_backup(struct o
 
 	if (!buffer_uptodate(bh)) {
 		ret = -EIO;
+		mlog(ML_ERROR, "writing block %llu failed with %d\n",
+		     (u64)bh->b_blocknr, ret);
 		put_bh(bh);
 	}
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them.
  2009-04-17  7:38 [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them wengang wang
@ 2009-04-17 21:48 ` Sunil Mushran
  2009-04-22 15:41   ` Wengang Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Sunil Mushran @ 2009-04-17 21:48 UTC (permalink / raw)
  To: ocfs2-devel

I imagine this is for the unlogged EIOs that have been reported.

 From my scan, at least in mainline, all these EIOs are being logged
by the caller. So this patch is not adding any value. Can you double
check that please?

Now it could be that the reported EIOs are on 1.2/1.4 and that those
trees are missing the mlogs. In that case, the patch should be specific
to the tree.

BTW, the (u64) should be (unsigned long long). This ensures that
it compiles warning free on all arches.

Sunil


wengang wang wrote:
> This patch logs(ERROR) -EIO errors just when they are hitted.
>
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> --
> diff -up ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c.orig ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c
> --- ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c.orig	2009-04-17 13:55:52.000000000 +0800
> +++ ./linux-2.6.29.y.build/fs/ocfs2/buffer_head_io.c	2009-04-17 14:19:54.000000000 +0800
> @@ -91,6 +91,8 @@ int ocfs2_write_block(struct ocfs2_super
>  		 * information for this bh as it's not marked locally
>  		 * uptodate. */
>  		ret = -EIO;
> +		mlog(ML_ERROR, "writing block %llu failed with %d\n",
> +		     (u64)bh->b_blocknr, ret);
>  		put_bh(bh);
>  	}
>  
> @@ -168,6 +170,8 @@ int ocfs2_read_blocks_sync(struct ocfs2_
>  			 * so we can safely record this and loop back
>  			 * to cleanup the other buffers. */
>  			status = -EIO;
> +			mlog(ML_ERROR, "reading block %llu failed with %d\n",
> +			     (u64)bh->b_blocknr, status);
>  			put_bh(bh);
>  			bhs[i - 1] = NULL;
>  		}
> @@ -340,6 +344,9 @@ int ocfs2_read_blocks(struct inode *inod
>  				 * for this bh as it's not marked locally
>  				 * uptodate. */
>  				status = -EIO;
> +				mlog(ML_ERROR, "reading block %llu failed with"
> +				     " %d\n",
> +				     (u64)bh->b_blocknr, status);
>  				put_bh(bh);
>  				bhs[i] = NULL;
>  				continue;
> @@ -431,6 +438,8 @@ int ocfs2_write_super_or_backup(struct o
>  
>  	if (!buffer_uptodate(bh)) {
>  		ret = -EIO;
> +		mlog(ML_ERROR, "writing block %llu failed with %d\n",
> +		     (u64)bh->b_blocknr, ret);
>  		put_bh(bh);
>  	}
>   

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them.
  2009-04-22 16:18     ` Wengang Wang
@ 2009-04-22  8:37       ` Tao Ma
  2009-04-22 16:53         ` Wengang Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Tao Ma @ 2009-04-22  8:37 UTC (permalink / raw)
  To: ocfs2-devel

Hi wengang,
	I just went through the thread. It looks that Sunil said that "From my 
scan, at least in mainline, all these EIOs are being logged by the 
caller. So this patch is not adding any value. "

I guess his meaning is that since all the callers has already logged the 
-EIO error, your patch does't add any value for it. So you may go in the 
wrong direction.

Regards,
Tao

Wengang Wang wrote:
> Hi,
> 
> I noticed ocfs2_end_buffer_io_sync() is only for 1.2
> need to do something for 1.4
> 
> regards,
> wengang.
> 
> Wengang Wang wrote:
>> Hi Sunil and Joel,
>>
>> For the EIO log problem, ocfs2_end_buffer_io_sync() is used as the 
>> callback function b_end_io
>> for both READ and WRITE.
>> I noticed that in this function,
>>
>> if (!uptodate)
>>     mlog_errno(-EIO);
>>
>> Isn't the 2 lines enough to log EIO errors?
>>
>> regards,
>> wengang.
>>
>> Sunil Mushran wrote:
>>   
>>> I imagine this is for the unlogged EIOs that have been reported.
>>>
>>> From my scan, at least in mainline, all these EIOs are being logged
>>> by the caller. So this patch is not adding any value. Can you double
>>> check that please?
>>>
>>> Now it could be that the reported EIOs are on 1.2/1.4 and that those
>>> trees are missing the mlogs. In that case, the patch should be specific
>>> to the tree.
>>>
>>> BTW, the (u64) should be (unsigned long long). This ensures that
>>> it compiles warning free on all arches.
>>>
>>>     
>>
>> _______________________________________________
>> Ocfs2-devel mailing list
>> Ocfs2-devel at oss.oracle.com
>> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
>>   
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them.
  2009-04-17 21:48 ` Sunil Mushran
@ 2009-04-22 15:41   ` Wengang Wang
  2009-04-22 16:18     ` Wengang Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Wengang Wang @ 2009-04-22 15:41 UTC (permalink / raw)
  To: ocfs2-devel

Hi Sunil and Joel,

For the EIO log problem, ocfs2_end_buffer_io_sync() is used as the 
callback function b_end_io
for both READ and WRITE.
I noticed that in this function,

if (!uptodate)
    mlog_errno(-EIO);

Isn't the 2 lines enough to log EIO errors?

regards,
wengang.

Sunil Mushran wrote:
> I imagine this is for the unlogged EIOs that have been reported.
>
> From my scan, at least in mainline, all these EIOs are being logged
> by the caller. So this patch is not adding any value. Can you double
> check that please?
>
> Now it could be that the reported EIOs are on 1.2/1.4 and that those
> trees are missing the mlogs. In that case, the patch should be specific
> to the tree.
>
> BTW, the (u64) should be (unsigned long long). This ensures that
> it compiles warning free on all arches.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them.
  2009-04-22 15:41   ` Wengang Wang
@ 2009-04-22 16:18     ` Wengang Wang
  2009-04-22  8:37       ` Tao Ma
  0 siblings, 1 reply; 6+ messages in thread
From: Wengang Wang @ 2009-04-22 16:18 UTC (permalink / raw)
  To: ocfs2-devel

Hi,

I noticed ocfs2_end_buffer_io_sync() is only for 1.2
need to do something for 1.4

regards,
wengang.

Wengang Wang wrote:
> Hi Sunil and Joel,
>
> For the EIO log problem, ocfs2_end_buffer_io_sync() is used as the 
> callback function b_end_io
> for both READ and WRITE.
> I noticed that in this function,
>
> if (!uptodate)
>     mlog_errno(-EIO);
>
> Isn't the 2 lines enough to log EIO errors?
>
> regards,
> wengang.
>
> Sunil Mushran wrote:
>   
>> I imagine this is for the unlogged EIOs that have been reported.
>>
>> From my scan, at least in mainline, all these EIOs are being logged
>> by the caller. So this patch is not adding any value. Can you double
>> check that please?
>>
>> Now it could be that the reported EIOs are on 1.2/1.4 and that those
>> trees are missing the mlogs. In that case, the patch should be specific
>> to the tree.
>>
>> BTW, the (u64) should be (unsigned long long). This ensures that
>> it compiles warning free on all arches.
>>
>>     
>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
>   

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them.
  2009-04-22  8:37       ` Tao Ma
@ 2009-04-22 16:53         ` Wengang Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Wengang Wang @ 2009-04-22 16:53 UTC (permalink / raw)
  To: ocfs2-devel

Hi Tao,

Maybe my post is misleading :)
First thing is that I know the callers has the log. why I post the patch 
is to log more detailed info such block number which callers don't.
Second, my replies are based on 1.2 and 1.4, not mainline. --I didn't 
clarify it, sorry :)

Sunil and Joel,
That bug report is against 1.2.  I think ocfs2_end_buffer_io_sync() is 
able to log the EIOs.
By later bug update, looks like the IO is READA, but 
ocfs2_end_buffer_io_sync() can't dealwith readahead(low lever didn't 
call it or didn't call it with correct param)?

thanks,
wengang.

Tao Ma wrote:
> Hi wengang,
>     I just went through the thread. It looks that Sunil said that 
> "From my scan, at least in mainline, all these EIOs are being logged 
> by the caller. So this patch is not adding any value. "
>
> I guess his meaning is that since all the callers has already logged 
> the -EIO error, your patch does't add any value for it. So you may go 
> in the wrong direction.
>
> Regards,
> Tao
>
> Wengang Wang wrote:
>> Hi,
>>
>> I noticed ocfs2_end_buffer_io_sync() is only for 1.2
>> need to do something for 1.4
>>
>> regards,
>> wengang.
>>
>> Wengang Wang wrote:
>>> Hi Sunil and Joel,
>>>
>>> For the EIO log problem, ocfs2_end_buffer_io_sync() is used as the 
>>> callback function b_end_io
>>> for both READ and WRITE.
>>> I noticed that in this function,
>>>
>>> if (!uptodate)
>>>     mlog_errno(-EIO);
>>>
>>> Isn't the 2 lines enough to log EIO errors?
>>>
>>> regards,
>>> wengang.
>>>
>>> Sunil Mushran wrote:
>>>  
>>>> I imagine this is for the unlogged EIOs that have been reported.
>>>>
>>>> From my scan, at least in mainline, all these EIOs are being logged
>>>> by the caller. So this patch is not adding any value. Can you double
>>>> check that please?
>>>>
>>>> Now it could be that the reported EIOs are on 1.2/1.4 and that those
>>>> trees are missing the mlogs. In that case, the patch should be 
>>>> specific
>>>> to the tree.
>>>>
>>>> BTW, the (u64) should be (unsigned long long). This ensures that
>>>> it compiles warning free on all arches.
>>>>
>>>>     
>>>
>>> _______________________________________________
>>> Ocfs2-devel mailing list
>>> Ocfs2-devel at oss.oracle.com
>>> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
>>>   
>>
>>
>> _______________________________________________
>> Ocfs2-devel mailing list
>> Ocfs2-devel at oss.oracle.com
>> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-22 16:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-17  7:38 [Ocfs2-devel] [PATCH 1/1] OCFS2: Log -EIO errors just when hit them wengang wang
2009-04-17 21:48 ` Sunil Mushran
2009-04-22 15:41   ` Wengang Wang
2009-04-22 16:18     ` Wengang Wang
2009-04-22  8:37       ` Tao Ma
2009-04-22 16:53         ` Wengang Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.