From patchwork Tue Dec 31 00:13:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 3421191 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 2BCEEC02DC for ; Tue, 31 Dec 2013 00:14:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6134F2010E for ; Tue, 31 Dec 2013 00:14:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11707200FE for ; Tue, 31 Dec 2013 00:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932417Ab3LaAOF (ORCPT ); Mon, 30 Dec 2013 19:14:05 -0500 Received: from cobra.newdream.net ([66.33.216.30]:34246 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932405Ab3LaAOA (ORCPT ); Mon, 30 Dec 2013 19:14:00 -0500 Received: from nine.front.sepia.ceph.com (unknown [38.122.20.226]) by cobra.newdream.net (Postfix) with ESMTPA id 6371780487; Mon, 30 Dec 2013 16:14:00 -0800 (PST) From: Sage Weil To: stable@vger.kernel.org Cc: ceph-devel@vger.kernel.org, Li Wang Subject: [PATCH 4/4] ceph: allocate non-zero page to fscache in readpage() Date: Mon, 30 Dec 2013 16:13:51 -0800 Message-Id: <1388448831-10324-5-git-send-email-sage@inktank.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1388448831-10324-1-git-send-email-sage@inktank.com> References: <1388448831-10324-1-git-send-email-sage@inktank.com> 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.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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: Li Wang ceph_osdc_readpages() returns number of bytes read, currently, the code only allocate full-zero page into fscache, this patch fixes this. Signed-off-by: Li Wang Reviewed-by: Milosz Tanski Reviewed-by: Sage Weil (cherry picked from commit ff638b7df5a9264024a6448bdfde2b2bf5d1994a) --- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 6df8bd4..1e561c0 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -216,7 +216,7 @@ static int readpage_nounlock(struct file *filp, struct page *page) } SetPageUptodate(page); - if (err == 0) + if (err >= 0) ceph_readpage_to_fscache(inode, page); out: