From 47e3e27521a9aaa58277e6085243be77ce0c5b29 Mon Sep 17 00:00:00 2001 From: jxiong Date: Mon, 9 Mar 2009 13:39:02 +0000 Subject: [PATCH] b=18539 r=johann,nathan Do not allocate new files on degraded OSTs (SW RAID) --- lustre/include/lustre/lustre_idl.h | 10 +++++++++- lustre/obdfilter/filter.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index f7941cb..7e9cfdd 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -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; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index d309c91..76e558f 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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); } -- 1.8.3.1