summaryrefslogtreecommitdiff
path: root/fs/ext4/page-io.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-02-28 00:13:16 -0500
committerTheodore Ts'o <tytso@mit.edu>2023-03-23 10:06:07 -0400
commitf1496362e9d7b37fe6b8983086c1548a601b5594 (patch)
tree82021c1eb96717e0b3223d1aaa5db532e5cdcb50 /fs/ext4/page-io.c
parent3f5d30636d2a188ee3cd22c6fef1ace5304a07bf (diff)
ext4: Don't unlock page in ext4_bio_write_page()
Do not unlock the written page in ext4_bio_write_page(). Instead leave the page locked and unlock it in the callers. We'll need to keep the page locked for data=journal writeback for a bit longer. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Link: https://lore.kernel.org/r/20230228051319.4085470-5-tytso@mit.edu
Diffstat (limited to 'fs/ext4/page-io.c')
-rw-r--r--fs/ext4/page-io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index 1e4db96a04e6..8703fd732abb 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -502,7 +502,7 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
/* Nothing to submit? Just unlock the page... */
if (!nr_to_submit)
- goto unlock;
+ return 0;
bh = head = page_buffers(page);
@@ -550,7 +550,8 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
}
bh = bh->b_this_page;
} while (bh != head);
- goto unlock;
+
+ return ret;
}
}
@@ -565,7 +566,6 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
continue;
io_submit_add_bh(io, inode, page, bounce_page, bh);
} while ((bh = bh->b_this_page) != head);
-unlock:
- unlock_page(page);
- return ret;
+
+ return 0;
}