From b98792ae96ad2bb3c73ca3ebebdd8edfdfbc35df Mon Sep 17 00:00:00 2001 From: yangsheng Date: Tue, 18 Mar 2014 22:57:59 +0800 Subject: [PATCH] LU-4252 osd: remove locking i_mutex in osd_punch This piece of code intent to calm down the kernel WARN_ON messsage show up since 3.9 upstream. So we can just remove it for now. We'll add a ldiskfs patch to resolve this issue while 3.9 server support come up. Change-Id: Ied941b98d213e3aff1c5ba7ec4c6436bdef903c7 Signed-off-by: yang sheng Reviewed-on: http://review.whamcloud.com/9644 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Niu Yawei Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/osd-ldiskfs/osd_io.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 8600bfa..5e2a16b 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -1543,16 +1543,9 @@ static int osd_punch(const struct lu_env *env, struct dt_object *dt, #ifdef HAVE_INODEOPS_TRUNCATE if (inode->i_op->truncate) { inode->i_op->truncate(inode); - } else { -#endif - if (!(inode->i_state & (I_NEW|I_FREEING))) - mutex_lock(&inode->i_mutex); - ldiskfs_truncate(inode); - if (!(inode->i_state & (I_NEW|I_FREEING))) - mutex_unlock(&inode->i_mutex); -#ifdef HAVE_INODEOPS_TRUNCATE - } + } else #endif + ldiskfs_truncate(inode); /* * For a partial-page truncate, flush the page to disk immediately to -- 1.8.3.1