From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8877C3A5A9 for ; Sun, 1 Sep 2019 09:39:38 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 970DD2190F for ; Sun, 1 Sep 2019 09:39:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=aol.com header.i=@aol.com header.b="MfPXUqTO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 970DD2190F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=aol.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7ACD1881D9; Sun, 1 Sep 2019 09:39:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1RHCMHyvz6ux; Sun, 1 Sep 2019 09:39:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E5B0C88221; Sun, 1 Sep 2019 09:39:36 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id DA7771BF381 for ; Sun, 1 Sep 2019 09:39:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D322C8821F for ; Sun, 1 Sep 2019 09:39:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZXXWjhq1hPRF for ; Sun, 1 Sep 2019 09:39:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sonic301-21.consmr.mail.gq1.yahoo.com (sonic301-21.consmr.mail.gq1.yahoo.com [98.137.64.147]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1740188251 for ; Sun, 1 Sep 2019 09:39:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1567330771; bh=cHlH9WiAvjL21Ab1gMYZyJ5FOMKVRsvNZyUnXUBAmGo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=MfPXUqTOfnneZL37s56uLRiVNXb/M4DXFFztSTMa06uZCQZkBANnS/h23XQpTSBDtq4fX3ZbBa+MLYGk7VEX3qZlVauR8E30nfpxh+lJ7EaSQMU8fyDTStFsS2EiCGTe6Xbc/haS5SM4+JEeF4ctnKcyc5F3crKT+wZCLfYdsIKxyBRwwJkiuv4GDfOiM8Js6o14Z7hwHJcswVwU0/xmO1XjyHBGoOUt8gem91Sdpdn0KKMkAjzGqVMXpIgnH8e5TyDqm+fpxeRljp6+MdHyN26uGARwyWc3y1F9azzgMMmJPzOtQNqStk3CunWFaf3+RU1Yd+JrdRs2ce/j16AveQ== X-YMail-OSG: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0X.l7QYtVzH9nwmvlfgYGXB13PsHUWNCcOjGMX9EN0lIlp4G_d QWxEpmjJRQYS6xGzDM2EcDJ1bQa2iPmXFR57PLwnPk4tPBSrq7G54eAJZ4ECX6APRNu5vq1UqZHj HUJ.86x2dwrX50ZrF.x9nFhSQg8yRXxI4FXU4vfVFqLOQ06LMyrLVbfzECR4JNYvp4ZWtvS1Ln.N j8URE72BAnOj8gsGP4BF.0W6ZAdJAtAf5J7m9ZKsoW3tQddU1VB0uTa5poSs14fXke9TKNxOu6ti wGSD2i7hN41nw Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.gq1.yahoo.com with HTTP; Sun, 1 Sep 2019 09:39:31 +0000 Received: by smtp401.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 682a89ffe636f493a8dcfa91a6749f63; Sun, 01 Sep 2019 09:39:26 +0000 (UTC) Date: Sun, 1 Sep 2019 17:39:13 +0800 From: Gao Xiang To: Christoph Hellwig Subject: Re: [PATCH v6 06/24] erofs: support special inode Message-ID: <20190901093912.GB6267@hsiangkao-HP-ZHAN-66-Pro-G1> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-7-gaoxiang25@huawei.com> <20190829102503.GF20598@infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190829102503.GF20598@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailer: WebService/1.1.14303 hermes Apache-HttpAsyncClient/4.1.4 (Java/1.8.0_181) X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Stephen Rothwell , linux-erofs@lists.ozlabs.org, Jan Kara , "Darrick J . Wong" , Linus Torvalds , Amir Goldstein , Dave Chinner , LKML , Theodore Ts'o , Pavel Machek , David Sterba , Greg Kroah-Hartman , Alexander Viro , Jaegeuk Kim , linux-fsdevel@vger.kernel.org, Andrew Morton , Miao Xie Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" Hi Christoph, On Thu, Aug 29, 2019 at 03:25:03AM -0700, Christoph Hellwig wrote: > On Fri, Aug 02, 2019 at 08:53:29PM +0800, Gao Xiang wrote: > > This patch adds to support special inode, such as > > block dev, char, socket, pipe inode. > > > > Signed-off-by: Gao Xiang > > --- > > fs/erofs/inode.c | 27 +++++++++++++++++++++++++-- > > 1 file changed, 25 insertions(+), 2 deletions(-) > > > > diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c > > index b6ea997bc4ae..637bf6e4de44 100644 > > --- a/fs/erofs/inode.c > > +++ b/fs/erofs/inode.c > > @@ -34,7 +34,16 @@ static int read_inode(struct inode *inode, void *data) > > vi->xattr_isize = ondisk_xattr_ibody_size(v2->i_xattr_icount); > > > > inode->i_mode = le16_to_cpu(v2->i_mode); > > - vi->raw_blkaddr = le32_to_cpu(v2->i_u.raw_blkaddr); > > + if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || > > + S_ISLNK(inode->i_mode)) > > + vi->raw_blkaddr = le32_to_cpu(v2->i_u.raw_blkaddr); > > + else if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) > > + inode->i_rdev = > > + new_decode_dev(le32_to_cpu(v2->i_u.rdev)); > > + else if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) > > + inode->i_rdev = 0; > > + else > > + return -EIO; > > Please use a switch statement when dealing with the file modes to > make everything easier to read. Fixed in https://lore.kernel.org/linux-fsdevel/20190901055130.30572-18-hsiangkao@aol.com/ Thanks, Gao Xiang _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel