From owner-freebsd-fs@FreeBSD.ORG Sat Dec 14 00:57:13 2013 Return-Path: Delivered-To: freebsd-fs@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 ESMTPS id 6BDCE711 for ; Sat, 14 Dec 2013 00:57:12 +0000 (UTC) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2A66C10F5 for ; Sat, 14 Dec 2013 00:57:11 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: X-IronPort-AV: E=Sophos;i="4.95,482,1384318800"; d="scan'208";a="79459242" Received: from muskoka.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.222]) by esa-jnhn.mail.uoguelph.ca with ESMTP; 13 Dec 2013 19:57:05 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 4C2FBB4039; Fri, 13 Dec 2013 19:57:05 -0500 (EST) Date: Fri, 13 Dec 2013 19:57:05 -0500 (EST) From: Rick Macklem To: FreeBSD Filesystems Message-ID: <1972597003.30638311.1386982625256.JavaMail.root@uoguelph.ca> Subject: Does zfs_vget() work for snapshot files? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 7.2.1_GA_2790 (ZimbraWebClient - FF3.0 (Win)/7.2.1_GA_2790) Cc: Steve Dickson X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:57:13 -0000 Jason sent me a packet capture for an NFSv4 readdir of a .zfs/snapshot directory and the attributes for the snapshot entries in the directory appear like they may be bogus. They have a file type==VREG and the same fsid as .zfs/snapshot. (If the client does a lookup of the snapshot, the attributes of it come back as VDIR, fileno==4 and a different fsid than .zfs/snapshot.) There is code in zfs_vget() that makes readdir to switch to using VOP_LOOKUP() when the entry in the directory is a snapshot directory, but this doesn't appear to happen for the snapshots in a snapshot directory. (I am wondering if VFS_VGET() somehow gets a bogus vnode?) Also, does anyone know if the snapshots appear to be separate file systems with v_mountedhere set? (They do appear to have different fsid values, which implies a separate file system.) If not, I may be able to do a "workaround" by comparing the fsid of the directory being read with the fsid of the entry, instead of depending on v_mountedhere being non-NULL to indicate a different file system. Thanks in advance for any help with this, rick