From patchwork Mon Jun 20 18:56:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 898032 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5KIuj5J009872 for ; Mon, 20 Jun 2011 18:56:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755502Ab1FTS46 (ORCPT ); Mon, 20 Jun 2011 14:56:58 -0400 Received: from natasha.panasas.com ([67.152.220.90]:50852 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755332Ab1FTS45 (ORCPT ); Mon, 20 Jun 2011 14:56:57 -0400 Received: from zenyatta.panasas.com (zenyatta.int.panasas.com [172.17.28.63]) by natasha.panasas.com (8.13.1/8.13.1) with ESMTP id p5KIuCKj026070; Mon, 20 Jun 2011 14:56:13 -0400 Received: from [172.17.133.48] (172.17.133.48) by zenyatta.int.panasas.com (172.17.28.63) with Microsoft SMTP Server (TLS) id 14.1.289.1; Mon, 20 Jun 2011 14:56:07 -0400 Message-ID: <4DFF97C4.1050106@panasas.com> Date: Mon, 20 Jun 2011 11:56:04 -0700 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.38.b3pre.fc13 Thunderbird/3.1.9 MIME-Version: 1.0 To: "Halevy, Benny" , Fred Isaman , NFS list , Peng Tao Subject: Re: [PATCH] FIXME: pnfs: BUG in layout_commit logic References: <4DFBB71F.3050703@panasas.com> In-Reply-To: <4DFBB71F.3050703@panasas.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@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]); Mon, 20 Jun 2011 18:56:59 +0000 (UTC) On 06/17/2011 01:20 PM, Boaz Harrosh wrote: > > When segments are used with the pnfs-objects driver (which supports them) > I get a crash in layout commit do to unbalanced lseg reference counting. > (under reference) > > With this patch taken from the blocks layout part of the patchset this > problem goes away. But looking at the code it looks scary to me > (I just don't understand it fully). > > Fred please review this code, to see if you like what it does. > > I will need a fix for the v3.0 Kernel > > SOB: Boaz Benny, Fred, Hi. This patch is from the pnfsblock branch: [0e5ef56b] pnfs: let layoutcommit code handle multiple segments by: Peng Tao Except the above patch has one obvious bug where segments are not found (See below) Fred I'm not sure I like this patch it looks wrong to me. But it does solve my immediate problem (Needed for this Kernel). Have you had a chance to look at this code and think about what we should do? Thanks Boaz --- SQUASHME: Fix BUG in: [0e5ef56b] pnfs: let layoutcommit code handle multiple segments The patch: [0e5ef56b] pnfs: let layoutcommit code handle multiple segments Broke pnfs_find_lseg because now with the new break, the smaller then last layouts are never found. (Though I agree that searching in reverse might be an optimization since the last one is usually what we need. (Perhaps reverse the offset test)) Signed-off-by: Boaz Harrosh --- -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index d9ffaab..169fe92 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -905,7 +905,7 @@ pnfs_find_lseg(struct pnfs_layout_hdr *lo, dprintk("%s:Begin\n", __func__); assert_spin_locked(&lo->plh_inode->i_lock); - list_for_each_entry_reverse(lseg, &lo->plh_segs, pls_list) { + list_for_each_entry(lseg, &lo->plh_segs, pls_list) { if (test_bit(NFS_LSEG_VALID, &lseg->pls_flags) && is_matching_lseg(&lseg->pls_range, range)) { ret = get_lseg(lseg);