[LU-4231] NFS reexport leads to LBUG in mainline 3.12 client Created: 08/Nov/13  Updated: 04/Feb/14  Resolved: 04/Feb/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.1, Lustre 2.5.0
Fix Version/s: Lustre 2.6.0, Lustre 2.5.1

Type: Bug Priority: Major
Reporter: Roland Fehrenbacher Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:
  • 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

Attachments: File 0001-QL-Adjusted-lustre-NFS-reexport-patch-by-Q-Leap-LU-4.patch    
Issue Links:
Duplicate
is duplicated by LU-3717 Kernel panic in ll_encode_fh() while ... Resolved
Related
is related to LU-4416 support for 3.12 linux kernel Resolved
Severity: 4
Rank (Obsolete): 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 ]-----------



 Comments   
Comment by Dmitry Eremin (Inactive) [ 20/Nov/13 ]

I hope the patch http://review.whamcloud.com/8347 should resolve this.

Comment by Lai Siyao [ 21/Nov/13 ]

The backtrace shows it assert on exp_rootfh(), I suspect this is not a common issue for all fh encode, could you make sure of this?

Comment by Dmitry Eremin (Inactive) [ 21/Nov/13 ]

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;
}
Comment by Dmitry Eremin (Inactive) [ 21/Nov/13 ]

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);
Comment by Lai Siyao [ 22/Nov/13 ]

Did you disable subtree_check in this test?

Comment by Dmitry Eremin (Inactive) [ 25/Nov/13 ]

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.

Comment by Dmitry Eremin (Inactive) [ 25/Nov/13 ]

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).

Comment by nasf (Inactive) [ 26/Nov/13 ]

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.

Comment by James A Simmons [ 06/Dec/13 ]

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

Comment by Dmitry Eremin (Inactive) [ 06/Dec/13 ]

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

Comment by Roland Fehrenbacher [ 19/Dec/13 ]

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

Comment by Dmitry Eremin (Inactive) [ 04/Feb/14 ]

Landed b2_5

Generated at Sat Feb 10 01:40:51 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.