Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 2013 10:49:47 +0200
From:      Jeremie Le Hen <jlh@FreeBSD.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, d@delphij.net, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Xin LI <delphij@FreeBSD.org>, jlh@FreeBSD.org
Subject:   Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <20130827084947.GQ24767@caravan.chchile.org>
In-Reply-To: <521C5CDA.1070603@FreeBSD.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> <521C5CDA.1070603@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 27, 2013 at 11:01:30AM +0300, Andriy Gapon wrote:
> 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?

My naive reading of this was that fdvp->v_mount != tdvp->v_mount in my
case, so rename(2) will return EXDEV and mv(1) will fail.  But glancing
at mv(1)'s source it seems it will catch it.  So that's probably fine.

Sorry for the noise.

-- 
Jeremie Le Hen

Scientists say the world is made up of Protons, Neutrons and Electrons.
They forgot to mention Morons.



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