Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3665303pxb; Mon, 24 Jan 2022 14:50:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUt+qvYPlxvAtsWgo8j8/lyfhehUEP/o6/qB+ls0M/haN2DCRt9AdtTUUq171d+Zvfa9+M X-Received: by 2002:a17:90b:1a8f:: with SMTP id ng15mr419403pjb.93.1643064512617; Mon, 24 Jan 2022 14:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643064512; cv=none; d=google.com; s=arc-20160816; b=uxppCxtqf2nYyHQ9Q8c+UZOMsJy8Eaum+jfW4tuBUsu5RB4kGX7zbrkWuwpsxB93K2 fcyagdLuVCM4a+bF11ap/SqLgdT7lNwNAIWhKl2eiQoonjJpNeJVzK5m2RTmcrYRarvy HqA+XaVPi0SZBr6SGZcN7+z6+OZZ6vlHh4nJNnKbpZ7Ig4Rta9UgIWNu543IxD/Grtqx fPO1TaJTk/1mA1IBNWA2WOEzr7Hk7uV8sV2v7WR2bDbZoHEYnQ39G1hEM0TQ/1QggoAQ apKW0VXqxD7Rcy8x/vJhbNbqRr+7pTrrWJ/UYHvyGLc3J2yulTi3pYUl0/JQBic0WXIL pf5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dqbwopZ4Nh1ZfG8ULLXu+s6diN5OiYGTiunz57tfclM=; b=ngVE3YfJJte39gzuHFSAxXLxnzUlxHV7X8MPbTi8TDCWbE3mT1opJndmYZ50nwaBr9 k/+Wfm8ELKm9wtOhgiXbzSGCKdxY6XATByMbw8al1N/mdSkYifwcUwOu7SfF2kZ3Tvug 7hLjcQ/gGdLYzjdORuHtQWWupm4YTIWSTDe+urmaVGMrb1FCYL409CB9tSubsLeSfLfY jlktrUgPPDO9BUJrrWm8VjgIZDxk0+bzeETaCTGDBiuUIptN0tcBG6YwZ41EHlhq7tEs t7l1x/wrkqck/QZQkIv8w6MTJagd8VHZSMyHS8dT/qpC1sMTEtCUzlnDyD/IU7vQE95q FBGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2mDkXYxn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si16853650plh.396.2022.01.24.14.48.20; Mon, 24 Jan 2022 14:48:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2mDkXYxn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1838540AbiAXWqr (ORCPT + 99 others); Mon, 24 Jan 2022 17:46:47 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:58950 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457107AbiAXVk4 (ORCPT ); Mon, 24 Jan 2022 16:40:56 -0500 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 dfw.source.kernel.org (Postfix) with ESMTPS id 7EAFE61520; Mon, 24 Jan 2022 21:40:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F33DC340E4; Mon, 24 Jan 2022 21:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060454; bh=bA2NVkNRdfsC9+kYNk0cI6zBu7bM2DrL1aL/zdydw6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2mDkXYxnyETnsdBw8AXCEXW5ryjJ2yJwRgeDaHYyT2Vnro/9XtmKcatE4cTOVw4ur claEytLSE5YhOcIom6EFQqztk1wvpmHmg6nXqLIFZBkgD+E2WTl8s5DvOKtcfgVqKd yda34lqzuAyknNIWti4OgqNuSQtGT3AgCiKF2x1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fengnan Chang , Chao Yu , Jaegeuk Kim Subject: [PATCH 5.16 0954/1039] f2fs: fix remove page failed in invalidate compress pages Date: Mon, 24 Jan 2022 19:45:43 +0100 Message-Id: <20220124184157.355359360@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fengnan Chang commit d1917865a7906baf6b687e15e8e6195a295a3992 upstream. Since compress inode not a regular file, generic_error_remove_page in f2fs_invalidate_compress_pages will always be failed, set compress inode as a regular file to fix it. Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache compressed blocks") Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/inode.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -516,6 +516,11 @@ make_now: } else if (ino == F2FS_COMPRESS_INO(sbi)) { #ifdef CONFIG_F2FS_FS_COMPRESSION inode->i_mapping->a_ops = &f2fs_compress_aops; + /* + * generic_error_remove_page only truncates pages of regular + * inode + */ + inode->i_mode |= S_IFREG; #endif mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS | __GFP_HIGHMEM | __GFP_MOVABLE);