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=-7.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 998D7C2D0D2 for ; Fri, 20 Dec 2019 21:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6348521655 for ; Fri, 20 Dec 2019 21:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576877208; bh=GB0uH5v3CIKNR642grWZ0+CyMiDRyZ1gPbwQP4C+Aw0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=HegtjdkjXYkRbWfGfL5WMLd9hgI9+sRt4qMTNia+JaERpllVSE/ana6PxlkUZSRDP xHEAVmRhP68x3PbcLQtaABA2qveCT1AH/89+T7Z9/JdF1Y8/8hnFGpePmTRbkEXKMj HcIQxqhx09lcZrWjxVFo3BRv4F2LhdAoISrR0GV0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727529AbfLTV0r (ORCPT ); Fri, 20 Dec 2019 16:26:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:56122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfLTV0r (ORCPT ); Fri, 20 Dec 2019 16:26:47 -0500 Received: from localhost (unknown [104.132.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82FDE206DA; Fri, 20 Dec 2019 21:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576877206; bh=GB0uH5v3CIKNR642grWZ0+CyMiDRyZ1gPbwQP4C+Aw0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mnD/cqIsY2DEGGEQjd5GSK4d6ltKJg8qF/7HVUf0RdCncfWQz6dCALsQSlUt4WWO5 GQjczmmQeTpmisqGhWEcfBC3ePvP11TPVHCEOxmgXyYC8Kd+cni1wpwfewiyQapBan bbci6tmLpqU1uq5xNWdo1u7EofBgHvoVgC/xCiTQ= Date: Fri, 20 Dec 2019 13:26:45 -0800 From: Jaegeuk Kim To: Geert Uytterhoeven Cc: Chao Yu , linux-f2fs-devel@lists.sourceforge.net, Linux Kernel Mailing List , Chao Yu , Linux-Next Subject: Re: [RFC PATCH v5] f2fs: support data compression Message-ID: <20191220212645.GA14042@jaegeuk-macbookpro.roam.corp.google.com> References: <20191216062806.112361-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/19, Geert Uytterhoeven wrote: > Hi, > > On Mon, Dec 16, 2019 at 7:29 AM Chao Yu wrote: > > > > This patch tries to support compression in f2fs. > > > > > --- a/fs/f2fs/file.c > > +++ b/fs/f2fs/file.c > > > @@ -667,6 +719,24 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) > > return err; > > } > > > > +int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) > > +{ > > + u64 free_from = from; > > + > > + /* > > + * for compressed file, only support cluster size > > + * aligned truncation. > > + */ > > + if (f2fs_compressed_file(inode)) { > > + size_t cluster_size = PAGE_SIZE << > > + F2FS_I(inode)->i_log_cluster_size; > > + > > + free_from = roundup(from, cluster_size); > > This is a 64-by-32 or 64-by-64 division, causing a link failure on > 32-bit platforms: > > fs/f2fs/file.o: In function `f2fs_truncate_blocks': > file.c:(.text+0x1db4): undefined reference to `__udivdi3' > > Please use DIV_ROUND_UP_ULL() instead. Thanks, I applied it in: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev > > Reported-by: > > > + } > > + > > + return do_truncate_blocks(inode, free_from, lock); > > +} > > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds 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=-7.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, 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 C354EC43603 for ; Fri, 20 Dec 2019 21:27:02 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (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 8E832206DA for ; Fri, 20 Dec 2019 21:27:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="SSW8PwMm"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="B664uM8y"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="mnD/cqIs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E832206DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iiPnZ-0007nx-Ft; Fri, 20 Dec 2019 21:27:01 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iiPnY-0007nh-KK for linux-f2fs-devel@lists.sourceforge.net; Fri, 20 Dec 2019 21:27:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mSlQpjOpp1k0pL8XUloQQ9l41kEOOcPuuaJ6qBTNo7A=; b=SSW8PwMmM0RFq+qODeddMyvTVH a0oZ2VmgBWQbARpd9GVhPFmiixioNOjoYjqddaXstaYNUuKM0mLHIq/stwRDenefU/1Mrq3kg+NS6 6jmWi5ttkWIIOvLFpcBF8vnrKBNW6MOIYbIURRLFFM51W4RMBEXiPqGGdTja6gJUoD0w=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mSlQpjOpp1k0pL8XUloQQ9l41kEOOcPuuaJ6qBTNo7A=; b=B664uM8yBANu/E5UIERnv3ETLg /6gv8Ri39ghlApsnEYVE/LiLVCII+85i4bIVh8rD4tHTGxGu9+03CeL26XYY1Wsmcj+JwaXdAc3iK yKCc81ii7Wc3WV8CvSktTvS3cZM8MAoPiWT0vj7EbbYCd6qHXL+plyugKo6p+19B9pOQ=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1iiPnU-009Bb1-Uo for linux-f2fs-devel@lists.sourceforge.net; Fri, 20 Dec 2019 21:27:00 +0000 Received: from localhost (unknown [104.132.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82FDE206DA; Fri, 20 Dec 2019 21:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576877206; bh=GB0uH5v3CIKNR642grWZ0+CyMiDRyZ1gPbwQP4C+Aw0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mnD/cqIsY2DEGGEQjd5GSK4d6ltKJg8qF/7HVUf0RdCncfWQz6dCALsQSlUt4WWO5 GQjczmmQeTpmisqGhWEcfBC3ePvP11TPVHCEOxmgXyYC8Kd+cni1wpwfewiyQapBan bbci6tmLpqU1uq5xNWdo1u7EofBgHvoVgC/xCiTQ= Date: Fri, 20 Dec 2019 13:26:45 -0800 From: Jaegeuk Kim To: Geert Uytterhoeven Message-ID: <20191220212645.GA14042@jaegeuk-macbookpro.roam.corp.google.com> References: <20191216062806.112361-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.2 (2017-04-18) X-Headers-End: 1iiPnU-009Bb1-Uo Subject: Re: [f2fs-dev] [RFC PATCH v5] f2fs: support data compression X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-Next , Linux Kernel Mailing List , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 12/19, Geert Uytterhoeven wrote: > Hi, > > On Mon, Dec 16, 2019 at 7:29 AM Chao Yu wrote: > > > > This patch tries to support compression in f2fs. > > > > > --- a/fs/f2fs/file.c > > +++ b/fs/f2fs/file.c > > > @@ -667,6 +719,24 @@ int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) > > return err; > > } > > > > +int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock) > > +{ > > + u64 free_from = from; > > + > > + /* > > + * for compressed file, only support cluster size > > + * aligned truncation. > > + */ > > + if (f2fs_compressed_file(inode)) { > > + size_t cluster_size = PAGE_SIZE << > > + F2FS_I(inode)->i_log_cluster_size; > > + > > + free_from = roundup(from, cluster_size); > > This is a 64-by-32 or 64-by-64 division, causing a link failure on > 32-bit platforms: > > fs/f2fs/file.o: In function `f2fs_truncate_blocks': > file.c:(.text+0x1db4): undefined reference to `__udivdi3' > > Please use DIV_ROUND_UP_ULL() instead. Thanks, I applied it in: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev > > Reported-by: > > > + } > > + > > + return do_truncate_blocks(inode, free_from, lock); > > +} > > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel