Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4032153pxb; Mon, 21 Feb 2022 10:31:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkG2l1DqDLBu/llkUhtxsZPjcbDQTJ8uB+KLFViisBBh/qLv+4hLSn4QSkIwD1wASm53zm X-Received: by 2002:a63:2356:0:b0:372:c64f:ab1a with SMTP id u22-20020a632356000000b00372c64fab1amr16653293pgm.230.1645468270244; Mon, 21 Feb 2022 10:31:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645468270; cv=none; d=google.com; s=arc-20160816; b=aBM4j7zodIhtHhLZtPSFhgND756/2F10xZBpn8CWkcHxF1TtdKx92RbQB6z9SvOnBi pG6KpqHfQ5aPKmenH9HW54FTieVXqvQ3eC9RFia+KiRfbKXKf98g6x/jCNwTrJ2UViYq umoszTik20qjSgo5eTVt/2IDAN26CcbcgBHkfaVW45ApaN8cGMhpYiWQnh6vk3GX8FBn 4DxCZO9ObS/UHAKMpO7qobfp69ubSFo69B95zcqvG0s97u04RnClU+BEfivoIOwVbYWL imEhZ1nDryR4vUacVfGzgKU4qaEvBSeu1d/S1pws5kmv/movbobjUKBSKi5TovyKdvgO asZQ== 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=eynXhDg8OjBh34/UiJh0RM2Xc8cU7DS+5q6ImzLAksM=; b=lMIPAo7CxKmERI4g/vR40CYVl/vavvIZgINpqPkN+VkAmUo1EGp3gdue8bgjVT6iXK QbLGqRdd/Lh/wnEA5+LpWG0HSVxjqbagAlMH1o8im50qn7IxDONdoPmzrwgq7hMkdLy0 5a2LkIvm5HctKduF/EHdYHi9W62k+xfT5Rh1viuYqpngY0sBT8LSt+HqPso61Y2wcPE8 1Z0pQaZHCxy60LnJ+arLngKzaOkHnGtBxue8148P6Abth9aLMLr/y71N8HlaV/ZKaNiU /v/kYQC9IgBDhfRwJoXNIZnKCFVb3GDP/mjAjGUF0mA2WANUA72+wukjlauNRVxn8ZPs ceJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P4BGBX7m; 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 b22si9187972pft.303.2022.02.21.10.30.53; Mon, 21 Feb 2022 10:31:10 -0800 (PST) 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=P4BGBX7m; 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 S1348079AbiBUJKv (ORCPT + 99 others); Mon, 21 Feb 2022 04:10:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347721AbiBUJGC (ORCPT ); Mon, 21 Feb 2022 04:06:02 -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 55CD030F50; Mon, 21 Feb 2022 00:59:37 -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 EF2DCB80EAF; Mon, 21 Feb 2022 08:59:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38B2FC36AE2; Mon, 21 Feb 2022 08:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433975; bh=FAgBnFMSrrN/3bKFuNbXbryXkImZhZnCtcmX/wA3NG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4BGBX7mEjM3youbEr3MImRD2nYt1IaOpm4R4OpHh1ieEBJXXX8h+ZyucLz4Zt3hf z2DaTExqk2W55KN0tj/rKMSh6HYM9S7H69XARiwQ+dT791IGzZkPDyx5cTujDTYQbN eclC5GtuRHR3zS/3JNcMTxEBZGLa/ia5OtSiJt9Q= 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.4 17/80] quota: make dquot_quota_sync return errors from ->sync_fs Date: Mon, 21 Feb 2022 09:48:57 +0100 Message-Id: <20220221084916.150145130@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@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=-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: 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 7abc3230c21a4..dc5f8654b277d 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -693,9 +693,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