From owner-freebsd-fs@FreeBSD.ORG Fri Jan 17 03:11:56 2014 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CB3EDC1 for ; Fri, 17 Jan 2014 03:11:56 +0000 (UTC) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D06C1164C for ; Fri, 17 Jan 2014 03:11:55 +0000 (UTC) Received: from [98.139.212.153] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 17 Jan 2014 03:11:48 -0000 Received: from [68.142.230.71] by tm10.bullet.mail.bf1.yahoo.com with NNFMP; 17 Jan 2014 03:11:48 -0000 Received: from [127.0.0.1] by smtp228.mail.bf1.yahoo.com with NNFMP; 17 Jan 2014 03:11:48 -0000 X-Yahoo-Newman-Id: 586402.33601.bm@smtp228.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: o3eX8cAVM1m84zUUVSFnHcleoeUHli.MydbJC7QCR8GAVvj tlvLvHP9GOdV38TB8msdcuwAKA.l7C.Ka3Rt7QYnjUilrLXVdmmECQ.4RunQ sCnTkLapoBRi8DeIaO1cUE4psTLDv81NWLnj_6cgNDxnZqIGuvD.S1oRNlV3 AzlAE_Q4eJ28h20ORstbs_1t0yB6VzbKMww7YBdNk6vo46bemufwA1LlRQOv pKW6Z82OvHpF642e_t4ufcqI209R9Kgu6Sof1dO35dQjtwWEfIpMh0Fp8mrL kDZ3lihxs.aSameCiIAbqFgrUz0jn.R9U59FcanBA5V4kKzw9Oc.RC0ukgV1 UVz1Mqa5IOxXYVAWqZE0C5via9Mxl0cYRlTmBB5oqaaktZs70gqJBHIVYn3y BAM.yzuO3fJl_NvbWwKcGVmHLcf41CXABD9uSRFCHcL92GeISsqXueHpinLG WnxX5Dl_Lr0Cu_TpldjMATNV1H2om.b36C0pbgHVz62trJMhWlx8m6A09lYo 1fCoe0HcUWDJzsV89uhPNX1hl1KTYPMUkvfoRCD.gvDcnEO.Qwg7PlrY- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain [98.139.211.125]) by smtp228.mail.bf1.yahoo.com with SMTP; 17 Jan 2014 03:11:48 +0000 UTC Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: issues Ext4 inode flags From: Pedro Giffuni In-Reply-To: <201401170207.s0H27NeY032950@chez.mckusick.com> Date: Thu, 16 Jan 2014 22:11:45 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <08A6A8AC-3994-4C14-926B-BB020E7BA8BF@FreeBSD.org> References: <201401170207.s0H27NeY032950@chez.mckusick.com> To: Kirk McKusick X-Mailer: Apple Mail (2.1827) Cc: fs@freebsd.org 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: Fri, 17 Jan 2014 03:11:56 -0000 Hello Kirk; Il giorno 16/gen/2014, alle ore 21:07, Kirk McKusick = ha scritto: >> Date: Thu, 16 Jan 2014 11:31:29 -0500 >> From: Pedro Giffuni >> To: fs@freebsd.org >> Subject: issues Ext4 inode flags >>=20 >> Hello; >>=20 >> I have been working around some issues in our ext2/3/4 support and >> there is this problem: >>=20 >> Before r260545 we were passing the Ext2/3/4 flags with some >> conversion into the inode i_flags. Since our system flags don't >> match the linux flags this actually introduced a lot of garbage. >>=20 >> r260545 cut the garbage completely but it also does not pass >> the EXT4 flags of which we need two for our ext4 ro implementation: >> EXT4_EXTENTS and EXT4_INDEX. We also use EXT4_HUGE_FILE >> but we can read that directly from the dinode. >>=20 >> The flags are pretty specific to Ext4 so it doesn't make sense to add >> them to to our stat.h and include them in the inode conversion = routines. >>=20 >> I have two options: >>=20 >> 1- Pass only the flags that we need and clear the rest. >> Obviously a hack, this seems this is somewhat safer and has >> worked so far as it only applies to the read-only ext4. There is >> still some space for collision: >> EXT4_INDEX --> UF_READONLY >> EXT4_EXTENTS --> UF_HIDDEN >>=20 >> The patch is here: >> http://people.freebsd.org/~pfg/patches/ext2fs/ext2fs-passinode.patch >>=20 >> 2- Create a field in the inode specifically to carry the Ext4_* inode = flags. >> This. of course, costs memory for a feature that is rarely used but >> is cleaner and may be useful if we ever add write support. >>=20 >> The proof-of-concept patch is here: >> http://people.freebsd.org/~pfg/patches/ext2fs/ext2fs-inode.patch >>=20 >> I am inclining towards option (1): it's rather hackish but it >> just works and I don't forsee us doing much efforts to support >> ext4 much better in the future. >>=20 >> Both patches re-enable dirindex for testing purposes. >> Comments and testing are welcome. >>=20 >> Pedro. >=20 > Given your belief that write support for ext4 is unlikely, I agree > with your option 1 preference. However, if write support is to be > added for ext4, then I think that option 2 would be better. In > theory, it is possible to migrate to option 2 later if/when write > support is added assuming you have a version number that you can > bump. >=20 Thank you for the feedback. For the record, I think adding Ext4 write support is possible and it = doesn=92t seem particularly difficult (option 2 took me only a few = minutes to implement). The design is somewhat poor and not really meant = for portability though and there are other filesystems around that are = much more interesting. As with anything where decisions are taken elsewhere, the version number = is not an option we can use, the best I can do is document things well = so that anyone with the time and motivation will not have to find out = the hard way. Cheers, Pedro.=20