Whamcloud - gitweb
LU-12977 ldiskfs: properly take inode_lock() for truncates
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_io.c
index 0cffae6..9095b51 100644 (file)
@@ -2160,7 +2160,9 @@ void osd_execute_truncate(struct osd_object *obj)
                return;
        }
 
+       inode_lock(inode);
        ldiskfs_truncate(inode);
+       inode_unlock(inode);
 
        /*
         * For a partial-page truncate, flush the page to disk immediately to