Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3670798ybl; Fri, 20 Dec 2019 13:27:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxyTPCnDZl0L3NX1CmGeIxacw40VB+zaJUd0w9fZfBS5SA//3xiBPwrA1y7UWAXQEPXQilT X-Received: by 2002:a05:6830:1248:: with SMTP id s8mr17217679otp.202.1576877262612; Fri, 20 Dec 2019 13:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576877262; cv=none; d=google.com; s=arc-20160816; b=oJAaeAjAKebUP8CUXs8rD3RxEBUZdARUC0F2AsA6yWCjk423gTYOQNZGIdt4tRYHhy OpqwgBZnSzJOeazavz5r7fh1cKJhDhY2TXyYIXC52rNnajHzsYDZAmFRDKLcodaFvYY5 gNrdgSbKcYeziMG7VJ+sgx99yIpoGKEmYbbFnRuUqaDkHCK5sQA8/R9GrTmkVhDAPiqS lwkS601jZiYLjlP6Yjz7Y7geqEG+ca5hnXoJWXxNaiczdnUBC/7ajTxowdFvpCf/7RlL RGr2ZFdGqf3esGPvSFBh0JhHzURFbVZ3Vcizm1xr0XJ+DWwvjG97MtVoo5dEjWir0yq6 dwOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mSlQpjOpp1k0pL8XUloQQ9l41kEOOcPuuaJ6qBTNo7A=; b=VocgBm6AbgvPVWXI2uac9CYvh8TcMUZdkHkLW0VooXvwY7pmL4MT83JbByVNIJdcn3 KxScXkgMVJQ+A7VDBkwdrYgyHPkl16thFibDSkgCcplDJC2UFbrt1Cnp0h53eV0tOQT8 YQvhKjXTBVkv56BeYIP710zS8y9WsV2y+RH8k5qCem1wtPAZjK1pZgJYOvnfozuqaLqQ C4/ly64Uo4CHhrX3sKxZQK58q3uyXScnJeC7Hq+vTCmOY6GSKcBu9W6PHmr5y0tdCKwp Rw9wOpjH52LwdgCITtbrCZE5h37D0R/GF9xJZKJxcHztdJp5VtPCnDfdsNM4gC0Eykw/ 7i1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="mnD/cqIs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si5431070otj.209.2019.12.20.13.27.29; Fri, 20 Dec 2019 13:27:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="mnD/cqIs"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727509AbfLTV0r (ORCPT + 99 others); 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