mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
gfs2: Fix duplicate should_fault_in_pages() call
[ Upstream commitc8ed1b3593] 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:e1fa9ea85c("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f5d7f9e155
commit
2e980eb955
@@ -1029,8 +1029,8 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, gh);
|
gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, gh);
|
||||||
retry:
|
|
||||||
if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {
|
if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {
|
||||||
|
retry:
|
||||||
window_size -= fault_in_iov_iter_readable(from, window_size);
|
window_size -= fault_in_iov_iter_readable(from, window_size);
|
||||||
if (!window_size) {
|
if (!window_size) {
|
||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
|
|||||||
Reference in New Issue
Block a user