AW: Metadata corruption at xfs_attr3_leaf_write_verify()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Von: linux-xfs-owner@xxxxxxxxxxxxxxx [linux-xfs-owner@xxxxxxxxxxxxxxx]" im Auftrag von "Eric Sandeen [sandeen@xxxxxxxxxxx]
> Gesendet: Dienstag, 1. August 2017 20:22
> An: Alex Lyakas; linux-xfs@xxxxxxxxxxxxxxx
> Cc: Shyam Kaushik; bfoster@xxxxxxxxxx; dchinner@xxxxxxxxxx; david@xxxxxxxxxxxxx
> Betreff: Re: Metadata corruption at xfs_attr3_leaf_write_verify()
> 
> On 8/1/17 12:30 PM, Alex Lyakas wrote:
> > Greetings XFS developers, David, Brian,
> >
> > We did additional debugging on this issue. The problematic flow happens to be the following:
> >
> > - New inode (regular file) is being created.
> > - As part of creation, due to parent directory having a default ACL, initial ACL is applied to the inode.
> > - This ACL is applied as an extended attribute with name "SGI_ACL_FILE" and value length of 100 bytes.
> > - XFS tries to add this attribute into the inline inode attribute fork area (AKA shortform).
> > - But 100 bytes is too large for the shortform, so XFS creates an empty shortform and then calls xfs_attr_shortform_to_leaf()
> > - This calls xfs_attr3_leaf_create() and creates a leaf with zero attributes.
> > - Before XFS is able to add the attribute to the leaf, the xfsaild thread wants to write this leaf to disk, and trips over the assert in xfs_attr3_leaf_verify, that ichdr.count should not be 0
> >
> > So this seems like a race condition, where xfsaild writes a not-fully-prepared xfs_buf to disk. To my understanding this can lead to different kinds of corruptions.
> 
> Interesting, this seems possibly related to this commit, which
> addresses a similar issue only during log replay:
> 
> commit 2e1d23370e75d7d89350d41b4ab58c7f6a0e26b2
> Author: Eric Sandeen <sandeen@xxxxxxxxxx>
> Date:   Fri Dec 9 16:49:47 2016 +1100
> 
>     xfs: ignore leaf attr ichdr.count in verifier during log replay
> 
>     When we create a new attribute, we first create a shortform
>     attribute, and try to fit the new attribute into it.
>     If that fails, we copy the (empty) attribute into a leaf attribute,
>     and do the copy again.  Thus there can be a transient state where
>     we have an empty leaf attribute.
> 
>     If we encounter this during log replay, the verifier will fail.
>     So add a test to ignore this part of the leaf attr verification
>     during log replay.
> 
>     Thanks as usual to dchinner for spotting the problem.
> 
>     Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
>     Reviewed-by: Christoph Hellwig <hch@xxxxxx>
>     Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>

The initial message dealt with kernel 3.18. If this is really related and we
have similar behaviour through recent kernels - will the above patch 
be helpful for 4.4 longterm?

Markus
****************************************************************************
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

�ber das Internet versandte E-Mails können unter fremden Namen erstellt oder
manipuliert werden. Deshalb ist diese als E-Mail verschickte Nachricht keine
rechtsverbindliche Willenserklärung.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

Vorstand:
Kadir Akin
Dr. Michael Höhnerbach

Vorsitzender des Aufsichtsrates:
Hans Kristian Langva

Registergericht: Amtsgericht Köln
Registernummer: HRB 52 497

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

e-mails sent over the internet may have been written under a wrong name or
been manipulated. That is why this message sent as an e-mail is not a
legally binding declaration of intention.

Collogia
Unternehmensberatung AG
Ubierring 11
D-50678 Köln

executive board:
Kadir Akin
Dr. Michael Höhnerbach

President of the supervisory board:
Hans Kristian Langva

Registry office: district court Cologne
Register number: HRB 52 497

****************************************************************************

[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux