From patchwork Wed Jul 22 13:02:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Gr=C3=BCnbacher?= X-Patchwork-Id: 6843951 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AB0A8C05AC for ; Wed, 22 Jul 2015 13:24:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E8E7F204DE for ; Wed, 22 Jul 2015 13:24:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 138DE20544 for ; Wed, 22 Jul 2015 13:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964956AbbGVNYK (ORCPT ); Wed, 22 Jul 2015 09:24:10 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37203 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756558AbbGVNEH (ORCPT ); Wed, 22 Jul 2015 09:04:07 -0400 Received: by wibud3 with SMTP id ud3so171475076wib.0; Wed, 22 Jul 2015 06:04:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iKbRLGn6wTf4JWFd8n2wD7DkWq4v9u4oJO1YaHcjw8M=; b=n0QRxiNkPCv0L46HydhTmNbY4RLJmEj8wxeR07tHl9lBN7shr/pz2gqAsj8SBL2Yvm T9Yp9YeGD3gvQPuEagCogbk7HYk/zjBZBOwCpPWVn+rOrnLTBqEgYwaUjav+umegRUof 54zg1eHCGyHMG5UH8d0IW6Te0bMNC1DMHGQ54nAYg9yTR6czRbV+k+AtPaZY2P8XoXoO uFAn2n8dc1MaAVz2J3RWMRP3nvEyzqgng7bGujEAvqtR42DTH+CwFDNuuA1VdoezI/pd YgzCttOv2Q6bJ7rgRPjFfgNICXoxqPIWUAUN+uiqOwjp1Og6nUNOAsPl4Lmpluyml06V tkzg== X-Received: by 10.180.77.107 with SMTP id r11mr6443308wiw.74.1437570245491; Wed, 22 Jul 2015 06:04:05 -0700 (PDT) Received: from schleppi.home.com ([149.14.88.26]) by smtp.gmail.com with ESMTPSA id u7sm21992628wif.3.2015.07.22.06.04.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 06:04:04 -0700 (PDT) From: Andreas Gruenbacher To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-api@vger.kernel.org, samba-technical@lists.samba.org, linux-security-module@vger.kernel.org, Andreas Gruenbacher Subject: [PATCH v5 04/39] vfs: Make the inode passed to inode_change_ok non-const Date: Wed, 22 Jul 2015 15:02:54 +0200 Message-Id: <1437570209-29832-5-git-send-email-andreas.gruenbacher@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1437570209-29832-1-git-send-email-andreas.gruenbacher@gmail.com> References: <1437570209-29832-1-git-send-email-andreas.gruenbacher@gmail.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andreas Gruenbacher We will need to call iop->permission and iop->get_acl from inode_change_ok() for additional permission checks, and both take a non-const inode. Signed-off-by: Andreas Gruenbacher --- fs/attr.c | 2 +- include/linux/fs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index 6530ced..328be71 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -28,7 +28,7 @@ * Should be called as the first thing in ->setattr implementations, * possibly after taking additional locks. */ -int inode_change_ok(const struct inode *inode, struct iattr *attr) +int inode_change_ok(struct inode *inode, struct iattr *attr) { unsigned int ia_valid = attr->ia_valid; diff --git a/include/linux/fs.h b/include/linux/fs.h index abf5b0e..aae46e0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2873,7 +2873,7 @@ extern int buffer_migrate_page(struct address_space *, #define buffer_migrate_page NULL #endif -extern int inode_change_ok(const struct inode *, struct iattr *); +extern int inode_change_ok(struct inode *, struct iattr *); extern int inode_newsize_ok(const struct inode *, loff_t offset); extern void setattr_copy(struct inode *inode, const struct iattr *attr);