diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2023-06-07 07:19:50 -0500 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2023-06-13 16:51:25 +0200 |
commit | cea44032bc799b088bce1ea73c08269bb59b47d0 (patch) | |
tree | 98aee39593b851e39cde5376b82330145a937644 /fs | |
parent | 6fa0a72cbbe45db4ed967a51f9e6f4e3afe61d20 (diff) | |
download | linux-cea44032bc799b088bce1ea73c08269bb59b47d0.tar.gz linux-cea44032bc799b088bce1ea73c08269bb59b47d0.tar.bz2 linux-cea44032bc799b088bce1ea73c08269bb59b47d0.zip |
gfs2: retry interrupted internal reads
The iomap-based read operations done by gfs2 for its system files, such
as rindex, may sometimes be interrupted and return -EINTR. This
confuses some users of gfs2_internal_read(). Fix that by retrying
interrupted reads.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/aops.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index d95125714ebb..dacc21b1ae00 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -491,13 +491,16 @@ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos, void *p; do { - amt = size - copied; - if (offset + size > PAGE_SIZE) - amt = PAGE_SIZE - offset; page = read_cache_page(mapping, index, gfs2_read_folio, NULL); - if (IS_ERR(page)) + if (IS_ERR(page)) { + if (PTR_ERR(page) == -EINTR) + continue; return PTR_ERR(page); + } p = kmap_atomic(page); + amt = size - copied; + if (offset + size > PAGE_SIZE) + amt = PAGE_SIZE - offset; memcpy(buf + copied, p + offset, amt); kunmap_atomic(p); put_page(page); |