From 52437f5218fc911cc0b6b9f36e8a143bf54f1024 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Mon, 25 May 2015 15:25:37 +0300 Subject: [PATCH] LU-6096 osd: mark directory's inode dirty 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 Reviewed-on: http://review.whamcloud.com/14772 Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Niu Yawei --- lustre/osd-ldiskfs/osd_handler.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 9dbef7c..f898d67 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -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; } -- 1.8.3.1