Skip to content
Snippets Groups Projects
Commit 1af60964 authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Greg Kroah-Hartman
Browse files

ext4: use memcpy_to_page() in pagecache_write()


[ Upstream commit bd256fda ]

Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Link: https://lore.kernel.org/r/20210207190425.38107-7-chaitanya.kulkarni@wdc.com


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Stable-dep-of: 956510c0 ("fs: ext4: initialize fsdata in pagecache_write()")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 49dac5e0
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,6 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
PAGE_SIZE - offset_in_page(pos));
struct page *page;
void *fsdata;
void *addr;
int res;
res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0,
......@@ -88,9 +87,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
if (res)
return res;
addr = kmap_atomic(page);
memcpy(addr + offset_in_page(pos), buf, n);
kunmap_atomic(addr);
memcpy_to_page(page, offset_in_page(pos), buf, n);
res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n,
page, fsdata);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment