linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question about jbd2 checksum v2 and v3 flag
@ 2019-08-16 23:55 Shehbaz Jaffer
  2019-08-26  3:05 ` Andreas Dilger
  0 siblings, 1 reply; 6+ messages in thread
From: Shehbaz Jaffer @ 2019-08-16 23:55 UTC (permalink / raw)
  To: linux-ext4

Hello,

I am trying to understand jbd2 checksumming procedure. I reboot ext4
in the middle of a metadata intensive operation using echo b>
/proc/sysrq-trigger. I see that the journal gets replayed on next
mount using prinks in jbd2/recovery.c: do_one_pass() function.

I then corrupt intermediate metadata logged on jbd2 and I still see
the journal being replayed without multiple error messages which
should ideally get printed when one of the two following flags -
JBD2_FEATURE_INCOMPAT_CSUM_V2 or JBD2_FEATURE_INCOMPAT_CSUM_V3 are
set.

I have 2 questions:

1. Are the two flags: JBD2_FEATURE_INCOMPAT_CSUM_V2 and
JBD2_FEATURE_INCOMPAT_CSUM_V3 set by default? If not, how do we set
them so that the journal will detect and respond to injected
corruptions?

2. this is very naive question, but what do compat and incompat
options mean? If flag X in incompat is set, does this mean the feature
does not exist?

Thank you,

-- 
Shehbaz Jaffer

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

* Re: question about jbd2 checksum v2 and v3 flag
  2019-08-16 23:55 question about jbd2 checksum v2 and v3 flag Shehbaz Jaffer
@ 2019-08-26  3:05 ` Andreas Dilger
  2019-08-26 16:51   ` Theodore Y. Ts'o
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Dilger @ 2019-08-26  3:05 UTC (permalink / raw)
  To: Shehbaz Jaffer; +Cc: linux-ext4

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

On Aug 16, 2019, at 5:55 PM, Shehbaz Jaffer <shehbazjaffer007@gmail.com> wrote:
> 
> Hello,
> 
> I am trying to understand jbd2 checksumming procedure. I reboot ext4
> in the middle of a metadata intensive operation using echo b>
> /proc/sysrq-trigger. I see that the journal gets replayed on next
> mount using prinks in jbd2/recovery.c: do_one_pass() function.
> 
> I then corrupt intermediate metadata logged on jbd2 and I still see
> the journal being replayed without multiple error messages which
> should ideally get printed when one of the two following flags -
> JBD2_FEATURE_INCOMPAT_CSUM_V2 or JBD2_FEATURE_INCOMPAT_CSUM_V3 are
> set.
> 
> I have 2 questions:
> 
> 1. Are the two flags: JBD2_FEATURE_INCOMPAT_CSUM_V2 and
> JBD2_FEATURE_INCOMPAT_CSUM_V3 set by default? If not, how do we set
> them so that the journal will detect and respond to injected
> corruptions?

See set_journal_csum_feature_set() for details on how these flags are set.

> 2. this is very naive question, but what do compat and incompat
> options mean? If flag X in incompat is set, does this mean the feature
> does not exist?

See description of the compat/incompat/ro_compat fields at:

https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Super_Block

Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

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

* Re: question about jbd2 checksum v2 and v3 flag
  2019-08-26  3:05 ` Andreas Dilger
@ 2019-08-26 16:51   ` Theodore Y. Ts'o
  2019-08-26 18:31     ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Theodore Y. Ts'o @ 2019-08-26 16:51 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: linux-ext4

On Sun, Aug 25, 2019 at 09:05:36PM -0600, Andreas Dilger wrote:
> See description of the compat/incompat/ro_compat fields at:
> 
> https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Super_Block
>

Hey Andreas,

As an aside, thanks for puting the above wiki page.  Any chance you
could also send a patch to update Documentation/filesystems/ext4/super.rst?

Many thanks!!

					- Ted

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

* Re: question about jbd2 checksum v2 and v3 flag
  2019-08-26 16:51   ` Theodore Y. Ts'o
@ 2019-08-26 18:31     ` Darrick J. Wong
  2019-08-26 18:56       ` Theodore Y. Ts'o
  2019-08-27 20:06       ` Andreas Dilger
  0 siblings, 2 replies; 6+ messages in thread
From: Darrick J. Wong @ 2019-08-26 18:31 UTC (permalink / raw)
  To: Theodore Y. Ts'o; +Cc: Andreas Dilger, linux-ext4

On Mon, Aug 26, 2019 at 12:51:06PM -0400, Theodore Y. Ts'o wrote:
> On Sun, Aug 25, 2019 at 09:05:36PM -0600, Andreas Dilger wrote:
> > See description of the compat/incompat/ro_compat fields at:
> > 
> > https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Super_Block
> >
> 
> Hey Andreas,
> 
> As an aside, thanks for puting the above wiki page.  Any chance you
> could also send a patch to update Documentation/filesystems/ext4/super.rst?

Huh?  That wiki page was ported to the ^^^^^ rst file.

--D

> Many thanks!!
> 
> 					- Ted

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

* Re: question about jbd2 checksum v2 and v3 flag
  2019-08-26 18:31     ` Darrick J. Wong
@ 2019-08-26 18:56       ` Theodore Y. Ts'o
  2019-08-27 20:06       ` Andreas Dilger
  1 sibling, 0 replies; 6+ messages in thread
From: Theodore Y. Ts'o @ 2019-08-26 18:56 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Andreas Dilger, linux-ext4

On Mon, Aug 26, 2019 at 11:31:07AM -0700, Darrick J. Wong wrote:
> On Mon, Aug 26, 2019 at 12:51:06PM -0400, Theodore Y. Ts'o wrote:
> > On Sun, Aug 25, 2019 at 09:05:36PM -0600, Andreas Dilger wrote:
> > > See description of the compat/incompat/ro_compat fields at:
> > > 
> > > https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Super_Block
> > >
> > 
> > Hey Andreas,
> > 
> > As an aside, thanks for puting the above wiki page.  Any chance you
> > could also send a patch to update Documentation/filesystems/ext4/super.rst?
> 
> Huh?  That wiki page was ported to the ^^^^^ rst file.

Andras made a bunch of improvements to the wiki page recently:

https://ext4.wiki.kernel.org/index.php?title=Ext4_Disk_Layout&diff=9155&oldid=9147

What I was trying to type (and failed, because I was composing too
quickly), that Andreas made recent improvements to the wiki page, and
thanks for that.  But we should really get those improvements into the
rst file....

					- Ted

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

* Re: question about jbd2 checksum v2 and v3 flag
  2019-08-26 18:31     ` Darrick J. Wong
  2019-08-26 18:56       ` Theodore Y. Ts'o
@ 2019-08-27 20:06       ` Andreas Dilger
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Dilger @ 2019-08-27 20:06 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Theodore Y. Ts'o, Ext4 Developers List

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

On Aug 26, 2019, at 12:31 PM, Darrick J. Wong <darrick.wong@oracle.com> wrote:
> 
> On Mon, Aug 26, 2019 at 12:51:06PM -0400, Theodore Y. Ts'o wrote:
>> On Sun, Aug 25, 2019 at 09:05:36PM -0600, Andreas Dilger wrote:
>>> See description of the compat/incompat/ro_compat fields at:
>>> 
>>> https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#The_Super_Block
>>> 
>> 
>> Hey Andreas,
>> 
>> As an aside, thanks for puting the above wiki page.  Any chance you
>> could also send a patch to update Documentation/filesystems/ext4/super.rst?
> 
> Huh?  That wiki page was ported to the ^^^^^ rst file.

My bad, I see that there *IS* a comment at the start of this page
indicating that the documentation is old.  Unfortunately, I entered
the middle of this via search and started editing when I saw there
was outdated information and didn't see the note at the top.

I'll try to submit a patch.

Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

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

end of thread, other threads:[~2019-08-27 20:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-16 23:55 question about jbd2 checksum v2 and v3 flag Shehbaz Jaffer
2019-08-26  3:05 ` Andreas Dilger
2019-08-26 16:51   ` Theodore Y. Ts'o
2019-08-26 18:31     ` Darrick J. Wong
2019-08-26 18:56       ` Theodore Y. Ts'o
2019-08-27 20:06       ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).