Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2885377rwb; Mon, 15 Aug 2022 13:18:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR5gTEh9WHLPmngJtzlCMn+Fm1b2uOunUASUqc4ASwAlpuG1Co1gT0Crnnmra4sdGmk/v+rf X-Received: by 2002:aa7:d292:0:b0:43d:7923:66cd with SMTP id w18-20020aa7d292000000b0043d792366cdmr15173586edq.403.1660594680630; Mon, 15 Aug 2022 13:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594680; cv=none; d=google.com; s=arc-20160816; b=rCuE1omIalsXi3vJvHqNu0BRxHa63YhIutDnF+qdr4SND8dNy6AKPOyLHO0sDg4tPA xVvJGf9Xum8pwLX1BBNikx0u1ua+FX66N6B3oDzGibI1svas9j7PkwEOUbERrhfeatFG Hc8dHMs2YY0Z/CkXh2wh0+MlvbSyniUiP/cVidgT6VqvSSoNRPNcYNEdWBz6ASEfTDxh wya+tk5mGj1Fn+yzw65NFDmDogZM+F+KRYNO3hq64fAU4K0ObIaMhNyhNN3NM52SejG0 iwSdzt/rC9fxjL+8JJKWENzt9tjci7Y58QVF8p5wVhlUow4cU83roY915Nc7RPFIvfom rgqw== 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=womGaK7x91SKCFQr9HENLFkLkezaXabJYNhW11yDuwE=; b=GYwQ7Xd64UhzlnNg5YiUSFrDM+dd5BzfDOvashG8QOZG3cYLolVDJufKHghW6d9i8D HDTIJcNXTOE1klpedMI8Obedmosy+B1CJWO2DmagTsx8NVvRz4kPo+KZ1tlsFHFT7WXZ ylaqSoIAwDVwf/7MN2ZxZnbxdZcKthhPdknxYgMc0YgX9p0wlXYq5DOFDXNCS88UN8A8 GHQQy2bdDQ8Sii2+BCTU4aSuY8vJi3WeMtKYua0oBRAm3aKS6c0nHIyi1k0YWD/Uoity ARZSci3f9MP3KhkZoTfV3D27K0e1dyAcjTfcksDI8+B8t2cX2DSfzb0jOXz8EShk5wAs CtPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BsjZPgd+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f14-20020a056402004e00b0043bd24198desi7353101edu.526.2022.08.15.13.17.35; Mon, 15 Aug 2022 13:18:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BsjZPgd+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1345230AbiHOTs7 (ORCPT + 99 others); Mon, 15 Aug 2022 15:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345530AbiHOTrD (ORCPT ); Mon, 15 Aug 2022 15:47:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA2F70E46; Mon, 15 Aug 2022 11:49:26 -0700 (PDT) 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 C713661154; Mon, 15 Aug 2022 18:49:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9842EC433D7; Mon, 15 Aug 2022 18:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589365; bh=ipEuWqVwLQzWBrbxUH2ccIIU5vSZ5RZEqX7SzOLfPMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BsjZPgd+me1py/ypzfOqYl8Pf26a9HNWwE60G9Gip8lkeZ/o8Owsw36K7NHv58BSX V1WxRBVDQE87cndJs0ygkPy8ynj4wlfjNFEVmqd0ZCykEZfeYck2yLpxvJ7LtodOgL PTZoxQF07K1p6Q9gQoJjaW2AtidBQ9DMX5DtvI7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sungjong Seo , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.15 664/779] f2fs: allow compression for mmap files in compress_mode=user Date: Mon, 15 Aug 2022 20:05:08 +0200 Message-Id: <20220815180405.736724412@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sungjong Seo [ Upstream commit 66d34fcbbe63ebd8584b792e0d741f6648100894 ] Since commit e3c548323d32 ("f2fs: let's allow compression for mmap files"), it has been allowed to compress mmap files. However, in compress_mode=user, it is not allowed yet. To keep the same concept in both compress_modes, f2fs_ioc_(de)compress_file() should also allow it. Let's remove checking mmap files in f2fs_ioc_(de)compress_file() so that the compression for mmap files is also allowed in compress_mode=user. Signed-off-by: Sungjong Seo Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/file.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index eacc80ac160f..0669464a942a 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -4011,11 +4011,6 @@ static int f2fs_ioc_decompress_file(struct file *filp, unsigned long arg) goto out; } - if (f2fs_is_mmap_file(inode)) { - ret = -EBUSY; - goto out; - } - ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) goto out; @@ -4083,11 +4078,6 @@ static int f2fs_ioc_compress_file(struct file *filp, unsigned long arg) goto out; } - if (f2fs_is_mmap_file(inode)) { - ret = -EBUSY; - goto out; - } - ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX); if (ret) goto out; -- 2.35.1