From patchwork Tue Feb 7 12:28:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9559761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64021602B1 for ; Tue, 7 Feb 2017 12:28:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 537B42522B for ; Tue, 7 Feb 2017 12:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46EB8280DE; Tue, 7 Feb 2017 12:28:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F22662522B for ; Tue, 7 Feb 2017 12:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080AbdBGM2m (ORCPT ); Tue, 7 Feb 2017 07:28:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49086 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753591AbdBGM2c (ORCPT ); Tue, 7 Feb 2017 07:28:32 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2153364D8A; Tue, 7 Feb 2017 12:28:33 +0000 (UTC) Received: from tleilax.poochiereds.net (ovpn-120-47.rdu2.redhat.com [10.10.120.47] (may be forged)) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v17CSTZW008114; Tue, 7 Feb 2017 07:28:32 -0500 From: Jeff Layton To: ceph-devel@vger.kernel.org Cc: zyan@redhat.com, sage@redhat.com, idryomov@gmail.com, jspray@redhat.com Subject: [PATCH v3 4/5] ceph: register map callback to handle ENOSPC conditions Date: Tue, 7 Feb 2017 07:28:27 -0500 Message-Id: <20170207122828.5550-5-jlayton@redhat.com> In-Reply-To: <20170207122828.5550-1-jlayton@redhat.com> References: <20170207122828.5550-1-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 07 Feb 2017 12:28:33 +0000 (UTC) Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jeff Layton --- fs/ceph/mds_client.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 93fc893e1930..fcf1e5313c16 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -433,6 +433,18 @@ static int __verify_registered_session(struct ceph_mds_client *mdsc, return 0; } +static void handle_osd_map(struct ceph_osd_client *osdc) +{ + u32 cancelled_epoch; + + lockdep_assert_held(&osdc->lock); + + cancelled_epoch = ceph_osdc_abort_on_full(osdc); + if (cancelled_epoch) + osdc->epoch_barrier = max(cancelled_epoch + 1, + osdc->epoch_barrier); +} + /* * create+register a new session for given mds. * called under mdsc->mutex. @@ -3485,6 +3497,7 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc) ceph_caps_init(mdsc); ceph_adjust_min_caps(mdsc, fsc->min_caps); + fsc->client->osdc.map_cb = handle_osd_map; init_rwsem(&mdsc->pool_perm_rwsem); mdsc->pool_perm_tree = RB_ROOT;