Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 2013 11:01:30 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        jlh@FreeBSD.org
Cc:        svn-src-head@FreeBSD.org, Xin LI <delphij@FreeBSD.org>, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, d@delphij.net
Subject:   Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <521C5CDA.1070603@FreeBSD.org>
In-Reply-To: <20130827034127.GP24767@caravan.chchile.org>
References:  <201308202231.r7KMVERi068300@svn.freebsd.org> <20130825221517.GM24767@caravan.chchile.org> <521B75CE.70103@FreeBSD.org> <521BDEAC.9080909@delphij.net> <20130827034127.GP24767@caravan.chchile.org>

next in thread | previous in thread | raw e-mail | index | archive | help
on 27/08/2013 06:41 Jeremie Le Hen said the following:
> On Mon, Aug 26, 2013 at 04:03:08PM -0700, Xin Li wrote:
>> Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
>> ===================================================================
>> --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	(revision 254924)
>> +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	(working copy)
>> @@ -6250,6 +6250,9 @@ zfs_freebsd_rename(ap)
>>  	ASSERT(ap->a_fcnp->cn_flags & (SAVENAME|SAVESTART));
>>  	ASSERT(ap->a_tcnp->cn_flags & (SAVENAME|SAVESTART));
>>  
>> +	if (fdvp->v_mount != tdvp->v_mount)
>> +		return (EXDEV);
>> +
>>  	error = zfs_rename(fdvp, ap->a_fcnp->cn_nameptr, tdvp,
>>  	    ap->a_tcnp->cn_nameptr, ap->a_fcnp->cn_cred, NULL, 0);
> 
> I think this won't work with my setup where the target directory stands on a
> nullfs-mounted zfs dataset.  I don't know anything about the VFS, but
> here is what I see with kgdb(1):
> 
>     (kgdb) print *tdvp
>     $1 = {v_tag = 0xffffffff80f5eeee "null", v_op = 0xffffffff81235a80, 
>       v_data = 0xfffff800adbb5440, v_mount = 0xfffff80015af5990, v_nmntvnodes = {
>       [...]
>       v_holdcnt = 3, v_usecount = 2, v_iflag = 512, v_vflag = 0, v_writecount = 0, 
>       v_hash = 4723827, v_type = VDIR}
> 
>     (kgdb) print *fdvp
>     $2 = {v_tag = 0xffffffff819a37a5 "zfs", v_op = 0xffffffff819b5f80, 
>       v_data = 0xfffff80023ba3b80, v_mount = 0xfffff80011eae000, v_nmntvnodes = {
>       [...]
>       v_holdcnt = 4, v_usecount = 2, v_iflag = 512, v_vflag = 0, v_writecount = 0, 
>       v_hash = 2337681, v_type = VDIR}


So what exactly do you think won't work?
And why exactly do you think it won't work?

> 
> Also, I got another panic.  I don't know if this is the same problem,
> but the bottom of the stacktrace is pretty similar though:
> 
>     Unread portion of the kernel message buffer:
>     panic: solaris assert: tx->tx_objset == NULL || dn->dn_objset == tx->tx_objset, file: /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c, line: 818
>     cpuid = 1
>     KDB: stack backtrace:
>     db_trace_self_wrapper() at db_trace_self_wrapper+0x2e/frame 0xfffffe00e5ccbe50
>     kdb_backtrace() at kdb_backtrace+0x54/frame 0xfffffe00e5ccbf00
>     vpanic() at vpanic+0x1bf/frame 0xfffffe00e5ccbf70
>     kproc_shutdown() at kproc_shutdown/frame 0xfffffe00e5ccbfd0
>     assfail() at assfail+0x2c/frame 0xfffffe00e5ccc000
>     dmu_tx_dirty_buf() at dmu_tx_dirty_buf+0xcf/frame 0xfffffe00e5ccc0b0
>     dbuf_dirty() at dbuf_dirty+0xf2/frame 0xfffffe00e5ccc2a0
>     dbuf_will_dirty() at dbuf_will_dirty+0x11a/frame 0xfffffe00e5ccc2e0
>     sa_attr_op() at sa_attr_op+0x2be/frame 0xfffffe00e5ccc350
>     sa_bulk_update_impl() at sa_bulk_update_impl+0x105/frame 0xfffffe00e5ccc3b0
>     sa_bulk_update() at sa_bulk_update+0x81/frame 0xfffffe00e5ccc3f0
>     zfs_link_create() at zfs_link_create+0x3f6/frame 0xfffffe00e5ccc5b0
>     zfs_rename() at zfs_rename+0xc3c/frame 0xfffffe00e5ccc6e0
>     zfs_freebsd_rename() at zfs_freebsd_rename+0x116/frame 0xfffffe00e5ccc730
>     VOP_RENAME_APV() at VOP_RENAME_APV+0x22e/frame 0xfffffe00e5ccc790
>     VOP_RENAME() at VOP_RENAME+0x69/frame 0xfffffe00e5ccc810
>     kern_renameat() at kern_renameat+0x41e/frame 0xfffffe00e5ccca30
>     kern_rename() at kern_rename+0x33/frame 0xfffffe00e5ccca60
>     sys_rename() at sys_rename+0x2a/frame 0xfffffe00e5ccca80
>     syscallenter() at syscallenter+0x46e/frame 0xfffffe00e5cccaf0
>     amd64_syscall() at amd64_syscall+0x1f/frame 0xfffffe00e5cccbf0
>     Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe00e5cccbf0
>     --- syscall (128, FreeBSD ELF64, sys_rename), rip = 0x80088a40a, rsp = 0x7fffffffd0a8, rbp = 0x7fffffffd790 ---
>     KDB: enter: panic
> 
> 
>     (kgdb) frame 16
>     #16 0xffffffff818340ff in dmu_tx_dirty_buf (tx=0xfffff80008610600, db=0xfffff800c1627d20)
> 	at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c:818
>     818             ASSERT(tx->tx_objset == NULL || dn->dn_objset == tx->tx_objset);
>     (kgdb) print tx->tx_objset
>     $3 = (objset_t *) 0xfffff800046e4000
>     (kgdb) print dn->dn_objset
>     $4 = (struct objset *) 0xfffff800045fcc00

It may or may not be the same problem.
My current guess is that it is not.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?521C5CDA.1070603>