diff options
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/super.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 06e3b22a0c1b..884beed1dcb8 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -314,8 +314,9 @@ static void ubifs_delete_inode(struct inode *inode) | |||
314 | { | 314 | { |
315 | int err; | 315 | int err; |
316 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 316 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
317 | struct ubifs_inode *ui = ubifs_inode(inode); | ||
317 | 318 | ||
318 | if (ubifs_inode(inode)->xattr) | 319 | if (ui->xattr) |
319 | /* | 320 | /* |
320 | * Extended attribute inode deletions are fully handled in | 321 | * Extended attribute inode deletions are fully handled in |
321 | * 'ubifs_removexattr()'. These inodes are special and have | 322 | * 'ubifs_removexattr()'. These inodes are special and have |
@@ -326,13 +327,12 @@ static void ubifs_delete_inode(struct inode *inode) | |||
326 | dbg_gen("inode %lu, mode %#x", inode->i_ino, (int)inode->i_mode); | 327 | dbg_gen("inode %lu, mode %#x", inode->i_ino, (int)inode->i_mode); |
327 | ubifs_assert(!atomic_read(&inode->i_count)); | 328 | ubifs_assert(!atomic_read(&inode->i_count)); |
328 | ubifs_assert(inode->i_nlink == 0); | 329 | ubifs_assert(inode->i_nlink == 0); |
329 | ubifs_assert(!ubifs_inode(inode)->dirty); | ||
330 | 330 | ||
331 | truncate_inode_pages(&inode->i_data, 0); | 331 | truncate_inode_pages(&inode->i_data, 0); |
332 | if (is_bad_inode(inode)) | 332 | if (is_bad_inode(inode)) |
333 | goto out; | 333 | goto out; |
334 | 334 | ||
335 | ubifs_inode(inode)->ui_size = inode->i_size = 0; | 335 | ui->ui_size = inode->i_size = 0; |
336 | err = ubifs_jnl_write_inode(c, inode, 1); | 336 | err = ubifs_jnl_write_inode(c, inode, 1); |
337 | if (err) | 337 | if (err) |
338 | /* | 338 | /* |
@@ -341,6 +341,8 @@ static void ubifs_delete_inode(struct inode *inode) | |||
341 | */ | 341 | */ |
342 | ubifs_err("can't write inode %lu, error %d", inode->i_ino, err); | 342 | ubifs_err("can't write inode %lu, error %d", inode->i_ino, err); |
343 | out: | 343 | out: |
344 | if (ui->dirty) | ||
345 | ubifs_release_dirty_inode_budget(c, ui); | ||
344 | clear_inode(inode); | 346 | clear_inode(inode); |
345 | } | 347 | } |
346 | 348 | ||