From owner-freebsd-fs@FreeBSD.ORG Tue Aug 28 16:43:34 2012 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51D68106564A; Tue, 28 Aug 2012 16:43:34 +0000 (UTC) (envelope-from trent@snakebite.org) Received: from exchange.liveoffice.com (exchla3.liveoffice.com [64.70.67.188]) by mx1.freebsd.org (Postfix) with ESMTP id 0BD6C8FC08; Tue, 28 Aug 2012 16:43:33 +0000 (UTC) Received: from EXHUB03.exchhosting.com (192.168.11.104) by exhub09.exchhosting.com (192.168.11.107) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 28 Aug 2012 09:43:25 -0700 Received: from localhost (35.8.247.10) by exchange.liveoffice.com (192.168.11.104) with Microsoft SMTP Server id 8.3.213.0; Tue, 28 Aug 2012 09:43:24 -0700 Date: Tue, 28 Aug 2012 12:43:23 -0400 From: Trent Nelson To: Andriy Gapon Message-ID: <20120828164323.GA25443@snakebite.org> References: <20120824011517.GJ42732@snakebite.org> <503CD4F1.6060001@FreeBSD.org> <503CDD4E.6050902@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <503CDD4E.6050902@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "freebsd-fs@FreeBSD.org" Subject: Re: chmod -h 000x against symlink has bizarre results on ZFS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Aug 2012 16:43:34 -0000 On Tue, Aug 28, 2012 at 08:01:34AM -0700, Andriy Gapon wrote: > on 28/08/2012 17:25 Andriy Gapon said the following: > [snip] > > I can reproduce this problem > > I can also provide some additional bits of information using a modified version of > > zdb: > > > > $ ln -fs definitelywaylongerthantwentyfour definitelywaylongerthantwentyfour.lnk > > $ stat -s definitelywaylongerthantwentyfour.lnk > > st_dev=3895460379 st_ino=27165 st_mode=0120755 st_nlink=1 st_uid=0 st_gid=0 > > st_rdev=4294967295 st_size=33 st_atime=1346161009 st_mtime=1346161009 > > st_ctime=1346161009 st_birthtime=1346161009 st_blksize=131072 st_blocks=1 st_flags=0 > > $ zdb -ddddddd tank/tmp 27165 > > Dataset tank/tmp [ZPL], ID 69, cr_txg 31, 4.57G, 24910 objects, rootbp > > DVA[0]=<0:5c5375e000:200> DVA[1]=<0:4c1a80ce00:200> [L0 DMU objset] fletcher4 lzjb > > LE contiguous unique double size=800L/200P birth=70882769L/70882769P fill=24910 > > cksum=1c72e8f065:89bbdf9d575:1732432c541ff:2d672d98b0ff66 > > > > Object lvl iblk dblk dsize lsize %full type > > 27165 1 16K 512 0 512 0.00 ZFS plain file (K=inherit) > > (Z=inherit) > > 209 bonus System attributes > > dnode flags: USERUSED_ACCOUNTED > > dnode maxblkid: 0 > > path /definitelywaylongerthantwentyfour.lnk > > uid 0 > > gid 0 > > atime Tue Aug 28 16:36:49 2012 > > mtime Tue Aug 28 16:36:49 2012 > > ctime Tue Aug 28 16:36:49 2012 > > crtime Tue Aug 28 16:36:49 2012 > > gen 70882769 > > mode 120755 > > size 33 > > parent 3 > > links 1 > > pflags 40800000104 > > symlink definitelywaylongerthantwentyfour > > symlink size 33 > > Indirect blocks: > > > > $ chmod -h 0007 definitelywaylongerthantwentyfour.lnk > > $ stat -s definitelywaylongerthantwentyfour.lnk > > st_dev=3895460379 st_ino=27165 st_mode=0120007 st_nlink=1 st_uid=0 st_gid=0 > > st_rdev=4294967295 st_size=33 st_atime=1346161009 st_mtime=1346161009 > > st_ctime=1346161227 st_birthtime=1346161227 st_blksize=131072 st_blocks=1 st_flags=0 > > $ zdb -ddddddd tank/tmp 27165 > > Dataset tank/tmp [ZPL], ID 69, cr_txg 31, 4.57G, 24910 objects, rootbp > > DVA[0]=<0:5c556b4400:200> DVA[1]=<0:4c1a989600:200> [L0 DMU objset] fletcher4 lzjb > > LE contiguous unique double size=800L/200P birth=70882812L/70882812P fill=24910 > > cksum=170e778d58:737e87307d3:140a45f4106a6:283187f7da9de7 > > > > Object lvl iblk dblk dsize lsize %full type > > 27165 1 16K 512 0 512 0.00 ZFS plain file (K=inherit) > > (Z=inherit) > > 216 bonus System attributes > > dnode flags: USERUSED_ACCOUNTED > > dnode maxblkid: 0 > > path /definitelywaylongerthantwentyfour.lnk > > uid 0 > > gid 0 > > atime Tue Aug 28 16:36:49 2012 > > mtime Tue Aug 28 16:36:49 2012 > > ctime Tue Aug 28 16:40:27 2012 > > crtime Tue Aug 28 16:36:49 2012 > > gen 70882769 > > mode 120007 > > size 33 > > parent 3 > > links 1 > > pflags 40800000004 > > symlink definitelywaylongerthant > > symlink size 24 > > Indirect blocks: > > > > Note how the file/object size remains 33, but size of ZPL_SYMLINK attribute is > > changed to 24. > > > > Will you be able to test the following patch? Sure. Just out of interest, is it FreeBSD-specific? Or likely to affect other ZFS platforms as well? Just out of interest, is it FreeBSD-specific? Or likely to affect other ZFS platforms as well? Just out of interest, is it FreeBSD-specific? Or likely to affect other ZFS platforms as well? Just out of interest, is it FreeBSD -specific? Or likely to affect other ZFS platforms as well? > Preferably on a temporary test pool - I don't want to risk your data. Ah, thanks for the heads up. I'll work something out and report back. Trent.