From patchwork Tue Mar 15 09:18:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henry Chang X-Patchwork-Id: 635451 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2F9IMPL012734 for ; Tue, 15 Mar 2011 09:19:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328Ab1COJTo (ORCPT ); Tue, 15 Mar 2011 05:19:44 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:35763 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499Ab1COJTn (ORCPT ); Tue, 15 Mar 2011 05:19:43 -0400 Received: by pzk9 with SMTP id 9so64220pzk.19 for ; Tue, 15 Mar 2011 02:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:x-mailer; bh=Jxzau4VEw/9dYNeq/Bgmd3cIL1uApgb153DaQq3cwhg=; b=jRe/zt/9Usy5IE0PhmVTZ7YTwOPVKFbP6yZZtgwR/CtLgTIYppCgtuVhc0N1dUKB5A oggr+pHI6gJwRNVB4pmMOqQEL3P0ddVEO4TAU5LpSkPhyvNVqDuPWg2Vj2WNNm6uDTnR Ry5mUkG8mrYV3GNSAdqyuwu7+0OUnhkEVtWG8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; b=f7mFoJbfXOO7okHZb1KBsCnddUff2dxxaRvS4xks2oqh75y5NCFCNrjqtfBzRzwuVu S++N9jrVaxxfFG2+DbCtrHo67gEGQeszChkHuxDzi/1XeD5oz87f15t4CulxHnMj3XJu QRX0vphaTjMiZxWyutmab5Nn+/2bP5tVe08vA= Received: by 10.142.62.38 with SMTP id k38mr10964972wfa.85.1300180782467; Tue, 15 Mar 2011 02:19:42 -0700 (PDT) Received: from localhost.localdomain ([122.146.30.126]) by mx.google.com with ESMTPS id d35sm11481897wfj.9.2011.03.15.02.19.39 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Mar 2011 02:19:41 -0700 (PDT) From: Henry C Chang To: ceph-devel@vger.kernel.org Subject: [PATCH 1/2] ceph: remove request from unsafe list if it is canceled/timed out Date: Tue, 15 Mar 2011 09:18:01 +0000 Message-Id: <1300180682-18749-1-git-send-email-henry_c_chang@tcloudcomputing.com> X-Mailer: git-send-email 1.7.2.3 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 15 Mar 2011 09:19:44 +0000 (UTC) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 7d0e4a8..db5d863 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -568,7 +568,14 @@ more: spin_unlock(&ci->i_unsafe_lock); ceph_get_cap_refs(ci, CEPH_CAP_FILE_WR); } + ret = ceph_osdc_wait_request(&fsc->client->osdc, req); + if (ret < 0 && req->r_safe_callback) { + spin_lock(&ci->i_unsafe_lock); + list_del_init(&req->r_unsafe_item); + spin_unlock(&ci->i_unsafe_lock); + ceph_put_cap_refs(ci, CEPH_CAP_FILE_WR); + } } if (file->f_flags & O_DIRECT)