Commit 6a98c9ca authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fs_for_v6.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull udf fixes from Jan Kara:
 "Fix bugs in UDF caused by the big pile of changes that went in during
  the merge window"

* tag 'fs_for_v6.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  udf: Warn if block mapping is done for in-ICB files
  udf: Fix reading of in-ICB files
  udf: Fix lost writes in udf_adinicb_writepage()
parents 55ee6646 63bceed8
...@@ -193,7 +193,7 @@ static int udf_adinicb_writepage(struct folio *folio, ...@@ -193,7 +193,7 @@ static int udf_adinicb_writepage(struct folio *folio,
struct udf_inode_info *iinfo = UDF_I(inode); struct udf_inode_info *iinfo = UDF_I(inode);
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
memcpy_to_page(page, 0, iinfo->i_data + iinfo->i_lenEAttr, memcpy_from_page(iinfo->i_data + iinfo->i_lenEAttr, page, 0,
i_size_read(inode)); i_size_read(inode));
unlock_page(page); unlock_page(page);
mark_inode_dirty(inode); mark_inode_dirty(inode);
...@@ -241,6 +241,15 @@ static int udf_read_folio(struct file *file, struct folio *folio) ...@@ -241,6 +241,15 @@ static int udf_read_folio(struct file *file, struct folio *folio)
static void udf_readahead(struct readahead_control *rac) static void udf_readahead(struct readahead_control *rac)
{ {
struct udf_inode_info *iinfo = UDF_I(rac->mapping->host);
/*
* No readahead needed for in-ICB files and udf_get_block() would get
* confused for such file anyway.
*/
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
return;
mpage_readahead(rac, udf_get_block); mpage_readahead(rac, udf_get_block);
} }
...@@ -407,6 +416,9 @@ static int udf_map_block(struct inode *inode, struct udf_map_rq *map) ...@@ -407,6 +416,9 @@ static int udf_map_block(struct inode *inode, struct udf_map_rq *map)
int err; int err;
struct udf_inode_info *iinfo = UDF_I(inode); struct udf_inode_info *iinfo = UDF_I(inode);
if (WARN_ON_ONCE(iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB))
return -EFSCORRUPTED;
map->oflags = 0; map->oflags = 0;
if (!(map->iflags & UDF_MAP_CREATE)) { if (!(map->iflags & UDF_MAP_CREATE)) {
struct kernel_lb_addr eloc; struct kernel_lb_addr eloc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment