summaryrefslogtreecommitdiff
path: root/fs/quota
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-01-30 19:53:16 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-23 14:00:59 +0300
commit1e73f5cfc160d0f04b8e40d40fe23004f54e1f52 (patch)
tree1a9309872a27567da0786cde9ebec3dde034184a /fs/quota
parentc405640aad56e8e203b18beea0d0e7b9efc4eaab (diff)
downloadlinux-1e73f5cfc160d0f04b8e40d40fe23004f54e1f52.tar.xz
quota: make dquot_quota_sync return errors from ->sync_fs
[ 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>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 4f1373463766..09fb8459bb5c 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -692,9 +692,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