Patch "ext4: use memcpy_to_page() in pagecache_write()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ext4: use memcpy_to_page() in pagecache_write()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ext4-use-memcpy_to_page-in-pagecache_write.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0b8b519467585e564104f6fdeb80aeba83ac0bc9
Author: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
Date:   Sun Feb 7 11:04:23 2021 -0800

    ext4: use memcpy_to_page() in pagecache_write()
    
    [ Upstream commit bd256fda92efe97b692dc72e246d35fa724d42d8 ]
    
    Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
    Link: https://lore.kernel.org/r/20210207190425.38107-7-chaitanya.kulkarni@xxxxxxx
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
    Stable-dep-of: 956510c0c743 ("fs: ext4: initialize fsdata in pagecache_write()")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c
index 6a30e54c1128..0c67b7060eb4 100644
--- a/fs/ext4/verity.c
+++ b/fs/ext4/verity.c
@@ -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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux