Commit 33e9a53c authored by Jan Kara's avatar Jan Kara
Browse files

udf: Handle error when expanding directory



When there is an error when adding extent to the directory to expand it,
make sure to propagate the error up properly. This is not expected to
happen currently but let's make the code more futureproof.

Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 53cafe1d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -192,8 +192,13 @@ static struct buffer_head *udf_expand_dir_adinicb(struct inode *inode,
	epos.bh = NULL;
	epos.block = iinfo->i_location;
	epos.offset = udf_file_entry_alloc_offset(inode);
	udf_add_aext(inode, &epos, &eloc, inode->i_size, 0);
	ret = udf_add_aext(inode, &epos, &eloc, inode->i_size, 0);
	brelse(epos.bh);
	if (ret < 0) {
		*err = ret;
		udf_free_blocks(inode->i_sb, inode, &eloc, 0, 1);
		return NULL;
	}
	mark_inode_dirty(inode);

	/* Now fixup tags in moved directory entries */