aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r--fs/ubifs/super.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 884beed1dcb8..13e90b0dd95d 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -278,7 +278,7 @@ static void ubifs_destroy_inode(struct inode *inode)
278 */ 278 */
279static int ubifs_write_inode(struct inode *inode, int wait) 279static int ubifs_write_inode(struct inode *inode, int wait)
280{ 280{
281 int err; 281 int err = 0;
282 struct ubifs_info *c = inode->i_sb->s_fs_info; 282 struct ubifs_info *c = inode->i_sb->s_fs_info;
283 struct ubifs_inode *ui = ubifs_inode(inode); 283 struct ubifs_inode *ui = ubifs_inode(inode);
284 284
@@ -299,10 +299,18 @@ static int ubifs_write_inode(struct inode *inode, int wait)
299 return 0; 299 return 0;
300 } 300 }
301 301
302 dbg_gen("inode %lu, mode %#x", inode->i_ino, (int)inode->i_mode); 302 /*
303 err = ubifs_jnl_write_inode(c, inode, 0); 303 * As an optimization, do not write orphan inodes to the media just
304 if (err) 304 * because this is not needed.
305 ubifs_err("can't write inode %lu, error %d", inode->i_ino, err); 305 */
306 dbg_gen("inode %lu, mode %#x, nlink %u",
307 inode->i_ino, (int)inode->i_mode, inode->i_nlink);
308 if (inode->i_nlink) {
309 err = ubifs_jnl_write_inode(c, inode, 0);
310 if (err)
311 ubifs_err("can't write inode %lu, error %d",
312 inode->i_ino, err);
313 }
306 314
307 ui->dirty = 0; 315 ui->dirty = 0;
308 mutex_unlock(&ui->ui_mutex); 316 mutex_unlock(&ui->ui_mutex);