From: yangsheng Date: Fri, 21 Mar 2014 03:53:30 +0000 (+0800) Subject: LU-4252 osd: remove locking i_mutex in osd_punch X-Git-Tag: 2.5.1-crt1~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F9742%2F2;p=fs%2Flustre-release.git 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. Signed-off-by: yang sheng Change-Id: I0d8a13829ebb1d18c672a09729be603c923bc79c Reviewed-on: http://review.whamcloud.com/9742 Tested-by: Jenkins Reviewed-by: Niu Yawei Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 4675fcc..ba17fcf 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -1214,16 +1214,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