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

NFS reexport leads to LBUG in mainline 3.12 client

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.6.0, Lustre 2.5.1
    • Lustre 2.4.1, Lustre 2.5.0
    • None
    • - Client mainline kernel 3.12 / lustre-utils 2.4.0
      - Servers lustre 2.4.0/ZFS OSDs
      - ko2iblnd
      - reexport works with 2.6.32/2.4.0 client
    • 4
    • 11523

    Description

      [ 1007.910111] LustreError: 9425:0:(llite_internal.h:1091:ll_inode2fid()) ASSERTION( inode != (
      (void *)0) ) failed:
      [ 1007.920862] LustreError: 9425:0:(llite_internal.h:1091:ll_inode2fid()) LBUG
      [ 1007.929703] Kernel panic - not syncing: LBUG
      [ 1007.933988] CPU: 0 PID: 9425 Comm: rpc.mountd Tainted: P C O 3.12.0-rc7-ql-generic-10 #1
      [ 1007.942781] Hardware name: Supermicro X8DTN/X8DTN, BIOS 080015 05/04/2009
      [ 1007.949668] 0000000000000000 ffff8801b20b3a38 ffffffff814fd482 0000000000000007
      [ 1007.957158] ffffffffa04e66bd ffff8801b20b3ab8 ffffffff814faa1f ffffffff815eb50a
      [ 1007.964647] ffffffff00000008 ffff8801b20b3ac8 ffff8801b20b3a68 ffffffffa0b6ba0e
      [ 1007.972144] Call Trace:
      [ 1007.974607] [<ffffffff814fd482>] dump_stack+0x46/0x58
      [ 1007.979759] [<ffffffff814faa1f>] panic+0xb6/0x1c6
      [ 1007.984632] [<ffffffffa04cab50>] lbug_with_loc+0xb0/0xb0 [libcfs]
      [ 1007.990892] [<ffffffffa0b40635>] ll_encode_fh+0x165/0x170 [lustre]
      [ 1007.997244] [<ffffffffa03b601b>] exportfs_encode_inode_fh+0x1b/0xa0 [exportfs]
      [ 1008.004707] [<ffffffffa03b60f0>] exportfs_encode_fh+0x50/0x70 [exportfs]
      [ 1008.011581] [<ffffffffa03bd4bb>] _fh_update.isra.9.part.10+0x3b/0x50 [nfsd]
      [ 1008.018716] [<ffffffffa03be011>] fh_compose+0x241/0x520 [nfsd]
      [ 1008.024719] [<ffffffffa03c4244>] exp_rootfh+0x104/0x2a0 [nfsd]
      [ 1008.030725] [<ffffffffa03bb7a9>] write_filehandle+0x179/0x200 [nfsd]
      [ 1008.037250] [<ffffffff811156a5>] ? alloc_pages_current+0xb5/0x180
      [ 1008.043505] [<ffffffff810d8839>] ? __get_free_pages+0x9/0x40
      [ 1008.049329] [<ffffffff810d8881>] ? get_zeroed_page+0x11/0x20
      [ 1008.055156] [<ffffffffa03bb630>] ? write_unlock_ip+0xd0/0xd0 [nfsd]
      [ 1008.061596] [<ffffffffa03baff8>] nfsctl_transaction_write+0x58/0x80 [nfsd]
      [ 1008.068642] [<ffffffff81137995>] vfs_write+0xc5/0x1d0
      [ 1008.073854] [<ffffffff81137e3d>] SyS_write+0x4d/0xa0
      [ 1008.078985] [<ffffffff81507479>] ? do_page_fault+0x9/0x10
      [ 1008.084549] [<ffffffff8150a066>] system_call_fastpath+0x1a/0x1f
      [ 1008.091486] -----------[ cut here ]-----------

      Attachments

        Issue Links

          Activity

            [LU-4231] NFS reexport leads to LBUG in mainline 3.12 client

            Landed b2_5

            dmiter Dmitry Eremin (Inactive) added a comment - Landed b2_5

            This is a patch that fixes the issue for the 3.12 mainline kernel client.

            rfehren Roland Fehrenbacher added a comment - This is a patch that fixes the issue for the 3.12 mainline kernel client.

            I think we need it in b2_5. Not sure about b2_4. I will back port it to b2_5 only.

            dmiter Dmitry Eremin (Inactive) added a comment - I think we need it in b2_5. Not sure about b2_4. I will back port it to b2_5 only.

            Patch landed to master. Do we need to back port this to b2_5 or b2_4?

            simmonsja James A Simmons added a comment - Patch landed to master. Do we need to back port this to b2_5 or b2_4?

            It seems a duplication of LU-3717. Please check the patch http://review.whamcloud.com/#/c/8072/. You can work more based on such patch if more issues found on 3.12 (or newer) client.

            yong.fan nasf (Inactive) added a comment - It seems a duplication of LU-3717 . Please check the patch http://review.whamcloud.com/#/c/8072/ . You can work more based on such patch if more issues found on 3.12 (or newer) client.

            The patch http://review.whamcloud.com/8347 with little adoption enable NFS re-export for Lustre staging client (Lustre: Build Version: v2_3_64_0-g6e62c21-CHANGED-3.9.0).

            dmiter Dmitry Eremin (Inactive) added a comment - The patch http://review.whamcloud.com/8347 with little adoption enable NFS re-export for Lustre staging client (Lustre: Build Version: v2_3_64_0-g6e62c21-CHANGED-3.9.0).

            According my playing with kernel 3.12.0+ with staging lustre client my patch works. NFSD always asked for encode inode without parent independent from "no_subtree_check" option.

            dmiter Dmitry Eremin (Inactive) added a comment - According my playing with kernel 3.12.0+ with staging lustre client my patch works. NFSD always asked for encode inode without parent independent from "no_subtree_check" option.
            laisiyao Lai Siyao added a comment -

            Did you disable subtree_check in this test?

            laisiyao Lai Siyao added a comment - Did you disable subtree_check in this test?

            In other place we have explicit call:

            /* we ask for a non connected handle */
            retval = exportfs_encode_fh(path->dentry,
                                        (struct fid *)handle->f_handle,
                                        &handle_dwords,  0);
            
            dmiter Dmitry Eremin (Inactive) added a comment - In other place we have explicit call: /* we ask for a non connected handle */ retval = exportfs_encode_fh(path->dentry, (struct fid *)handle->f_handle, &handle_dwords, 0);

            This is general case. From the code of function exportfs_encode_fh() we can see the path when the parent == NULL.

            int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len,
                            int connectable)
            {
                    int error;
                    struct dentry *p = NULL;
                    struct inode *inode = dentry->d_inode, *parent = NULL;
            
                    if (connectable && !S_ISDIR(inode->i_mode)) {
                            p = dget_parent(dentry);
                            /*
                             * note that while p might've ceased to be our parent already,
                             * it's still pinned by and still positive.
                             */
                            parent = p->d_inode;
                    }
            
                    error = exportfs_encode_inode_fh(inode, fid, max_len, parent);
                    dput(p);
            
                    return error;
            }
            

            The flag connectable depends from export flag NFSEXP_NOSUBTREECHECK only.

            {
              struct fid *fid = (struct fid *)
              (fhp->fh_handle.fh_auth + fhp->fh_handle.fh_size/4 - 1);
              int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4;
              int subtreecheck = !(exp->ex_flags & NFSEXP_NOSUBTREECHECK);
            
              fhp->fh_handle.fh_fileid_type = exportfs_encode_fh(dentry, fid, &maxsize, subtreecheck);
              fhp->fh_handle.fh_size += maxsize * 4;
            }
            
            dmiter Dmitry Eremin (Inactive) added a comment - This is general case. From the code of function exportfs_encode_fh() we can see the path when the parent == NULL . int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, int connectable) { int error; struct dentry *p = NULL; struct inode *inode = dentry->d_inode, *parent = NULL; if (connectable && !S_ISDIR(inode->i_mode)) { p = dget_parent(dentry); /* * note that while p might've ceased to be our parent already, * it's still pinned by and still positive. */ parent = p->d_inode; } error = exportfs_encode_inode_fh(inode, fid, max_len, parent); dput(p); return error; } The flag connectable depends from export flag NFSEXP_NOSUBTREECHECK only. { struct fid *fid = (struct fid *) (fhp->fh_handle.fh_auth + fhp->fh_handle.fh_size/4 - 1); int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; int subtreecheck = !(exp->ex_flags & NFSEXP_NOSUBTREECHECK); fhp->fh_handle.fh_fileid_type = exportfs_encode_fh(dentry, fid, &maxsize, subtreecheck); fhp->fh_handle.fh_size += maxsize * 4; }

            People

              dmiter Dmitry Eremin (Inactive)
              rfehren Roland Fehrenbacher
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: