Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3600595pxb; Mon, 24 Jan 2022 13:13:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxa6WGu8UR7I2BeatIZItawsUqb509+bVy7iE9Ua2CY6jM4y7LNPFzsr2uzL6VZvO/LDMNn X-Received: by 2002:a63:a741:: with SMTP id w1mr13086865pgo.620.1643058836636; Mon, 24 Jan 2022 13:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058836; cv=none; d=google.com; s=arc-20160816; b=uVFk6JdB23VUE0Jh5ppnoGo9CWplg+nOdLUTlIFVcNZt/XhQa4kz3+bURKoFj5BieI xngSP5OJkCfHp3O58KOLVsJxXf/mtH+0JIyEVxpjookiceNOaAJsDV/05niEa/mzcav5 yEVkMWaWUemj2ieBKrbL+BZ3vuBxoxOz0B3o/lvpNMS+Lsdnv79hLzsIkn1mkWvnkAh6 hzAGHmVvBaAXGjrCylSWXfUztRpB9LHGF5BV9Qwd07WapeK617tnMPD6ZzNV21yVfxei CdWSNiNZyBWKfHgiGbU9X2moJi35cs6/BsClAKaVVLWkhaIxLRNOkdAjMIwEfC2NrQsM E4aQ== 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=iEC6owqY+/s7i9b91vKtFaroCpVVQcKxISs4VcwQ+0A=; b=DC4r+gRFAoiMta2eRqXFD+FNsvu+Dty5m5ZKLHifSMDjcG6thd9+782tKHfnf8B2C0 6OEUvsQ7CIc9Kv8Ayr/dJdQIGFHlSauqA6o43JxcFD3v+P/yeBtML9+mk23cS3bsXCEw oRr4zPSsbITw7dmnwf7D810r5uyns8/v0ms49ZS/SDIvq2ZxhiLJ9xu4x2yDKzsrbgl9 tkUWxudmnleC+Es8FPDWU5ENj/opvbujtBNUEI7xcPmUBB+PiTvGLhdz9xNCBCVdsiNh UUaQHbKOsGKpFefLJm2NS/LvULTnV/GAy5sm0gF+KKQvO0zEgpFblKKPWOK1AawvWuzr Hasg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zwBay6TL; 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 w4si12686598plz.621.2022.01.24.13.13.43; Mon, 24 Jan 2022 13:13:56 -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=zwBay6TL; 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 S1385916AbiAXUeq (ORCPT + 99 others); Mon, 24 Jan 2022 15:34:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355456AbiAXUNl (ORCPT ); Mon, 24 Jan 2022 15:13:41 -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 6F48DC06177E; Mon, 24 Jan 2022 11:37:01 -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 2BF5BB80FA1; Mon, 24 Jan 2022 19:37:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E94DC340E5; Mon, 24 Jan 2022 19:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643053018; bh=KXa3PZX3KZ79XnZVl87pu7FZ3QvuxgE02+fJGd2UNa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zwBay6TLX9Yv9r0Lm8wTWrlpP6jRSD3zGXHbQGHmr1r6IVGRU9pBsn4pPK5/kR/QC xY9QE6HPqXqpIqIorA8XM7UVDA83HYEceJdGMtcEYo3sK/Oaj/ysHSu40vgVjUAQaI nh6yvrNv6GerfCQGqtM+fDpKoOf1t7g72TuCMa9U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xie Yongji , Miklos Szeredi Subject: [PATCH 5.4 250/320] fuse: Pass correct lend value to filemap_write_and_wait_range() Date: Mon, 24 Jan 2022 19:43:54 +0100 Message-Id: <20220124184002.493762000@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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: Xie Yongji commit e388164ea385f04666c4633f5dc4f951fca71890 upstream. The acceptable maximum value of lend parameter in filemap_write_and_wait_range() is LLONG_MAX rather than -1. And there is also some logic depending on LLONG_MAX check in write_cache_pages(). So let's pass LLONG_MAX to filemap_write_and_wait_range() in fuse_writeback_range() instead. Fixes: 59bda8ecee2f ("fuse: flush extending writes") Signed-off-by: Xie Yongji Cc: # v5.15 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/fuse/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -3188,7 +3188,7 @@ fuse_direct_IO(struct kiocb *iocb, struc static int fuse_writeback_range(struct inode *inode, loff_t start, loff_t end) { - int err = filemap_write_and_wait_range(inode->i_mapping, start, -1); + int err = filemap_write_and_wait_range(inode->i_mapping, start, LLONG_MAX); if (!err) fuse_sync_writes(inode);