From patchwork Mon Jan 21 10:48:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 10773577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3ECB1823 for ; Mon, 21 Jan 2019 10:49:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E30F3298E3 for ; Mon, 21 Jan 2019 10:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7A78298F2; Mon, 21 Jan 2019 10:49:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87387298EA for ; Mon, 21 Jan 2019 10:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727882AbfAUKt5 (ORCPT ); Mon, 21 Jan 2019 05:49:57 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39069 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbfAUKt5 (ORCPT ); Mon, 21 Jan 2019 05:49:57 -0500 Received: by mail-ed1-f65.google.com with SMTP id b14so16189101edt.6 for ; Mon, 21 Jan 2019 02:49:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=k4v5vr414yWiO/IFY4mKJ6U48xTYHvOYPzgmQFy2VCg=; b=HD3jF/+z7BXOJRvSUMFiKp9cBCDYErUdjuGxpcl68TNYjOm05ywvQl4wZQyRpIo8Ao yCSNQzQ3+BiTArUnO/mWct08rUHaLvHOkF8YJEhE8LMtxAbXBwGDBWU5yF34SFToNil+ wB6maVIr4prAMDtbjAg2x/tx7BmidScQm2Cq3DCaBbfGFhbLVIdl91MiAyIe1RailyJP RGcGvBZIgHVy1hTJh37CupZ17xmPqtfg8WwE84qtE+wCWTC1b/i063grGBxkI0EpMpzY oxgjC/ASnUbVuJB/4FZxyC3RwKnc+db5tMezjdqElwj2kBXIR57Ar2tsv9+90edZ5PpJ yqmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k4v5vr414yWiO/IFY4mKJ6U48xTYHvOYPzgmQFy2VCg=; b=pzARVl7fR5HzR33sPs8kr6KUv+V3e1EDVO637nCmUWfa4tx0wzvb8JkigL9blGR9ZJ RTSNGIZaW6e5qYfcPsVrSd4jmX7qWP/c4aPZIKg4/libQWsrLBZYyCGCoFpcfr16GAYB bgYLTKo4437c/mjNHv2bvk54t7YRZ0PCNq2RMQ3oW3/n2tZ5esmMuCCCRjMPSLjwcebH Bte6W8pQz3yBjoT/GBsgZcXvwjpUl1pY9MV5QCC4Lv8FH6W2yUf0G91rw/qDhgCfaL/L EiljYPa0mQ9SXjKsphMDOyNh0+0n+S+kR4Zpjw5axltjvhgqxvi2hWDz2B5U6k/zu5HJ 1b9A== X-Gm-Message-State: AJcUukcNyud7AQKAWLaZDrvc6s4WLRZCzCSab/heRporm+CV8DRwY14F 6CnFCRpb9e8y+wTR+pRdQkKHEw== X-Google-Smtp-Source: ALg8bN6NKrcT1mzbi37ZanIdYOWAvk7zQXIt9AhJwnD1yA9ze8xSDY2qNzBlkoKRSkPfQzN+kG/MHw== X-Received: by 2002:aa7:d88c:: with SMTP id u12mr25208242edq.237.1548067795513; Mon, 21 Jan 2019 02:49:55 -0800 (PST) Received: from localhost.localdomain ([2a02:8109:b6bf:f9e4:9473:6b39:afaf:14d4]) by smtp.gmail.com with ESMTPSA id e35sm9006196eda.13.2019.01.21.02.49.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jan 2019 02:49:55 -0800 (PST) From: Christian Brauner To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, dhowells@redhat.com Cc: tkjos@google.com, Christian Brauner Subject: [PATCH v1 5/7] binderfs: kill_litter_super() before cleanup Date: Mon, 21 Jan 2019 11:48:06 +0100 Message-Id: <20190121104808.24108-6-christian@brauner.io> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190121104808.24108-1-christian@brauner.io> References: <20190121104808.24108-1-christian@brauner.io> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Al pointed out that first calling kill_litter_super() before cleaning up info is more correct since destroying info doesn't depend on the state of the dentries and inodes. That the opposite remains true is not guaranteed. Suggested-by: Al Viro Signed-off-by: Christian Brauner --- /* Changelog */ v1: - patch unchanged --- drivers/android/binderfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 1e077498a507..ba88be172aee 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -531,11 +531,12 @@ static void binderfs_kill_super(struct super_block *sb) { struct binderfs_info *info = sb->s_fs_info; + kill_litter_super(sb); + if (info && info->ipc_ns) put_ipc_ns(info->ipc_ns); kfree(info); - kill_litter_super(sb); } static struct file_system_type binder_fs_type = {