svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Jeremie Le Hen
jlh at FreeBSD.org
Tue Aug 27 08:49:50 UTC 2013
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.
More information about the svn-src-head
mailing list