From: jxiong Date: Mon, 9 Mar 2009 14:31:46 +0000 (+0000) Subject: b=18539 X-Git-Tag: v1_8_0_110~202 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=37a1956c15300ba4d2e4b1159b14ad56cf04b7fd;p=fs%2Flustre-release.git b=18539 r=johann,nathan Do not allocate new files on degraded OSTs (SW RAID) --- diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index b8456a8..4396062 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -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; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 851f1ba..bc89ee9 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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); }