From patchwork Wed May 18 16:01:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 793832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4IG0YEA016658 for ; Wed, 18 May 2011 16:00:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756993Ab1ERQAB (ORCPT ); Wed, 18 May 2011 12:00:01 -0400 Received: from cobra.newdream.net ([66.33.216.30]:34654 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756958Ab1ERQAA (ORCPT ); Wed, 18 May 2011 12:00:00 -0400 Received: from cobra.newdream.net (localhost [127.0.0.1]) by cobra.newdream.net (Postfix) with ESMTP id 6F190BC6C4; Wed, 18 May 2011 09:01:06 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=newdream.net; h=date:from:to:cc :subject:in-reply-to:message-id:references:mime-version: content-type; q=dns; s=newdream.net; b=kUy6L61HATDxKbsQ5mVSUKMVU Boh6trLGyN8X7bBE0VIAXD9fNiG0V+P3jB2cNghwK4bYDF4uLdxME/WK4MQAXgxk io9g5R0GnIrCTlaHwJQywoAaVLLxMo4B52f6OWqpdN0UUrCiJSXg+0K7zEowD77E U+jDgQ8DIBJKis/08w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=newdream.net; h=date:from :to:cc:subject:in-reply-to:message-id:references:mime-version: content-type; s=newdream.net; bh=JGXLFcqpFIMCHW1kB/hPapanDFY=; b=CH9IGgLyo+/KUIXyIWx3BgN/gB5T9pv0umzl53dEfeVDK1FJn3pnfsQniZojO VEO7ZYR/XCQE3vtg1l/ZH8cB8YYUG25OYWz1/T93t7S6vnC+N0RzpaTfPeAUBFTh 4i10Wib1fipG8Qe3+p2F2e+d0uaWAdMEmwTAGzj49IP8aw= Received: by cobra.newdream.net (Postfix, from userid 1031) id 5645CBC76B; Wed, 18 May 2011 09:01:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by cobra.newdream.net (Postfix) with ESMTP id 41075BC6C4; Wed, 18 May 2011 09:01:06 -0700 (PDT) Date: Wed, 18 May 2011 09:01:06 -0700 (PDT) From: Sage Weil To: Simon Tian cc: ceph-devel@vger.kernel.org Subject: Re: operate one file in multi clients with libceph In-Reply-To: Message-ID: References: MIME-Version: 1.0 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 (demeter2.kernel.org [140.211.167.43]); Wed, 18 May 2011 16:00:35 +0000 (UTC) Hi Simon, On Wed, 18 May 2011, Simon Tian wrote: > Hi, > > Could any one give me an answer? > > My application need to open one file with two clients in different > hosts. One for write/read and one for read only. The client could be > developed based on libceph or librbd. > I tried librbd, exception appear too. I opened a bug for this, http://tracker.newdream.net/issues/1097. Can you try the patch below? I this may just be something missed in a locking rewrite way back when in a rare code path: Thanks! sage --- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/client/Client.cc b/src/client/Client.cc index 7f7fb08..bf0997a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -4934,7 +4934,6 @@ public: void Client::sync_write_commit(Inode *in) { - client_lock.Lock(); assert(unsafe_sync_write > 0); unsafe_sync_write--; @@ -4947,8 +4946,6 @@ void Client::sync_write_commit(Inode *in) } put_inode(in); - - client_lock.Unlock(); } int Client::write(int fd, const char *buf, loff_t size, loff_t offset)