From patchwork Fri Sep 3 19:20:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yehuda Sadeh Weinraub X-Patchwork-Id: 154681 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 o83JKPJh013120 for ; Fri, 3 Sep 2010 19:20:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753955Ab0ICTUZ (ORCPT ); Fri, 3 Sep 2010 15:20:25 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:47988 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120Ab0ICTUY convert rfc822-to-8bit (ORCPT ); Fri, 3 Sep 2010 15:20:24 -0400 Received: by wyf22 with SMTP id 22so190914wyf.19 for ; Fri, 03 Sep 2010 12:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=N7rkZHH6zM8QkfJWHeFvSxVDI3vQbNZB03pkwQLYp8g=; b=Bo2nhcDwt2lVL2AQgc9TfHgf7u/LDK+rRZ6qy5y+FDWY5jJOhxLUlNfz/ltpTCuZEz ZUF4a9CumrVbLiB5u4G7tc+ZWRZQsQmO+eMcnd2Kg7yTkqE8wZYqf+NIYxQx1m1Wjvb6 Usypek8t5PalVJ4tGiflfRi8yvLGkC4L6Mq5U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hk8nisB8iBMApznNiCYjxjpCMzir+KSYXCMMJFnhfSqNHfnW4+OT8eJcycpAZ295fQ v/8QQm3aniFMRZr3iDZsd2zQxT2t+cMI1qPloU5CAEAM5Laj59hbJt90paEfnPWNyfji koQjq+O3gLyI24tdBhz2kfK610ZaJ6yMdYf/k= MIME-Version: 1.0 Received: by 10.216.231.26 with SMTP id k26mr1112244weq.3.1283541621811; Fri, 03 Sep 2010 12:20:21 -0700 (PDT) Received: by 10.216.159.135 with HTTP; Fri, 3 Sep 2010 12:20:21 -0700 (PDT) In-Reply-To: References: <1283369392.3894.8.camel@wido-laptop.pcextreme.nl> Date: Fri, 3 Sep 2010 12:20:21 -0700 Message-ID: Subject: Re: Write operation is stuck From: Yehuda Sadeh Weinraub To: Bogdan Lobodzinski Cc: Wido den Hollander , Sage Weil , ceph-devel@vger.kernel.org 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.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Sep 2010 19:20:26 +0000 (UTC) diff --git a/fs/ceph/pagelist.c b/fs/ceph/pagelist.c index b6859f4..46a368b 100644 --- a/fs/ceph/pagelist.c +++ b/fs/ceph/pagelist.c @@ -5,10 +5,18 @@ #include "pagelist.h" +static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl) +{ + struct page *page = list_entry(pl->head.prev, struct page, + lru); + kunmap(page); +} + int ceph_pagelist_release(struct ceph_pagelist *pl) { if (pl->mapped_tail) - kunmap(pl->mapped_tail); + ceph_pagelist_unmap_tail(pl); + while (!list_empty(&pl->head)) { struct page *page = list_first_entry(&pl->head, struct page, lru); @@ -26,7 +34,7 @@ static int ceph_pagelist_addpage(struct ceph_pagelist *pl) pl->room += PAGE_SIZE; list_add_tail(&page->lru, &pl->head); if (pl->mapped_tail) - kunmap(pl->mapped_tail); + ceph_pagelist_unmap_tail(pl); pl->mapped_tail = kmap(page); return 0; }