Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4427951pxb; Mon, 21 Feb 2022 21:18:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzY5iUbOgCRYIVqxU2QjM7SZHt/ye55DIttEJ1LmuI/FGOk5xb1SV/epqYDVHViEiI2p29t X-Received: by 2002:a17:90a:3c82:b0:1b9:19df:48ba with SMTP id g2-20020a17090a3c8200b001b919df48bamr2374734pjc.177.1645507084126; Mon, 21 Feb 2022 21:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507084; cv=none; d=google.com; s=arc-20160816; b=qD+dw6/yOOLAL1JwRzIHIybMTeCtoBW9pPVR119RMZVBAMms4ql7vqyLz+wuLWJJfK bHbpyjQfZEg+5XPCV7NEJKYD8z0EGBcIVwhCyJ4MW09pfzhGGhM7Et4Y+Mc7eJF2Oyks nBGWwQaZ2w2kndKRwjdEHKIqSvw9AJUCxzDdhICeFdvxBwXv2EWMGafknnO2DocxSdHd abuR7065IbgIUUWxBQQWTU39EKYnIfLdoMICTuo+l+IVs6G+oLB1iA5J876kMDYmf9Oa Ex5pF8mbgwgeosxEc3OI09O7IHKJ8tXZd1l1VvGgqKIeOrp5ZjhuAzMf5KLNE41ftfYN Kt5w== 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=Okfh4PfpJ9PKpvJ25aU/Yrz+6ykgA7BOYfYYSzGk6+0=; b=LBHVov8rh1rMKaK5u5ceZo1fKdc5p5/ftVPa6/MuvWjjZ4+cGKwXglZaN7n7t+JFZ4 B+hQQpTA1lGXGusQhQVYF8tfRDzorf0mDhD3vrpf0l+rypwxxbSuQUwEXmv8h4EH4/wB 1O9dRfwtS1IQY6KFtPo+MpojQP82JRf94JAIukv87e/AKX6ZQsaB6aVFjtqCEVxc5Kt6 uKxkd0evHbJ35lZYDxCTKrc/V+DbZWY3O2HKrcXKYe7IO0p/MaVZvr0tUXjYb87Z/eZq GH70YzQ2qOfYhV3ZIV6oxSdCS1TeHNEoeRuc1zo/T9+/SZoYtr7MNylHqtDGWltA2jcS 7isA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nR8ySD1W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f10si10997581pfv.15.2022.02.21.21.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:18:04 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nR8ySD1W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C246CEBAFF; Mon, 21 Feb 2022 20:50:00 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350467AbiBUJbO (ORCPT + 99 others); Mon, 21 Feb 2022 04:31:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349702AbiBUJVj (ORCPT ); Mon, 21 Feb 2022 04:21:39 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B4126AE2; Mon, 21 Feb 2022 01:08:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2FC846097C; Mon, 21 Feb 2022 09:08:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15657C340E9; Mon, 21 Feb 2022 09:08:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434523; bh=NDFlc56uHX1BFyYLnXWX3MmsbvH/DYsnbkI3mGhD8kQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nR8ySD1WNYmgjB9GwV80y/tgbawiQRQyM9jcZNGPRyo82U3Hq2RojfewmcjNKQdIO DKuW2QhVr1orJM9eLzhhCIiw+tMAyDTMrSgRNfasgCYdtWaRTMjFuu8/eYA0JGubVs D8BIUnxkIbKz5vlMxCR2D88IdAneLuKy+8xz+bG4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Darrick J. Wong" , Jan Kara , Christoph Hellwig , Christian Brauner , Sasha Levin Subject: [PATCH 5.15 037/196] quota: make dquot_quota_sync return errors from ->sync_fs Date: Mon, 21 Feb 2022 09:47:49 +0100 Message-Id: <20220221084932.174793223@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084930.872957717@linuxfoundation.org> References: <20220221084930.872957717@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Darrick J. Wong [ Upstream commit dd5532a4994bfda0386eb2286ec00758cee08444 ] Strangely, dquot_quota_sync ignores the return code from the ->sync_fs call, which means that quotacalls like Q_SYNC never see the error. This doesn't seem right, so fix that. Signed-off-by: Darrick J. Wong Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Sasha Levin --- fs/quota/dquot.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 22d904bde6ab9..a74aef99bd3d6 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -690,9 +690,14 @@ int dquot_quota_sync(struct super_block *sb, int type) /* This is not very clever (and fast) but currently I don't know about * any other simple way of getting quota data to disk and we must get * them there for userspace to be visible... */ - if (sb->s_op->sync_fs) - sb->s_op->sync_fs(sb, 1); - sync_blockdev(sb->s_bdev); + if (sb->s_op->sync_fs) { + ret = sb->s_op->sync_fs(sb, 1); + if (ret) + return ret; + } + ret = sync_blockdev(sb->s_bdev); + if (ret) + return ret; /* * Now when everything is written we can discard the pagecache so -- 2.34.1