Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

quota: make dquot_quota_sync return errors from ->sync_fs

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>

+8 -3
+8 -3
fs/quota/dquot.c
··· 690 690 /* This is not very clever (and fast) but currently I don't know about 691 691 * any other simple way of getting quota data to disk and we must get 692 692 * them there for userspace to be visible... */ 693 - if (sb->s_op->sync_fs) 694 - sb->s_op->sync_fs(sb, 1); 695 - sync_blockdev(sb->s_bdev); 693 + if (sb->s_op->sync_fs) { 694 + ret = sb->s_op->sync_fs(sb, 1); 695 + if (ret) 696 + return ret; 697 + } 698 + ret = sync_blockdev(sb->s_bdev); 699 + if (ret) 700 + return ret; 696 701 697 702 /* 698 703 * Now when everything is written we can discard the pagecache so