Whamcloud - gitweb
b=18539
authorjxiong <jxiong>
Mon, 9 Mar 2009 13:39:02 +0000 (13:39 +0000)
committerjxiong <jxiong>
Mon, 9 Mar 2009 13:39:02 +0000 (13:39 +0000)
r=johann,nathan

Do not allocate new files on degraded OSTs (SW RAID)

lustre/include/lustre/lustre_idl.h
lustre/obdfilter/filter.c

index f7941cb..7e9cfdd 100644 (file)
@@ -1027,6 +1027,14 @@ struct lov_mds_md_v3 {            /* LOV EA mds/wire data (little-endian) */
 /* don't forget obdo_fid which is way down at the bottom so it can
  * come after the definition of llog_cookie */
 
+enum obd_statfs_state {
+        OS_STATE_DEGRADED       = 0x00000001, /**< RAID degraded/rebuilding */
+        OS_STATE_READONLY       = 0x00000002, /**< filesystem is read-only */
+        OS_STATE_RDONLY_1       = 0x00000004, /**< obsolete 1.6, was EROFS=30 */
+        OS_STATE_RDONLY_2       = 0x00000008, /**< obsolete 1.6, was EROFS=30 */
+        OS_STATE_RDONLY_3       = 0x00000010, /**< obsolete 1.6, was EROFS=30 */
+};
+
 struct obd_statfs {
         __u64           os_type;
         __u64           os_blocks;
@@ -1038,7 +1046,7 @@ struct obd_statfs {
         __u32           os_bsize;
         __u32           os_namelen;
         __u64           os_maxbytes;
-        __u32           os_state;       /* positive error code on server */
+        __u32           os_state;       /**< obd_statfs_state OS_STATE_* flag */
         __u32           os_spare1;
         __u32           os_spare2;
         __u32           os_spare3;
index d309c91..76e558f 100644 (file)
@@ -3686,7 +3686,7 @@ static int filter_statfs(struct obd_device *obd, struct obd_statfs *osfs,
          * stop creating files on MDS if OST is not good shape to create
          * objects.*/
         osfs->os_state = (filter->fo_obt.obt_sb->s_flags & MS_RDONLY) ?
-                EROFS : 0;
+                OS_STATE_READONLY : 0;
         RETURN(rc);
 }