Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5770

wrong tx credit calculations in mdd_declare_links_add()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Lustre 2.8.0
    • Lustre 2.6.0, Lustre 2.5.1
    • 3
    • 16192

    Description

      looking for a reason of

       kernel BUG at fs/jbd2/transaction.c:1033! 

      in sanityN test 12, I ran a simple debugging code

      diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c
      index 0da56c0..59efd5b 100644
      --- a/lustre/osd-ldiskfs/osd_handler.c
      +++ b/lustre/osd-ldiskfs/osd_handler.c
      @@ -2988,6 +2988,8 @@ static int osd_declare_xattr_set(const struct lu_env *env,
                              credits *= (buf->lb_len + sb->s_blocksize - 1) >>
                                              sb->s_blocksize_bits;
                      }
      +               if (buf) 
      +                       printk("osd_declare_xattr_set: buflen = %ld\n", buf->lb_len);
                      /*
                       * xattr set may involve inode quota change, reserve credits for
                       * dquot_initialize()
      @@ -3071,6 +3073,8 @@ static int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
                      if (rc != 0)
                              RETURN(rc);
              }
      +       if (buf) 
      +               printk("osd_xattr_set: buflen = %ld\n", buf->lb_len);
       
              rc = __osd_xattr_set(info, inode, name, buf->lb_buf, buf->lb_len,
                                     fs_flags);
      
      

      got the following output:

      osd_xattr_set: buflen = 256280
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256310
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256340
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256370
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256400
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256430
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256460
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256490
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256520
      osd_declare_xattr_set: buflen = 4096
      osd_xattr_set: buflen = 256550
      

      from

      REFORMAT=y MDSSIZE=400000 ONLY=12 LDISKFS_MKFS_OPTS="-O large_xattr" sh sanityn.sh
      

      mdd_declare_links_add() always uses DEFAULT_LINKEA_SIZE (4096) because linkea_data not yet initialised at the moment of mdd_declare_links_add() call. With really large LinkEA the difference between allocated and used transaction credits can cause that kernel BUG() in jbd2 code.

      Attachments

        Issue Links

          Activity

            People

              bzzz Alex Zhuravlev
              zam Alexander Zarochentsev
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: