Whamcloud - gitweb
LU-4252 osd: remove locking i_mutex in osd_punch 44/9644/3
authoryangsheng <yang.sheng@intel.com>
Tue, 18 Mar 2014 14:57:59 +0000 (22:57 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 20 Mar 2014 12:14:32 +0000 (12:14 +0000)
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 <yang.sheng@intel.com>
Reviewed-on: http://review.whamcloud.com/9644
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_io.c

index 8600bfa..5e2a16b 100644 (file)
@@ -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