CEPH_OSDMAP_FULL/NEARFULL aren't set since mimic, so we need to consult per-pool flags as well. Unfortunately the backwards compatibility here is lacking: - the change that deprecated OSDMAP_FULL/NEARFULL went into mimic, but was guarded by require_osd_release >= RELEASE_LUMINOUS - it was subsequently backported to luminous in v12.2.2, but that makes no difference to clients that only check OSDMAP_FULL/NEARFULL because require_osd_release is not client-facing -- it is for OSDs Since all kernels are affected, the best we can do here is just start checking both map flags and pool flags and send that to stable. These checks are best effort, so take osdc->lock and look up pool flags just once. Remove the FIXME, since filesystem quotas are checked above and RADOS quotas are reflected in POOL_FLAG_FULL: when the pool reaches its quota, both POOL_FLAG_FULL and POOL_FLAG_FULL_QUOTA are set.
Showing the changes to include (2 of 4 files). Show all
Unified · Split
| @@ -37,6 +37,9 @@ int ceph_spg_compare(const struct ceph_spg *lhs, const struct ceph_spg *rhs); · 36 unmodified lines | |||
| 37 | #define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id | 37 | #define CEPH_POOL_FLAG_HASHPSPOOL (1ULL << 0) /* hash pg seed and pool id |
| 38 | together */ | 38 | together */ |
| 39 | #define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */ | 39 | #define CEPH_POOL_FLAG_FULL (1ULL << 1) /* pool is full */ |
| 40 | #define CEPH_POOL_FLAG_FULL_QUOTA (1ULL << 10) /* pool ran out of quota, | ||
| 41 | will set FULL too */ | ||
| 42 | #define CEPH_POOL_FLAG_NEARFULL (1ULL << 11) /* pool is nearfull */ | ||
| 40 | 43 | ||
| 41 | struct ceph_pg_pool_info { | 44 | struct ceph_pg_pool_info { |
| 42 | struct rb_node node; | 45 | struct rb_node node; |
| @@ -304,5 +307,6 @@ extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map, · 261 unmodified lines | |||
| 304 | 307 | ||
| 305 | extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); | 308 | extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); |
| 306 | extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); | 309 | extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); |
| 310 | u64 ceph_pg_pool_flags(struct ceph_osdmap *map, u64 id); | ||
| 307 | 311 | ||
| 308 | #endif | 312 | #endif |
| @@ -143,8 +143,10 @@ extern const char *ceph_osd_state_name(int s); · 142 unmodified lines | |||
| 143 | /* | 143 | /* |
| 144 | * osd map flag bits | 144 | * osd map flag bits |
| 145 | */ | 145 | */ |
| 146 | #define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC) */ | 146 | #define CEPH_OSDMAP_NEARFULL (1<<0) /* sync writes (near ENOSPC), |
| 147 | #define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC) */ | 147 | not set since ~luminous */ |
| 148 | #define CEPH_OSDMAP_FULL (1<<1) /* no data writes (ENOSPC), | ||
| 149 | not set since ~luminous */ | ||
| 148 | #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ | 150 | #define CEPH_OSDMAP_PAUSERD (1<<2) /* pause all reads */ |
| 149 | #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ | 151 | #define CEPH_OSDMAP_PAUSEWR (1<<3) /* pause all writes */ |
| 150 | #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ | 152 | #define CEPH_OSDMAP_PAUSEREC (1<<4) /* pause recovery */ |