Konstantin Khlebnikov 9651e6b2e2 ext4: handle the rest of ext4_mb_load_buddy() ENOMEM errors
I've got another report about breaking ext4 by ENOMEM error returned from
ext4_mb_load_buddy() caused by memory shortage in memory cgroup.
This time inside ext4_discard_preallocations().

This patch replaces ext4_error() with ext4_warning() where errors returned
from ext4_mb_load_buddy() are not fatal and handled by caller:
* ext4_mb_discard_group_preallocations() - called before generating ENOSPC,
  we'll try to discard other group or return ENOSPC into user-space.
* ext4_trim_all_free() - just stop trimming and return ENOMEM from ioctl.

Some callers cannot handle errors, thus __GFP_NOFAIL is used for them:
* ext4_discard_preallocations()
* ext4_mb_discard_lg_preallocations()

Fixes: adb7ef600cc9 ("ext4: use __GFP_NOFAIL in ext4_free_blocks()")
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-05-21 22:35:23 -04:00
..
2015-04-02 23:47:42 -04:00
2016-09-30 02:14:56 -04:00
2017-04-30 00:36:53 -04:00
2017-04-30 00:36:53 -04:00
2017-02-02 11:52:14 -05:00
2016-05-13 00:44:16 -04:00
2017-04-30 00:36:53 -04:00
2017-04-30 00:36:53 -04:00
2016-03-09 23:49:05 -05:00
2016-11-01 09:43:26 -06:00
2017-04-03 01:05:58 -04:00
2017-04-30 00:01:02 -04:00