Whamcloud - gitweb
b=18539
authorjxiong <jxiong>
Mon, 9 Mar 2009 14:31:46 +0000 (14:31 +0000)
committerjxiong <jxiong>
Mon, 9 Mar 2009 14:31:46 +0000 (14:31 +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 b8456a8..4396062 100644 (file)
@@ -601,6 +601,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;
@@ -612,7 +620,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 851f1ba..bc89ee9 100644 (file)
@@ -3148,7 +3148,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);
 }