Re: [Bug report][fstests generic/047] Internal error !(flags & XFS_DABUF_MAP_HOLE_OK) at line 2572 of file fs/xfs/libxfs/xfs_da_btree.c. Caller xfs_dabuf_map.constprop.0+0x26c/0x368 [xfs]

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



On Tue, Nov 07, 2023 at 07:13:39PM +1100, Dave Chinner wrote:
> On Tue, Nov 07, 2023 at 04:05:22PM +0800, Zorro Lang wrote:
> > On Tue, Nov 07, 2023 at 07:33:50AM +1100, Dave Chinner wrote:
> > > On Tue, Nov 07, 2023 at 03:26:27AM +0800, Zorro Lang wrote:
> > > > Thanks for your reply :) I tried to do a kernel bisect long time, but
> > > > find nothing ... Then suddently, I found it's failed from a xfsprogs
> > > > change [1].
> > > > 
> > > > Although that's not the root cause of this bug (on s390x), it just
> > > > enabled "nrext64" by default, which I never tested on s390x before.
> > > > For now, we know this's an issue about this feature, and only on
> > > > s390x for now.
> > > 
> > > That's not good. Can you please determine if this is a zero-day bug
> > > with the nrext64 feature? I think it was merged in 5.19, so if you
> > > could try to reproduce it on a 5.18 and 5.19 kernels first, that
> > > would be handy.
> > 
> > Unfortunately, it's a bug be there nearly from beginning. The linux v5.19
> > can trigger this bug (with latest xfsprogs for-next branch):
> 
> Ok. Can you grab the pahole output for the xfs_dinode and
> xfs_log_dinode for s390 from both 5.18 and 5.19 kernel builds?
> (i.e. 'pahole fs/xfs/xfs_inode.o |less' and search for the two
> structures).

I can't find xfs_log_dinode in fs/xfs/xfs_inode.o, but I can find both structures
in fs/xfs/xfs_inode_item.o, so below output base on:

  # pahole fs/xfs/xfs_inode_item.o

The output on v5.19 is [1], v5.18 output is [2], the diff of 5.18 and 5.19 is [3].

Thanks,
Zorro

[1]
v5.19:
struct xfs_dinode {
        __be16                     di_magic;             /*     0     2 */
        __be16                     di_mode;              /*     2     2 */
        __u8                       di_version;           /*     4     1 */
        __u8                       di_format;            /*     5     1 */
        __be16                     di_onlink;            /*     6     2 */
        __be32                     di_uid;               /*     8     4 */
        __be32                     di_gid;               /*    12     4 */
        __be32                     di_nlink;             /*    16     4 */
        __be16                     di_projid_lo;         /*    20     2 */
        __be16                     di_projid_hi;         /*    22     2 */
        union {
                __be64             di_big_nextents;      /*    24     8 */
                __be64             di_v3_pad;            /*    24     8 */
                struct {
                        __u8       di_v2_pad[6];         /*    24     6 */
                        __be16     di_flushiter;         /*    30     2 */
                };                                       /*    24     8 */
        };                                               /*    24     8 */
        xfs_timestamp_t            di_atime;             /*    32     8 */
        xfs_timestamp_t            di_mtime;             /*    40     8 */
        xfs_timestamp_t            di_ctime;             /*    48     8 */
        __be64                     di_size;              /*    56     8 */
        __be64                     di_nblocks;           /*    64     8 */
        __be32                     di_extsize;           /*    72     4 */
        union {
                struct {
                        __be32     di_nextents;          /*    76     4 */
                        __be16     di_anextents;         /*    80     2 */
                } __attribute__((__packed__));           /*    76     6 */
                struct {
                        __be32     di_big_anextents;     /*    76     4 */
                        __be16     di_nrext64_pad;       /*    80     2 */
                } __attribute__((__packed__));           /*    76     6 */
        };                                               /*    76     6 */
        __u8                       di_forkoff;           /*    82     1 */
        __s8                       di_aformat;           /*    83     1 */
        __be32                     di_dmevmask;          /*    84     4 */
        __be16                     di_dmstate;           /*    88     2 */
        __be16                     di_flags;             /*    90     2 */
        __be32                     di_gen;               /*    92     4 */
        __be32                     di_next_unlinked;     /*    96     4 */
        __le32                     di_crc;               /*   100     4 */
        __be64                     di_changecount;       /*   104     8 */
        __be64                     di_lsn;               /*   112     8 */
        __be64                     di_flags2;            /*   120     8 */
        __be32                     di_cowextsize;        /*   128     4 */
        __u8                       di_pad2[12];          /*   132    12 */
        xfs_timestamp_t            di_crtime;            /*   144     8 */
        __be64                     di_ino;               /*   152     8 */
        uuid_t                     di_uuid;              /*   160    16 */

        /* size: 176, cachelines: 1, members: 34 */
        /* last cacheline: 176 bytes */
};

struct xfs_log_dinode {
        uint16_t                   di_magic;             /*     0     2 */
        uint16_t                   di_mode;              /*     2     2 */
        int8_t                     di_version;           /*     4     1 */
        int8_t                     di_format;            /*     5     1 */
        uint8_t                    di_pad3[2];           /*     6     2 */
        uint32_t                   di_uid;               /*     8     4 */
        uint32_t                   di_gid;               /*    12     4 */
        uint32_t                   di_nlink;             /*    16     4 */
        uint16_t                   di_projid_lo;         /*    20     2 */
        uint16_t                   di_projid_hi;         /*    22     2 */
        union {
                uint64_t           di_big_nextents;      /*    24     8 */
                uint64_t           di_v3_pad;            /*    24     8 */
                struct {
                        uint8_t    di_v2_pad[6];         /*    24     6 */
                        uint16_t   di_flushiter;         /*    30     2 */
                };                                       /*    24     8 */
        };                                               /*    24     8 */
        xfs_log_timestamp_t        di_atime;             /*    32     8 */
        xfs_log_timestamp_t        di_mtime;             /*    40     8 */
        xfs_log_timestamp_t        di_ctime;             /*    48     8 */
        xfs_fsize_t                di_size;              /*    56     8 */
        xfs_rfsblock_t             di_nblocks;           /*    64     8 */
        xfs_extlen_t               di_extsize;           /*    72     4 */
        union {
                struct {
                        uint32_t   di_nextents;          /*    76     4 */
                        uint16_t   di_anextents;         /*    80     2 */
                } __attribute__((__packed__));           /*    76     6 */
                struct {
                        uint32_t   di_big_anextents;     /*    76     4 */
                        uint16_t   di_nrext64_pad;       /*    80     2 */
                } __attribute__((__packed__));           /*    76     6 */
        };                                               /*    76     6 */
        uint8_t                    di_forkoff;           /*    82     1 */
        int8_t                     di_aformat;           /*    83     1 */
        uint32_t                   di_dmevmask;          /*    84     4 */
        uint16_t                   di_dmstate;           /*    88     2 */
        uint16_t                   di_flags;             /*    90     2 */
        uint32_t                   di_gen;               /*    92     4 */
        xfs_agino_t                di_next_unlinked;     /*    96     4 */
        uint32_t                   di_crc;               /*   100     4 */
        uint64_t                   di_changecount;       /*   104     8 */
        xfs_lsn_t                  di_lsn;               /*   112     8 */
        uint64_t                   di_flags2;            /*   120     8 */
        uint32_t                   di_cowextsize;        /*   128     4 */
        uint8_t                    di_pad2[12];          /*   132    12 */
        xfs_log_timestamp_t        di_crtime;            /*   144     8 */
        xfs_ino_t                  di_ino;               /*   152     8 */
        uuid_t                     di_uuid;              /*   160    16 */

        /* size: 176, cachelines: 1, members: 34 */
        /* last cacheline: 176 bytes */
};


[2]
v5.18:
struct xfs_dinode {
        __be16                     di_magic;             /*     0     2 */
        __be16                     di_mode;              /*     2     2 */
        __u8                       di_version;           /*     4     1 */
        __u8                       di_format;            /*     5     1 */
        __be16                     di_onlink;            /*     6     2 */
        __be32                     di_uid;               /*     8     4 */
        __be32                     di_gid;               /*    12     4 */
        __be32                     di_nlink;             /*    16     4 */
        __be16                     di_projid_lo;         /*    20     2 */
        __be16                     di_projid_hi;         /*    22     2 */
        __u8                       di_pad[6];            /*    24     6 */
        __be16                     di_flushiter;         /*    30     2 */
        xfs_timestamp_t            di_atime;             /*    32     8 */
        xfs_timestamp_t            di_mtime;             /*    40     8 */
        xfs_timestamp_t            di_ctime;             /*    48     8 */
        __be64                     di_size;              /*    56     8 */
        __be64                     di_nblocks;           /*    64     8 */
        __be32                     di_extsize;           /*    72     4 */
        __be32                     di_nextents;          /*    76     4 */
        __be16                     di_anextents;         /*    80     2 */
        __u8                       di_forkoff;           /*    82     1 */
        __s8                       di_aformat;           /*    83     1 */
        __be32                     di_dmevmask;          /*    84     4 */
        __be16                     di_dmstate;           /*    88     2 */
        __be16                     di_flags;             /*    90     2 */
        __be32                     di_gen;               /*    92     4 */
        __be32                     di_next_unlinked;     /*    96     4 */
        __le32                     di_crc;               /*   100     4 */
        __be64                     di_changecount;       /*   104     8 */
        __be64                     di_lsn;               /*   112     8 */
        __be64                     di_flags2;            /*   120     8 */
        __be32                     di_cowextsize;        /*   128     4 */
        __u8                       di_pad2[12];          /*   132    12 */
        xfs_timestamp_t            di_crtime;            /*   144     8 */
        __be64                     di_ino;               /*   152     8 */
        uuid_t                     di_uuid;              /*   160    16 */

        /* size: 176, cachelines: 1, members: 36 */
        /* last cacheline: 176 bytes */
};

struct xfs_log_dinode {
        uint16_t                   di_magic;             /*     0     2 */
        uint16_t                   di_mode;              /*     2     2 */
        int8_t                     di_version;           /*     4     1 */
        int8_t                     di_format;            /*     5     1 */
        uint8_t                    di_pad3[2];           /*     6     2 */
        uint32_t                   di_uid;               /*     8     4 */
        uint32_t                   di_gid;               /*    12     4 */
        uint32_t                   di_nlink;             /*    16     4 */
        uint16_t                   di_projid_lo;         /*    20     2 */
        uint16_t                   di_projid_hi;         /*    22     2 */
        uint8_t                    di_pad[6];            /*    24     6 */
        uint16_t                   di_flushiter;         /*    30     2 */
        xfs_log_timestamp_t        di_atime;             /*    32     8 */
        xfs_log_timestamp_t        di_mtime;             /*    40     8 */
        xfs_log_timestamp_t        di_ctime;             /*    48     8 */
        xfs_fsize_t                di_size;              /*    56     8 */
        xfs_rfsblock_t             di_nblocks;           /*    64     8 */
        xfs_extlen_t               di_extsize;           /*    72     4 */
        xfs_extnum_t               di_nextents;          /*    76     4 */
        xfs_aextnum_t              di_anextents;         /*    80     2 */
        uint8_t                    di_forkoff;           /*    82     1 */
        int8_t                     di_aformat;           /*    83     1 */
        uint32_t                   di_dmevmask;          /*    84     4 */
        uint16_t                   di_dmstate;           /*    88     2 */
        uint16_t                   di_flags;             /*    90     2 */
        uint32_t                   di_gen;               /*    92     4 */
        xfs_agino_t                di_next_unlinked;     /*    96     4 */
        uint32_t                   di_crc;               /*   100     4 */
        uint64_t                   di_changecount;       /*   104     8 */
        xfs_lsn_t                  di_lsn;               /*   112     8 */
        uint64_t                   di_flags2;            /*   120     8 */
        uint32_t                   di_cowextsize;        /*   128     4 */
        uint8_t                    di_pad2[12];          /*   132    12 */
        xfs_log_timestamp_t        di_crtime;            /*   144     8 */
        xfs_ino_t                  di_ino;               /*   152     8 */
        uuid_t                     di_uuid;              /*   160    16 */

        /* size: 176, cachelines: 1, members: 36 */
        /* last cacheline: 176 bytes */
};

[3]
# diff -Nup xfs_inode_item.pahole.518 xfs_inode_item.pahole.519
@@ -6763,16 +6799,30 @@ struct xfs_dinode {
        __be32                     di_nlink;             /*    16     4 */
        __be16                     di_projid_lo;         /*    20     2 */
        __be16                     di_projid_hi;         /*    22     2 */
-       __u8                       di_pad[6];            /*    24     6 */
-       __be16                     di_flushiter;         /*    30     2 */
+       union {
+               __be64             di_big_nextents;      /*    24     8 */
+               __be64             di_v3_pad;            /*    24     8 */
+               struct {
+                       __u8       di_v2_pad[6];         /*    24     6 */
+                       __be16     di_flushiter;         /*    30     2 */
+               };                                       /*    24     8 */
+       };                                               /*    24     8 */
        xfs_timestamp_t            di_atime;             /*    32     8 */
        xfs_timestamp_t            di_mtime;             /*    40     8 */
        xfs_timestamp_t            di_ctime;             /*    48     8 */
        __be64                     di_size;              /*    56     8 */
        __be64                     di_nblocks;           /*    64     8 */
        __be32                     di_extsize;           /*    72     4 */
-       __be32                     di_nextents;          /*    76     4 */
-       __be16                     di_anextents;         /*    80     2 */
+       union {
+               struct {
+                       __be32     di_nextents;          /*    76     4 */
+                       __be16     di_anextents;         /*    80     2 */
+               } __attribute__((__packed__));           /*    76     6 */
+               struct {
+                       __be32     di_big_anextents;     /*    76     4 */
+                       __be16     di_nrext64_pad;       /*    80     2 */
+               } __attribute__((__packed__));           /*    76     6 */
+       };                                               /*    76     6 */
        __u8                       di_forkoff;           /*    82     1 */
        __s8                       di_aformat;           /*    83     1 */
        __be32                     di_dmevmask;          /*    84     4 */
@@ -6790,7 +6840,7 @@ struct xfs_dinode {
        __be64                     di_ino;               /*   152     8 */
        uuid_t                     di_uuid;              /*   160    16 */
 
-       /* size: 176, cachelines: 1, members: 36 */
+       /* size: 176, cachelines: 1, members: 34 */
        /* last cacheline: 176 bytes */
 };
...
...
@@ -6932,16 +6992,30 @@ struct xfs_log_dinode {
        uint32_t                   di_nlink;             /*    16     4 */
        uint16_t                   di_projid_lo;         /*    20     2 */
        uint16_t                   di_projid_hi;         /*    22     2 */
-       uint8_t                    di_pad[6];            /*    24     6 */
-       uint16_t                   di_flushiter;         /*    30     2 */
+       union {
+               uint64_t           di_big_nextents;      /*    24     8 */
+               uint64_t           di_v3_pad;            /*    24     8 */
+               struct {
+                       uint8_t    di_v2_pad[6];         /*    24     6 */
+                       uint16_t   di_flushiter;         /*    30     2 */
+               };                                       /*    24     8 */
+       };                                               /*    24     8 */
        xfs_log_timestamp_t        di_atime;             /*    32     8 */
        xfs_log_timestamp_t        di_mtime;             /*    40     8 */
        xfs_log_timestamp_t        di_ctime;             /*    48     8 */
        xfs_fsize_t                di_size;              /*    56     8 */
        xfs_rfsblock_t             di_nblocks;           /*    64     8 */
        xfs_extlen_t               di_extsize;           /*    72     4 */
-       xfs_extnum_t               di_nextents;          /*    76     4 */
-       xfs_aextnum_t              di_anextents;         /*    80     2 */
+       union {
+               struct {
+                       uint32_t   di_nextents;          /*    76     4 */
+                       uint16_t   di_anextents;         /*    80     2 */
+               } __attribute__((__packed__));           /*    76     6 */
+               struct {
+                       uint32_t   di_big_anextents;     /*    76     4 */
+                       uint16_t   di_nrext64_pad;       /*    80     2 */
+               } __attribute__((__packed__));           /*    76     6 */
+       };                                               /*    76     6 */
        uint8_t                    di_forkoff;           /*    82     1 */
        int8_t                     di_aformat;           /*    83     1 */
        uint32_t                   di_dmevmask;          /*    84     4 */
@@ -6959,7 +7033,7 @@ struct xfs_log_dinode {
        xfs_ino_t                  di_ino;               /*   152     8 */
        uuid_t                     di_uuid;              /*   160    16 */
 
-       /* size: 176, cachelines: 1, members: 36 */
+       /* size: 176, cachelines: 1, members: 34 */
        /* last cacheline: 176 bytes */
 };

> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@xxxxxxxxxxxxx
> 





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux