From patchwork Wed Apr 3 12:38:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1075895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44Z5Kd04xdz9sSQ; Wed, 3 Apr 2019 23:41:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hBfCN-000252-9f; Wed, 03 Apr 2019 12:40:59 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hBfCL-00024q-EI for kernel-team@lists.ubuntu.com; Wed, 03 Apr 2019 12:40:57 +0000 Received: from mail-wm1-f71.google.com ([209.85.128.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hBfCL-0005nW-4L for kernel-team@lists.ubuntu.com; Wed, 03 Apr 2019 12:40:57 +0000 Received: by mail-wm1-f71.google.com with SMTP id t190so4283255wmt.8 for ; Wed, 03 Apr 2019 05:40:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=yAyZeZ/CjnylZqdNDiE4sCH9Sl98f8a29HmN/U0BZK8=; b=HeVfvmQaXgyVzg4nbp3hm2KfgiJN9lUAAqVkCXpshtgqW1vg6XvBrnbexbAXEtItRg QeHZpvtfx2eebC3YSVQqoelKJvOhFx9G7lYFv3mb3CyiI9X5AipWXPd96bvHU95g3lab O/esXP1s/ljuxNzcsdkF5XHMhNGJR39weLS45uyab+I7awhSpbZJKtUUS252jPu6jcea YxQuPVB/AIxc5EQGfg2UogRYxKLnqof3vE/k+CT4Zhpvy1xaUk6biw/k6NOsG9roOOHh gksaeKFpT9pC9hVbH47Mr3V4CJjKPg2uNOYw5EQZ+S9wUKzLlEzLBB70iSHiGtc4w4Zs DSpg== X-Gm-Message-State: APjAAAUBx6zuW5XkoqW7Mta6wnCzW2v7JNLsfVkQLY/qfdr4SEJ1HM5O 6keiIWEBAfR5M18+vf2OXcXz839QSde4Oi7riAHgnxG0Q585pSAyAn7A+r4U5pLv9aeNjr5PXrD gcaxLKyFVuHnu533rxzTYMo3jXUyhSawEj0Ft8frylw== X-Received: by 2002:adf:ef0b:: with SMTP id e11mr37849999wro.244.1554295256659; Wed, 03 Apr 2019 05:40:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIrGF58mf/66PrwInaBAxXhVrAGisDv5vlrtgSesAIFqZYLR0TvjuUvn3gqyvSFALUb/QIUA== X-Received: by 2002:adf:ef0b:: with SMTP id e11mr37849983wro.244.1554295256432; Wed, 03 Apr 2019 05:40:56 -0700 (PDT) Received: from localhost.localdomain (host141-127-dynamic.17-87-r.retail.telecomitalia.it. [87.17.127.141]) by smtp.gmail.com with ESMTPSA id v192sm24748132wme.24.2019.04.03.05.40.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 05:40:55 -0700 (PDT) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [SRU] [Xenial] [PATCH 0/1] btrfs: fallocate: fix memory leak Date: Wed, 3 Apr 2019 14:38:57 +0200 Message-Id: <20190403123857.1420-1-andrea.righi@canonical.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1822579 [Impact] * If fallocate() is failing on a btrfs subvolume when its qgroup quota limit exceeded, a previously allocated extent map isn't correctly released, causing a memory leak from the pool btrfs_extent_map * Fix by correctly deallocating the object in case of failure [Test Case] * https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1822579/+attachment/5252459/+files/btrfs-fallocate-test.sh [Fix] * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=be2d253cc98244765323a7c94cc1ac5cd5a17072 Fix the memory leak by adding the proper free_extent_map() call to the failure path. [Regression Potential] * This is an upstream fix, tested on the affected platform. The patch is really small, backport changes are minimal. All the other Ubuntu releases are including this fix already. Filipe Manana (1): Btrfs: fix extent map leak during fallocate error path fs/btrfs/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)