Whamcloud - gitweb
LU-6910 osp: add procfs values for OST reserved size
[fs/lustre-release.git] / lustre / osp / osp_dev.c
index e4af6b6..2a9d30f 100644 (file)
@@ -752,7 +752,17 @@ static int osp_statfs(const struct lu_env *env, struct dt_device *dev,
               LPU64" files, "LPU64" free files\n", d->opd_obd->obd_name,
               sfs->os_blocks, sfs->os_bfree, sfs->os_bavail,
               sfs->os_files, sfs->os_ffree);
-       RETURN(0);
+
+       /* ENOSPC could be for two reasons,
+        * 1) not enough inodes 2) not enough blocks
+        * for 1) lod should use preallocated objects
+        * and for 2) shouldn`t. So, here for ENOSPC
+        * different values is returned to spend preallocated.
+        */
+       if (d->opd_pre_status == -ENOSPC && sfs->os_ffree < 32)
+               RETURN(0);
+
+       RETURN(d->opd_pre_status);
 }
 
 static int osp_sync_timeout(void *data)