From patchwork Thu Oct 31 01:10:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 3118241 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BC07EBF924 for ; Thu, 31 Oct 2013 01:10:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDB4B203EC for ; Thu, 31 Oct 2013 01:10:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 238E7203E9 for ; Thu, 31 Oct 2013 01:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752372Ab3JaBKw (ORCPT ); Wed, 30 Oct 2013 21:10:52 -0400 Received: from mga14.intel.com ([143.182.124.37]:5422 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752323Ab3JaBKv (ORCPT ); Wed, 30 Oct 2013 21:10:51 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 30 Oct 2013 18:10:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="382542229" Received: from jfdmzpr03.jf.intel.com (HELO zyan5-mobl.sh.intel.com) ([10.7.210.22]) by azsmga001.ch.intel.com with ESMTP; 30 Oct 2013 18:10:49 -0700 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org Cc: sage@inktank.com, "Yan, Zheng" Subject: [PATCH] ceph: wake up 'safe' waiters when unregistering request Date: Thu, 31 Oct 2013 09:10:47 +0800 Message-Id: <1383181847-7041-1-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.8.1.4 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Yan, Zheng" We also need to wake up 'safe' waiters if error occurs or request aborted. Otherwise sync(2)/fsync(2) may hang forever. Signed-off-by: Yan, Zheng --- fs/ceph/mds_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 8ef7926..cb6a7ae 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -643,6 +643,8 @@ static void __unregister_request(struct ceph_mds_client *mdsc, iput(req->r_unsafe_dir); req->r_unsafe_dir = NULL; } + + complete_all(&req->r_safe_completion); ceph_mdsc_put_request(req); } @@ -2186,7 +2188,6 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) if (head->safe) { req->r_got_safe = true; __unregister_request(mdsc, req); - complete_all(&req->r_safe_completion); if (req->r_got_unsafe) { /*