summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/buffer.c2
-rw-r--r--fs/iomap.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index e0d4c6a5e2d2..0faa41fb4c88 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2104,7 +2104,6 @@ void __generic_write_end(struct inode *inode, loff_t pos, unsigned copied,
}
unlock_page(page);
- put_page(page);
if (old_size < pos)
pagecache_isize_extended(inode, old_size, pos);
@@ -2160,6 +2159,7 @@ int generic_write_end(struct file *file, struct address_space *mapping,
{
copied = block_write_end(file, mapping, pos, len, copied, page, fsdata);
__generic_write_end(mapping->host, pos, copied, page);
+ put_page(page);
return copied;
}
EXPORT_SYMBOL(generic_write_end);
diff --git a/fs/iomap.c b/fs/iomap.c
index 4380d2c412f4..e6453c1c831e 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -772,6 +772,7 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len,
__generic_write_end(inode, pos, ret, page);
if (iomap->page_done)
iomap->page_done(inode, pos, copied, page, iomap);
+ put_page(page);
if (ret < len)
iomap_write_failed(inode, pos, len);