From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99C03882B for ; Fri, 10 Mar 2023 15:10:52 +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 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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