From owner-svn-src-head@FreeBSD.ORG Tue Aug 27 08:49:50 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 075B8B2B; Tue, 27 Aug 2013 08:49:50 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC76B2757; Tue, 27 Aug 2013 08:49:49 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id F12B9C0B8C; Tue, 27 Aug 2013 08:49:47 +0000 (UTC) Date: Tue, 27 Aug 2013 10:49:47 +0200 From: Jeremie Le Hen To: Andriy Gapon Subject: Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <20130827084947.GQ24767@caravan.chchile.org> Mail-Followup-To: Andriy Gapon , d@delphij.net, Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <521C5CDA.1070603@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, d@delphij.net, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, Xin LI , jlh@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Aug 2013 08:49:50 -0000 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.