Whamcloud - gitweb
LU-4252 osd: remove locking i_mutex in osd_punch 42/9742/2
authoryangsheng <yang.sheng@intel.com>
Fri, 21 Mar 2014 03:53:30 +0000 (11:53 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 4 Apr 2014 22:33:10 +0000 (22:33 +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.

Signed-off-by: yang sheng <yang.sheng@intel.com>
Change-Id: I0d8a13829ebb1d18c672a09729be603c923bc79c
Reviewed-on: http://review.whamcloud.com/9742
Tested-by: Jenkins
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-ldiskfs/osd_io.c

index 4675fcc..ba17fcf 100644 (file)
@@ -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