Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3066192imm; Tue, 4 Sep 2018 14:58:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbvWQsUiTYtWv3id5WtNtVODvNnYDQ06LJydJLsMSfu7ONdO/AnXbtPsTXY5T0rnFMpb03V X-Received: by 2002:a62:8704:: with SMTP id i4-v6mr36688257pfe.62.1536098288117; Tue, 04 Sep 2018 14:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536098288; cv=none; d=google.com; s=arc-20160816; b=RHR2WVPOqA+l/eUmcrfL3sPl2emvChdymh001kswriFesIX3x9dn0jqD7Q10T+ghOA BlQzwJJrxOtSHXBJ3Pt+oRnbNH6TW9sc/x+Mk/Cof4sqpV8wNBcAo5oK+Bat5FVnPeTr AuD+g7ozu7lZX6I07wNEVX783d539ZfwdK0hQF8/5duHBUrmZ9yTt8jhYJY4Od5bTzx+ 7qjSjMfy/eRL0Hod61cMvyVcysyZWGZ3VDl1f5mR+s+2YhItFWMZk9Vi9u33Cfsi84nQ MMrllaTXLbyIFqq1GExwXc7WdDs3hthCNn7x0fOV7VuP4UXmUpdnQm7XqOsp6OsZmM1I rwUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=5y1DP9LmL2kcAqKGBE/Mp24dCetd6PbG4btjQ4vUMFc=; b=z1MUuWiF04OirG1NIV3uOaeh4qlPHklcNRZljlF0+53CmBWI8fcqu01t0keanqaF1V ox+Ul3KEvnTmm/Fmn9/MyST4IF/mtOx32PrUROZPDv8VMdvlgZw1Zso6AEEVZV/srh0C kUZMz+bTH5jxyQQpW3Il28aQndhS6SlEHWQEt7WvR2Z169yPlhtwU6ncC0fxW7QteOCV 1toksBZwNm6xQccc8INB3it2rahiwsanuu4IOPO63z0Ngpkqs/3A4JIRDpOugys7ccOd B1VHK8j+5JR1VPVUdaQalEau5Og4ZRX5ih3xEJx9miYUeyQLPpWya4PwhhrKaYI85tbc 1jlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37-v6si22604142plq.316.2018.09.04.14.57.53; Tue, 04 Sep 2018 14:58:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727382AbeIECWP (ORCPT + 99 others); Tue, 4 Sep 2018 22:22:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48218 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726864AbeIECWO (ORCPT ); Tue, 4 Sep 2018 22:22:14 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4E122CBF; Tue, 4 Sep 2018 21:55:11 +0000 (UTC) Date: Tue, 4 Sep 2018 14:55:10 -0700 From: Andrew Morton To: Larry Chen Cc: mark@fasheh.com, jlbec@evilplan.org, linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com Subject: Re: [PATCH 1/2] add declaration of ocfs2_free_local_alloc_bits Message-Id: <20180904145510.9dd257f40514c8c839745bf4@linux-foundation.org> In-Reply-To: <20180904041621.16874-2-lchen@suse.com> References: <20180904041621.16874-1-lchen@suse.com> <20180904041621.16874-2-lchen@suse.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Sep 2018 12:16:20 +0800 Larry Chen wrote: > Signed-off-by: Larry Chen > --- > fs/ocfs2/alloc.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h > index 250bcacdf9e9..5770503b0e36 100644 > --- a/fs/ocfs2/alloc.h > +++ b/fs/ocfs2/alloc.h > @@ -323,4 +323,10 @@ int ocfs2_find_cpos_for_left_leaf(struct super_block *sb, > int ocfs2_find_subtree_root(struct ocfs2_extent_tree *et, > struct ocfs2_path *left, > struct ocfs2_path *right); > + > +int ocfs2_free_local_alloc_bits(struct ocfs2_super *osb, > + handle_t *handle, > + struct ocfs2_alloc_context *ac, > + u32 bit_off, > + u32 num_bits); > #endif /* OCFS2_ALLOC_H */ It's already declared in fs/ocfs2/localalloc.h - why not include that? I did this with the other patch and all seems well: From: Andrew Morton Subject: fix-clusters-leak-in-ocfs2_defrag_extent-fix include localalloc.h, reduce scope of data_ac Cc: Larry Chen Signed-off-by: Andrew Morton --- fs/ocfs2/move_extents.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/fs/ocfs2/move_extents.c~fix-clusters-leak-in-ocfs2_defrag_extent-fix +++ a/fs/ocfs2/move_extents.c @@ -25,6 +25,7 @@ #include "ocfs2_ioctl.h" #include "alloc.h" +#include "localalloc.h" #include "aops.h" #include "dlmglue.h" #include "extent_map.h" @@ -227,7 +228,6 @@ static int ocfs2_defrag_extent(struct oc u32 new_phys_cpos, new_len; u64 phys_blkno = ocfs2_clusters_to_blocks(inode->i_sb, phys_cpos); int need_free = 0; - struct ocfs2_alloc_context *data_ac; if ((ext_flags & OCFS2_EXT_REFCOUNTED) && *len) { BUG_ON(!ocfs2_is_refcount_inode(inode)); @@ -345,7 +345,8 @@ static int ocfs2_defrag_extent(struct oc out_commit: if (need_free && context->data_ac) { - data_ac = context->data_ac; + struct ocfs2_alloc_context *data_ac = context->data_ac; + if (context->data_ac->ac_which == OCFS2_AC_USE_LOCAL) ocfs2_free_local_alloc_bits(osb, handle, data_ac, new_phys_cpos, new_len); _