From owner-freebsd-fs@FreeBSD.ORG Thu Jan 16 16:31:38 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 1ADD7132 for ; Thu, 16 Jan 2014 16:31:38 +0000 (UTC) Received: from nm43-vm5.bullet.mail.bf1.yahoo.com (nm43-vm5.bullet.mail.bf1.yahoo.com [216.109.114.236]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 896601D80 for ; Thu, 16 Jan 2014 16:31:37 +0000 (UTC) Received: from [98.139.212.151] by nm43.bullet.mail.bf1.yahoo.com with NNFMP; 16 Jan 2014 16:31:30 -0000 Received: from [68.142.230.77] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 16 Jan 2014 16:31:30 -0000 Received: from [127.0.0.1] by smtp234.mail.bf1.yahoo.com with NNFMP; 16 Jan 2014 16:31:30 -0000 X-Yahoo-Newman-Id: 723955.74139.bm@smtp234.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: SBHP2twVM1nqn8zlqpNVFQJRUMhKRUS6isR.crvuOA.z7Az 2gmnNSoE9Yp6KdZMDOHUcFUnYVtVZ85pgKeYJX39wKq2o.7Tc28qOMDft.hW RXsxI4mb7BM4AskeLIrm7JrzfJd4kd6e_OfVt7qio_0vjKT2J3MWcKe4YzMb k7.tJwSP0fbtJW_m.HTJLi7RGyGQ2A0.EWDNaCeWlS1I1Xq3_2cmC3wlE1CN KX84Zd9JCdcWhYmzDnqKgOPb8NaueRu1KnVLmEB6_FyBkmgt7A_UaDW5L0w6 oKiLi1afFEA3WVTc6dpa1nB.NGPQCNjFIF18vuVhHmgv_QFf5QIbrbwaFQvy v6TD_3b1Cn46Q5mO0H87oPio9ASogdDqUDzucml6FYIDnS6ieuYO6aLmduHf La55PTKIfd58lEmd8X2XK8LZcpFbdYqgm.JdLyEVi4IatKffUG6AGEcG.Sbv tuH6c3eYuzoDbnll5RblL6gez_RkmN5T6ls8WktN6s.0X0G4iEnOtszs0iXA iNIfR_ysfs2249bxGsi2BBBuhZi5CmTb5zSCNTIPQQ2p3elGCUkk5.Yctcbf Ea7OijrLgAaSmle9aA_jw9.PUftROzXDVQoSqgLLU_G2mXRRQ4QU2PR7XuvS QQCIB6oUgoGzOVD82Yozb1bko4g.ez1DVYh31VKsl7_rg8pAJobc- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.139.211.125]) by smtp234.mail.bf1.yahoo.com with SMTP; 16 Jan 2014 16:31:30 +0000 UTC Message-ID: <52D80961.2040102@FreeBSD.org> Date: Thu, 16 Jan 2014 11:31:29 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: fs@freebsd.org Subject: issues Ext4 inode flags Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Thu, 16 Jan 2014 16:31:38 -0000 Hello; I have been working around some issues in our ext2/3/4 support and there is this problem: 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. 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. 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. I have two options: 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 The patch is here: http://people.freebsd.org/~pfg/patches/ext2fs/ext2fs-passinode.patch 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. The proof-of-concept patch is here: http://people.freebsd.org/~pfg/patches/ext2fs/ext2fs-inode.patch 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. Both patches re-enable dirindex for testing purposes. Comments and testing are welcome. Pedro.