Skip to content

Commit 55dd5b4

Browse files
committed
udf: Make sure i_lenExtents is uptodate on inode eviction
UDF maintains total length of all extents in i_lenExtents. Generally we keep extent lengths (and thus i_lenExtents) block aligned because it makes the file appending logic simpler. However the standard mandates that the inode size must match the length of all extents and thus we trim the last extent when closing the file. To catch possible bugs we also verify that i_lenExtents matches i_size when evicting inode from memory. Commit b405c1e ("udf: refactor udf_next_aext() to handle error") however broke the code updating i_lenExtents and thus udf_evict_inode() ended up spewing lots of errors about incorrectly sized extents although the extents were actually sized properly. Fix the updating of i_lenExtents to silence the errors. Fixes: b405c1e ("udf: refactor udf_next_aext() to handle error") CC: [email protected] Signed-off-by: Jan Kara <[email protected]>
1 parent 0d8d44d commit 55dd5b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/udf/truncate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void udf_truncate_tail_extent(struct inode *inode)
115115
}
116116
/* This inode entry is in-memory only and thus we don't have to mark
117117
* the inode dirty */
118-
if (ret == 0)
118+
if (ret >= 0)
119119
iinfo->i_lenExtents = inode->i_size;
120120
brelse(epos.bh);
121121
}

0 commit comments

Comments
 (0)