Skip to content

Commit 49854d3

Browse files
committed
udf: Fix lost writes in udf_adinicb_writepage()
The patch converting udf_adinicb_writepage() to avoid manually kmapping the page used memcpy_to_page() however that copies in the wrong direction (effectively overwriting file data with the old contents). What we should be using is memcpy_from_page() to copy data from the page into the inode and then mark inode dirty to store the data. Fixes: 5cfc453 ("udf: Convert udf_adinicb_writepage() to memcpy_to_page()") Signed-off-by: Jan Kara <[email protected]>
1 parent fe15c26 commit 49854d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/udf/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int udf_adinicb_writepage(struct folio *folio,
193193
struct udf_inode_info *iinfo = UDF_I(inode);
194194

195195
BUG_ON(!PageLocked(page));
196-
memcpy_to_page(page, 0, iinfo->i_data + iinfo->i_lenEAttr,
196+
memcpy_from_page(iinfo->i_data + iinfo->i_lenEAttr, page, 0,
197197
i_size_read(inode));
198198
unlock_page(page);
199199
mark_inode_dirty(inode);

0 commit comments

Comments
 (0)