diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 000ce37e6e1ec963a76b7d0be6da5d5ddbf1107f..31965c3798f221ed7b81d3a37658fd1b9893609e 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -677,6 +677,9 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
 			elen = EXT_RECORDED_ALLOCATED |
 				((elen + inode->i_sb->s_blocksize - 1) &
 				 ~(inode->i_sb->s_blocksize - 1));
+			iinfo->i_lenExtents =
+				ALIGN(iinfo->i_lenExtents,
+				      inode->i_sb->s_blocksize);
 			udf_write_aext(inode, &cur_epos, &eloc, elen, 1);
 		}
 		newblock = udf_get_lb_pblock(inode->i_sb, &eloc, offset);