summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2017-10-19 09:43:56 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2017-10-26 10:44:22 +0200
commit4e46a023c515de61df61770e03673c3f72cc6b20 (patch)
treedb30bc3784121022c7be1a992affccb8bc5802fc /fs/f2fs
parent57864ae5ce3ab5c6e3137dd03edefdb2e5531ba1 (diff)
downloadlinux-stable-4e46a023c515de61df61770e03673c3f72cc6b20.tar.gz
linux-stable-4e46a023c515de61df61770e03673c3f72cc6b20.tar.bz2
linux-stable-4e46a023c515de61df61770e03673c3f72cc6b20.zip
f2fs: retry ENOMEM for quota_read|write
This gives another chance to read or write quota data. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/super.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 21e524ecdb1d..c32a1e1db240 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1321,8 +1321,13 @@ static ssize_t f2fs_quota_read(struct super_block *sb, int type, char *data,
tocopy = min_t(unsigned long, sb->s_blocksize - offset, toread);
repeat:
page = read_mapping_page(mapping, blkidx, NULL);
- if (IS_ERR(page))
+ if (IS_ERR(page)) {
+ if (PTR_ERR(page) == -ENOMEM) {
+ congestion_wait(BLK_RW_ASYNC, HZ/50);
+ goto repeat;
+ }
return PTR_ERR(page);
+ }
lock_page(page);
@@ -1365,11 +1370,16 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type,
while (towrite > 0) {
tocopy = min_t(unsigned long, sb->s_blocksize - offset,
towrite);
-
+retry:
err = a_ops->write_begin(NULL, mapping, off, tocopy, 0,
&page, NULL);
- if (unlikely(err))
+ if (unlikely(err)) {
+ if (err == -ENOMEM) {
+ congestion_wait(BLK_RW_ASYNC, HZ/50);
+ goto retry;
+ }
break;
+ }
kaddr = kmap_atomic(page);
memcpy(kaddr + offset, data, tocopy);