Skip to content

Commit c8ed1b3

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: Fix duplicate should_fault_in_pages() call
In gfs2_file_buffered_write(), we currently jump from the second call of function should_fault_in_pages() to above the first call, so should_fault_in_pages() is getting called twice in a row, causing it to accidentally fall back to single-page writes rather than trying the more efficient multi-page writes first. Fix that by moving the retry label to the correct place, behind the first call to should_fault_in_pages(). Fixes: e1fa9ea ("gfs2: Stop using glock holder auto-demotion for now") Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 7b7b06d commit c8ed1b3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/gfs2/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,8 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
10331033
}
10341034

10351035
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, gh);
1036-
retry:
10371036
if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {
1037+
retry:
10381038
window_size -= fault_in_iov_iter_readable(from, window_size);
10391039
if (!window_size) {
10401040
ret = -EFAULT;

0 commit comments

Comments
 (0)