Whamcloud - gitweb
LU-6096 osd: mark directory's inode dirty 72/14772/10
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Mon, 25 May 2015 12:25:37 +0000 (15:25 +0300)
committerAndreas Dilger <andreas.dilger@intel.com>
Tue, 26 May 2015 17:37:33 +0000 (17:37 +0000)
ldiskfs_init_new_dir() doesn't mark the inode
dirty, so i_size isn't transferred when ./..
are being inserted.

Change-Id: I1a80a80f6646984fbdec03d65579e735f6fac7c5
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: http://review.whamcloud.com/14772
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
lustre/osd-ldiskfs/osd_handler.c

index 9dbef7c..f898d67 100644 (file)
@@ -3758,6 +3758,13 @@ static int osd_add_dot_dotdot(struct osd_thread_info *info,
                        dir->oo_compat_dotdot_created = 1;
        }
 
+       /* ldiskfs_init_new_dir() doesn't call ldiskfs_mark_inode_dirty()
+        * this seem as an optimization as usually it's called
+        * later to refresh mtime of the parent. Lustre does not
+        * update mtime in few cases (e.g. PENDING, .lustre)
+        * we still need to transfer i_size/etc to the buffer cache */
+       ldiskfs_mark_inode_dirty(oth->ot_handle, dir->oo_inode);
+
        return result;
 }