All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] ocfs2: why not set EROFS when clearing bits multiple times
@ 2013-11-05  8:20 Joseph Qi
  2013-11-05 23:48 ` Srinivas Eeda
  0 siblings, 1 reply; 3+ messages in thread
From: Joseph Qi @ 2013-11-05  8:20 UTC (permalink / raw)
  To: ocfs2-devel

In ocfs2_block_group_clear_bits, when num_bits != bits_cleared, it just
log an error message without setting EROFS.

The code is below:

	/*
	 * If encountered, it means we are clearing bits multiple times. While
	 * we are handling the case, we still need to be alerted to its
	 * occurrence. Hence, marking it as an ERROR and not NOTICE.
	 */
	if (num_bits != bits_cleared) {
		mlog(ML_ERROR, "Trying to clear %u bits at offset %u in group "
		     "descriptor # %llu (device %s), needed to clear %u bits\n",
		     num_bits, bit_off,
		     (unsigned long long)le64_to_cpu(bg->bg_blkno),
		     alloc_inode->i_sb->s_id, bits_cleared);
	}

If this case happens, does it mean the filesystem have already been
inconsistent? If so, why not set EROFS when this case happens?
Or anyone knows which case will casue bits to be cleared multiple times?
Thanks very much.

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

* [Ocfs2-devel] ocfs2: why not set EROFS when clearing bits multiple times
  2013-11-05  8:20 [Ocfs2-devel] ocfs2: why not set EROFS when clearing bits multiple times Joseph Qi
@ 2013-11-05 23:48 ` Srinivas Eeda
  2013-11-06  1:05   ` Joseph Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Srinivas Eeda @ 2013-11-05 23:48 UTC (permalink / raw)
  To: ocfs2-devel

On 11/05/2013 12:20 AM, Joseph Qi wrote:
> In ocfs2_block_group_clear_bits, when num_bits != bits_cleared, it just
> log an error message without setting EROFS.
>
> The code is below:
>
> 	/*
> 	 * If encountered, it means we are clearing bits multiple times. While
> 	 * we are handling the case, we still need to be alerted to its
> 	 * occurrence. Hence, marking it as an ERROR and not NOTICE.
> 	 */
> 	if (num_bits != bits_cleared) {
> 		mlog(ML_ERROR, "Trying to clear %u bits at offset %u in group "
> 		     "descriptor # %llu (device %s), needed to clear %u bits\n",
> 		     num_bits, bit_off,
> 		     (unsigned long long)le64_to_cpu(bg->bg_blkno),
> 		     alloc_inode->i_sb->s_id, bits_cleared);
> 	}
>
> If this case happens, does it mean the filesystem have already been
> inconsistent? If so, why not set EROFS when this case happens?
> Or anyone knows which case will casue bits to be cleared multiple times?
in the past we have seen a case where the number of free bits were more 
than actual bits which took fs read only. I think running fsck fixed 
this count but didn't report any other issues. So it appeared there is a 
case where we were trying to free some bits twice. Since there was no 
real corruption we didn't take the fs read only.

My guess is this problem may in code paths of releasing unused 
localalloc bits back to global bitmap.

> Thanks very much.
>
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel

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

* [Ocfs2-devel] ocfs2: why not set EROFS when clearing bits multiple times
  2013-11-05 23:48 ` Srinivas Eeda
@ 2013-11-06  1:05   ` Joseph Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Joseph Qi @ 2013-11-06  1:05 UTC (permalink / raw)
  To: ocfs2-devel

On 2013/11/6 7:48, Srinivas Eeda wrote:
> On 11/05/2013 12:20 AM, Joseph Qi wrote:
>> In ocfs2_block_group_clear_bits, when num_bits != bits_cleared, it just
>> log an error message without setting EROFS.
>>
>> The code is below:
>>
>> 	/*
>> 	 * If encountered, it means we are clearing bits multiple times. While
>> 	 * we are handling the case, we still need to be alerted to its
>> 	 * occurrence. Hence, marking it as an ERROR and not NOTICE.
>> 	 */
>> 	if (num_bits != bits_cleared) {
>> 		mlog(ML_ERROR, "Trying to clear %u bits at offset %u in group "
>> 		     "descriptor # %llu (device %s), needed to clear %u bits\n",
>> 		     num_bits, bit_off,
>> 		     (unsigned long long)le64_to_cpu(bg->bg_blkno),
>> 		     alloc_inode->i_sb->s_id, bits_cleared);
>> 	}
>>
>> If this case happens, does it mean the filesystem have already been
>> inconsistent? If so, why not set EROFS when this case happens?
>> Or anyone knows which case will casue bits to be cleared multiple times?
> in the past we have seen a case where the number of free bits were more 
> than actual bits which took fs read only. I think running fsck fixed 
> this count but didn't report any other issues. So it appeared there is a 
> case where we were trying to free some bits twice. Since there was no 
> real corruption we didn't take the fs read only.
> 
> My guess is this problem may in code paths of releasing unused 
> localalloc bits back to global bitmap.
> 
Thanks for your quick reply.
Any more details about the case which led to this change? Now we have
encountered this error message but have no idea why it happened.
And we will investigate the code paths what your mentioned.

>> Thanks very much.
>>
>>
>> _______________________________________________
>> Ocfs2-devel mailing list
>> Ocfs2-devel at oss.oracle.com
>> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/ocfs2-devel
> 
> 

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

end of thread, other threads:[~2013-11-06  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05  8:20 [Ocfs2-devel] ocfs2: why not set EROFS when clearing bits multiple times Joseph Qi
2013-11-05 23:48 ` Srinivas Eeda
2013-11-06  1:05   ` Joseph Qi

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.