Commit 52b19ac993f1aeadbce15b55302be9a35346e235

Authored by Jan Kara
1 parent ed313489ba

udf: Fix BUG_ON() in destroy_inode()

udf_clear_inode() can leave behind buffers on mapping's i_private list (when
we truncated preallocation). Call invalidate_inode_buffers() so that the list
is properly cleaned-up before we return from udf_clear_inode(). This is ugly
and suggest that we should cleanup preallocation earlier than in clear_inode()
but currently there's no such call available since drop_inode() is called under
inode lock and thus is unusable for disk operations.

Signed-off-by: Jan Kara <jack@suse.cz>

Showing 2 changed files with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -878,6 +878,7 @@
878 878 spin_unlock(&buffer_mapping->private_lock);
879 879 }
880 880 }
  881 +EXPORT_SYMBOL(invalidate_inode_buffers);
881 882  
882 883 /*
883 884 * Remove any clean buffers from the inode's buffer list. This is called
... ... @@ -106,6 +106,7 @@
106 106 udf_truncate_tail_extent(inode);
107 107 unlock_kernel();
108 108 write_inode_now(inode, 0);
  109 + invalidate_inode_buffers(inode);
109 110 }
110 111 iinfo = UDF_I(inode);
111 112 kfree(iinfo->i_ext.i_data);