Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp419imm; Tue, 10 Jul 2018 19:28:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcmsKF8laCRJ8z9uFcHqqePgWnxvbiLyRE5ll5MZ7HAcBPhVxusUgR335X2AP3i62OGb3D6 X-Received: by 2002:a63:a543:: with SMTP id r3-v6mr24851574pgu.336.1531276139837; Tue, 10 Jul 2018 19:28:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531276139; cv=none; d=google.com; s=arc-20160816; b=K/M/T5PtE7j7vsC1cY+uzMxZRqH5gXJf6sLJDh/k4o01ej+u3NLR+VneO/6ORkzRnL BLJ1igYHumybOUKgQ85PrwO+CFv9UziCmiBI4v4x+cBzbn9LPrMJ/ho8iO/kIjYRf4mA pzmNNgiEXmMYxWlSoTVMjBUGVDoPiYq9YmmGz+U0GyQ3XiHolYE0mAPKmwQ+ADhijfJC qBhVYcpiTt6YDE5dfngZDrm/zCmS8i0iLvUy2Xkn2bDNPYMTZe/dh2phOuLQwYBOLrMM cjdoMzzRHfi2LoU6niiSgJ2hKyMyDcIDx145or9zq+6btwmpnZe75MkpSe8Yo6m8kbYw 2CMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=p22otSxDXk0eR5U7kIb3umVmR3iR4dgL+BV7dKFBehk=; b=Z0J8nFBQLAeMem9ZSmWFuKayV2qbBTyQYzIZKa8/dheKz13wFKai5woq5PURj2UZ3d 426vQwOcCZUOTquZ0sCX1EeKYECodciyQOZXlwQcgWTjJ8dAqK4rUY7GtbswhZk61qiP 8/2uUGMX3B7YQQTYSOhYmc4mgDp2Inf+W7b90duKiMGR42VNCEaluviB3ygKMrS81uyl OIIzotTSqjK1M8dMd3bAb3oidQSq5fxRAe4bhV6rAwXZGKwo629tREibR88axBklE5w+ Dsq7Dssnfo3zCnQHU65l9/igx8kVhwDocv6b586GKH6KR/VdRo90+ZBF5ZkM0YssyK0/ zbQQ== 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 n3-v6si18319944pld.146.2018.07.10.19.28.44; Tue, 10 Jul 2018 19:28:59 -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 S1732405AbeGKCYE (ORCPT + 99 others); Tue, 10 Jul 2018 22:24:04 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:45490 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732277AbeGKCYD (ORCPT ); Tue, 10 Jul 2018 22:24:03 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fd4la-0003He-Kq; Wed, 11 Jul 2018 02:22:06 +0000 From: Al Viro To: Linus Torvalds Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Miklos Szeredi Subject: [RFC][PATCH 05/42] fold security_file_free() into file_free() Date: Wed, 11 Jul 2018 03:21:29 +0100 Message-Id: <20180711022206.12571-5-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180711022206.12571-1-viro@ZenIV.linux.org.uk> References: <20180711021136.GN30522@ZenIV.linux.org.uk> <20180711022206.12571-1-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro Signed-off-by: Al Viro --- fs/file_table.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 1f14b80a4e67..eee7cf629e52 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -51,6 +51,7 @@ static void file_free_rcu(struct rcu_head *head) static inline void file_free(struct file *f) { + security_file_free(f); percpu_counter_dec(&nr_files); call_rcu(&f->f_u.fu_rcuhead, file_free_rcu); } @@ -207,7 +208,6 @@ static void __fput(struct file *file) } if (file->f_op->release) file->f_op->release(inode, file); - security_file_free(file); if (unlikely(S_ISCHR(inode->i_mode) && inode->i_cdev != NULL && !(file->f_mode & FMODE_PATH))) { cdev_put(inode->i_cdev); @@ -302,10 +302,8 @@ EXPORT_SYMBOL(fput); void put_filp(struct file *file) { - if (atomic_long_dec_and_test(&file->f_count)) { - security_file_free(file); + if (atomic_long_dec_and_test(&file->f_count)) file_free(file); - } } void __init files_init(void) -- 2.11.0