<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Wed, 9 Jan 2019 at 14:43, Mark Syms <<a href="mailto:Mark.Syms@citrix.com">Mark.Syms@citrix.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We don't yet know how the assert got triggered as we've only seen it once and in the original form it looks like it would be very hard to trigger in any normal case (given that in default usage i_blocks should be at least 8 times what any putative value for change could be). So, for the assert to have triggered we've been asked to remove at least 8 times the number of blocks currently allocated to the inode. Possible causes could be a double release or some other higher level bug that will require further investigation to uncover.<br></blockquote><div><br></div><div>The following change has at least survived xfstests:</div><div><br></div><div>--- a/fs/gfs2/inode.h<br>+++ b/fs/gfs2/inode.h<br>@@ -61,8 +61,8 @@ static inline u64 gfs2_get_inode_blocks(const struct inode *inode)<br> <br> static inline void gfs2_add_inode_blocks(struct inode *inode, s64 change)<br> {<br>-    gfs2_assert(GFS2_SB(inode), (change >= 0 || inode->i_blocks > -change));<br>-    change *= (GFS2_SB(inode)->sd_sb.sb_bsize/GFS2_BASIC_BLOCK);<br>+    change <<= inode->i_blkbits - 9;<br>+    gfs2_assert(GFS2_SB(inode), change >= 0 || inode->i_blocks >= -change);<br>     inode->i_blocks += change;<br></div><div> }</div><div><br></div><div>Andreas</div></div></div></div></div></div>