]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ext4: use memcpy_to_page() in pagecache_write()
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Sun, 7 Feb 2021 19:04:23 +0000 (11:04 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:55 +0000 (11:41 +0100)
[ Upstream commit e171a6e2fbef22c42f614aa2770928c6e8b775b6 ]

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Link: https://lore.kernel.org/r/20210207190425.38107-7-chaitanya.kulkarni@wdc.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Stable-dep-of: 956510c0c743 ("fs: ext4: initialize fsdata in pagecache_write()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/verity.c

index 6a30e54c11282f83c8d1db00f4375f2a6d461042..0c67b7060eb43073165b03d6141fea3ce822714d 100644 (file)
@@ -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);