libceph: make abort_on_full a per-osdc setting
The intent behind making it a per-request setting was that it would be set for writes, but not for reads. As it is, the flag is set for all fs/ceph requests except for pool perm check stat request (technically a read). ceph_osdc_abort_on_full() skips reads since the previous commit and I don't see a use case for marking individual requests. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Acked-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
This commit is contained in:
parent
690f951d7e
commit
c843d13cae
|
@ -1935,7 +1935,6 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci,
|
||||||
err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false);
|
err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false);
|
||||||
|
|
||||||
wr_req->r_mtime = ci->vfs_inode.i_mtime;
|
wr_req->r_mtime = ci->vfs_inode.i_mtime;
|
||||||
wr_req->r_abort_on_full = true;
|
|
||||||
err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false);
|
err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false);
|
||||||
|
|
||||||
if (!err)
|
if (!err)
|
||||||
|
|
|
@ -895,7 +895,6 @@ static void ceph_aio_retry_work(struct work_struct *work)
|
||||||
req->r_callback = ceph_aio_complete_req;
|
req->r_callback = ceph_aio_complete_req;
|
||||||
req->r_inode = inode;
|
req->r_inode = inode;
|
||||||
req->r_priv = aio_req;
|
req->r_priv = aio_req;
|
||||||
req->r_abort_on_full = true;
|
|
||||||
|
|
||||||
ret = ceph_osdc_start_request(req->r_osdc, req, false);
|
ret = ceph_osdc_start_request(req->r_osdc, req, false);
|
||||||
out:
|
out:
|
||||||
|
|
|
@ -616,7 +616,9 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt,
|
||||||
err = PTR_ERR(fsc->client);
|
err = PTR_ERR(fsc->client);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
fsc->client->extra_mon_dispatch = extra_mon_dispatch;
|
fsc->client->extra_mon_dispatch = extra_mon_dispatch;
|
||||||
|
fsc->client->osdc.abort_on_full = true;
|
||||||
|
|
||||||
if (!fsopt->mds_namespace) {
|
if (!fsopt->mds_namespace) {
|
||||||
ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP,
|
ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP,
|
||||||
|
|
|
@ -202,7 +202,6 @@ struct ceph_osd_request {
|
||||||
struct timespec r_mtime; /* ditto */
|
struct timespec r_mtime; /* ditto */
|
||||||
u64 r_data_offset; /* ditto */
|
u64 r_data_offset; /* ditto */
|
||||||
bool r_linger; /* don't resend on failure */
|
bool r_linger; /* don't resend on failure */
|
||||||
bool r_abort_on_full; /* return ENOSPC when full */
|
|
||||||
|
|
||||||
/* internal */
|
/* internal */
|
||||||
unsigned long r_stamp; /* jiffies, send or check time */
|
unsigned long r_stamp; /* jiffies, send or check time */
|
||||||
|
@ -348,6 +347,7 @@ struct ceph_osd_client {
|
||||||
struct rb_root linger_map_checks;
|
struct rb_root linger_map_checks;
|
||||||
atomic_t num_requests;
|
atomic_t num_requests;
|
||||||
atomic_t num_homeless;
|
atomic_t num_homeless;
|
||||||
|
bool abort_on_full; /* abort w/ ENOSPC when full */
|
||||||
int abort_err;
|
int abort_err;
|
||||||
struct delayed_work timeout_work;
|
struct delayed_work timeout_work;
|
||||||
struct delayed_work osds_timeout_work;
|
struct delayed_work osds_timeout_work;
|
||||||
|
|
|
@ -1030,7 +1030,6 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
|
||||||
truncate_size, truncate_seq);
|
truncate_size, truncate_seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
req->r_abort_on_full = true;
|
|
||||||
req->r_flags = flags;
|
req->r_flags = flags;
|
||||||
req->r_base_oloc.pool = layout->pool_id;
|
req->r_base_oloc.pool = layout->pool_id;
|
||||||
req->r_base_oloc.pool_ns = ceph_try_get_string(layout->pool_ns);
|
req->r_base_oloc.pool_ns = ceph_try_get_string(layout->pool_ns);
|
||||||
|
@ -2239,7 +2238,7 @@ again:
|
||||||
(ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) ||
|
(ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) ||
|
||||||
pool_full(osdc, req->r_t.base_oloc.pool))) {
|
pool_full(osdc, req->r_t.base_oloc.pool))) {
|
||||||
dout("req %p full/pool_full\n", req);
|
dout("req %p full/pool_full\n", req);
|
||||||
if (req->r_abort_on_full) {
|
if (osdc->abort_on_full) {
|
||||||
err = -ENOSPC;
|
err = -ENOSPC;
|
||||||
} else {
|
} else {
|
||||||
pr_warn_ratelimited("FULL or reached pool quota\n");
|
pr_warn_ratelimited("FULL or reached pool quota\n");
|
||||||
|
@ -2446,8 +2445,7 @@ static int abort_on_full_fn(struct ceph_osd_request *req, void *arg)
|
||||||
struct ceph_osd_client *osdc = req->r_osdc;
|
struct ceph_osd_client *osdc = req->r_osdc;
|
||||||
bool *victims = arg;
|
bool *victims = arg;
|
||||||
|
|
||||||
if (req->r_abort_on_full &&
|
if ((req->r_flags & CEPH_OSD_FLAG_WRITE) &&
|
||||||
(req->r_flags & CEPH_OSD_FLAG_WRITE) &&
|
|
||||||
(ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) ||
|
(ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) ||
|
||||||
pool_full(osdc, req->r_t.base_oloc.pool))) {
|
pool_full(osdc, req->r_t.base_oloc.pool))) {
|
||||||
if (!*victims) {
|
if (!*victims) {
|
||||||
|
@ -2470,7 +2468,8 @@ static void ceph_osdc_abort_on_full(struct ceph_osd_client *osdc)
|
||||||
{
|
{
|
||||||
bool victims = false;
|
bool victims = false;
|
||||||
|
|
||||||
if (ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) || have_pool_full(osdc))
|
if (osdc->abort_on_full &&
|
||||||
|
(ceph_osdmap_flag(osdc, CEPH_OSDMAP_FULL) || have_pool_full(osdc)))
|
||||||
for_each_request(osdc, abort_on_full_fn, &victims);
|
for_each_request(osdc, abort_on_full_fn, &victims);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue