On Wed 17-04-24 16:04:09, Matthew Wilcox (Oracle) wrote: > Use the folio APIs throughout this function. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Looks good. > up_write(&iinfo->i_data_sem); > err = filemap_fdatawrite(inode->i_mapping); > if (err) { > /* Restore everything back so that we don't lose data... */ > - lock_page(page); > + folio_lock(folio); > down_write(&iinfo->i_data_sem); > - memcpy_to_page(page, 0, iinfo->i_data + iinfo->i_lenEAttr, > - inode->i_size); > - unlock_page(page); > + memcpy_from_folio(iinfo->i_data + iinfo->i_lenEAttr, > + folio, 0, inode->i_size); > + folio_unlock(folio); So this actually silently fixes a bug on the error recovery path where we could be loosing old data in case of ENOSPC. I'll add: Fixes: 1eeceaec794e ("udf: Convert udf_expand_file_adinicb() to avoid kmap_atomic()") and some commentary on commit. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR