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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06DBEC74A44 for ; Fri, 10 Mar 2023 15:21:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234172AbjCJPVc (ORCPT ); Fri, 10 Mar 2023 10:21:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234199AbjCJPVG (ORCPT ); Fri, 10 Mar 2023 10:21:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F7C8127116 for ; Fri, 10 Mar 2023 07:11:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CB1F5B822F2 for ; Fri, 10 Mar 2023 15:10:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1682EC433EF; Fri, 10 Mar 2023 15:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678461052; bh=xDT6jwJDIwxmiwTA7Aq01Fb91qgutadaOPDOjJBi2vQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AP0nZ0srTgtMnUnqlo2GpRP9SHPJKTWccPfgOAB3JalRMG9kwuZRCeNP9Uf9JBqGq AGA4SDGDC9RPMOMlZlpc6LBNv1WvYl5J9Qi+rGgVG1CItqU32K45uOBHE8/+O0lKuL rYNKzTr+WG8yInPavh76k82H4Jqm4KPohqyen1PA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yangtao Li , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.15 010/136] f2fs: allow set compression option of files without blocks Date: Fri, 10 Mar 2023 14:42:12 +0100 Message-Id: <20230310133707.215700080@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133706.811226272@linuxfoundation.org> References: <20230310133706.811226272@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Yangtao Li [ Upstream commit e6261beb0c629403dc58997294dd521bd23664af ] Files created by truncate have a size but no blocks, so they can be allowed to set compression option. Fixes: e1e8debec656 ("f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl") Signed-off-by: Yangtao Li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 758048a885d24..326c1a4c2a6ac 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3928,7 +3928,7 @@ static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg) goto out; } - if (inode->i_size != 0) { + if (F2FS_HAS_BLOCKS(inode)) { ret = -EFBIG; goto out; } -- 2.39.2