From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Darrick J. Wong" <djwong@kernel.org>, Jan Kara <jack@suse.cz>,
Christoph Hellwig <hch@lst.de>,
Christian Brauner <brauner@kernel.org>,
Sasha Levin <sashal@kernel.org>,
jack@suse.com
Subject: [PATCH AUTOSEL 4.9 7/7] quota: make dquot_quota_sync return errors from ->sync_fs
Date: Wed, 9 Feb 2022 13:45:50 -0500 [thread overview]
Message-ID: <20220209184550.48481-7-sashal@kernel.org> (raw)
In-Reply-To: <20220209184550.48481-1-sashal@kernel.org>
From: "Darrick J. Wong" <djwong@kernel.org>
[ 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 <djwong@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
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 82a5ecbe2da96..022b237c6a134 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -676,9 +676,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
prev parent reply other threads:[~2022-02-09 18:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 18:45 [PATCH AUTOSEL 4.9 1/7] net: ieee802154: at86rf230: Stop leaking skb's Sasha Levin
2022-02-09 18:45 ` [PATCH AUTOSEL 4.9 2/7] selftests/zram: Skip max_comp_streams interface on newer kernel Sasha Levin
2022-02-09 18:45 ` [PATCH AUTOSEL 4.9 3/7] selftests/zram01.sh: Fix compression ratio calculation Sasha Levin
2022-02-09 18:45 ` [PATCH AUTOSEL 4.9 4/7] selftests/zram: Adapt the situation that /dev/zram0 is being used Sasha Levin
2022-02-09 18:45 ` [PATCH AUTOSEL 4.9 5/7] ax25: improve the incomplete fix to avoid UAF and NPD bugs Sasha Levin
2022-02-09 18:45 ` [PATCH AUTOSEL 4.9 6/7] vfs: make freeze_super abort when sync_filesystem returns error Sasha Levin
2022-02-09 18:45 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220209184550.48481-7-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=jack@suse.com \
--cc=jack@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome