Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2153115imm; Mon, 3 Sep 2018 21:18:22 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ9xVranwgm/YaJaD4hzN3Xx/o5dXNldxHuIGvrvRPi70FyfqnPgz288jp2TN70xZ8ARAW+ X-Received: by 2002:a63:115f:: with SMTP id 31-v6mr16674464pgr.53.1536034701977; Mon, 03 Sep 2018 21:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536034701; cv=none; d=google.com; s=arc-20160816; b=w1KNsRxIg1qEMQ4dxkyVG6qI+foS9FFwchgu9hwOzgKGMv7uNXS6/HSXhNubMdMXUV ToFYQZxgoEmXu5yt5f3cIzlqmT0crMb17Wj1E1tNKufo19KU2h2j2Dn161ivPRO7p+iA /MWjz4tIBr5S3objMO67DItyDrL0mFTA8F9DuTPW3NtmJoZLBc2Y4cM4m3sjr4tTmCpP WSWvUj4KymsTPAbuakgJNFYqoQfRiK2fqgWdRRsI5Kx6T7sOfL9iU04RWInQTyEOH9+i skEsg/4UJjjllrDF+lRPVmabja1pPKKG0eG7GtLUufGNb1zKabKCcb0rXmH8EI70xOG2 dqXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EII1fCmMqE5a9Uz5oU/s65aU9LwkecZcROruAPYTtOE=; b=Uvrsbw03SdvCvzq9IpID6Iy89p6F1fGV/NkwtjESLDtiUr3l9E3b/MkvVedw8SeZsR zviwy4d5Xtb6WClADql4THv/a6zq2UNJ3zYfckZtkXilL3UdS9z2RybQUC2yy8I1X6fc QIybEYH2o6+J3xg8PgzEtBAnYKcpq9thoCFPjHVxz2JVQ8OD0M+5SHJjvOzLLhXosfej aXfuaFVYd1u5DyQZSoqMN3FG/i0RgPncTPu0HYALGa4Z8UBAAZqqEfEB/sc8LwMV6xdz BByTuNeTfNHAFx35mHHDD+lletROEOeIjSw77VHuH4jAeT66tdRZc3SuOOgc3ge4rT4y wbuQ== 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 h30-v6si20220656pgb.269.2018.09.03.21.18.07; Mon, 03 Sep 2018 21:18:21 -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 S1726520AbeIDIj7 (ORCPT + 99 others); Tue, 4 Sep 2018 04:39:59 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:34060 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbeIDIj7 (ORCPT ); Tue, 4 Sep 2018 04:39:59 -0400 Received: from Beta.suse.asia (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Mon, 03 Sep 2018 22:16:40 -0600 From: Larry Chen To: mark@fasheh.com, jlbec@evilplan.org Cc: linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com, akpm@linux-foundation.org Subject: [PATCH 0/2] fix cluster leakage in ocfs2_defrag_extent Date: Tue, 4 Sep 2018 12:16:19 +0800 Message-Id: <20180904041621.16874-1-lchen@suse.com> X-Mailer: git-send-email 2.13.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ocfs2_defrag_extent might leak clusters allocated. When file system has no enough space, the number of claimed clusters might less than the caller wants. If that happens, the original code might directly commit trans without returning clusters. This patch refered a lot to ocfs2_add_clusters_in_btree. Larry Chen (2): add declaration of ocfs2_free_local_alloc_bits fix clusters leak in ocfs2_defrag_extent fs/ocfs2/alloc.h | 6 ++++++ fs/ocfs2/move_extents.c | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) -- 2.13.7