quota: propagate error from __dquot_initialize
authorChao Yu <yuchao0@huawei.com>
Tue, 28 Nov 2017 15:01:44 +0000 (23:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:39:09 +0000 (17:39 +0100)
commit606592f53b877dc77ec1356ea82ea1d7bb6e8580
tree519f5a37cc6b1fac1185a322363c42294ef8c7d5
parent1271aeb0027cad65ae21737d9b0c60440dae9638
quota: propagate error from __dquot_initialize

[ Upstream commit 1a6152d36dee08da2be2a3030dceb45ef680460a ]

In commit 6184fc0b8dd7 ("quota: Propagate error from ->acquire_dquot()"),
we have propagated error from __dquot_initialize to caller, but we forgot
to handle such error in add_dquot_ref(), so, currently, during quota
accounting information initialization flow, if we failed for some of
inodes, we just ignore such error, and do account for others, which is
not a good implementation.

In this patch, we choose to let user be aware of such error, so after
turning on quota successfully, we can make sure all inodes disk usage
can be accounted, which will be more reasonable.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/quota/dquot.c