Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760525AbYGVFmr (ORCPT ); Tue, 22 Jul 2008 01:42:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757041AbYGVFZz (ORCPT ); Tue, 22 Jul 2008 01:25:55 -0400 Received: from mail.suse.de ([195.135.220.2]:54089 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757554AbYGVFZy (ORCPT ); Tue, 22 Jul 2008 01:25:54 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Miklos Szeredi , Greg Kroah-Hartman Subject: [PATCH 63/79] sysfs: don't call notify_change Date: Mon, 21 Jul 2008 22:19:27 -0700 Message-Id: <1216703983-21448-63-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <20080722051805.GA17373@suse.de> References: <20080722051805.GA17373@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1647 Lines: 49 From: Miklos Szeredi sysfs_chmod_file() calls notify_change() to change the permission bits on a sysfs file. Replace with explicit call to sysfs_setattr() and fsnotify_change(). This is equivalent, except that security_inode_setattr() is not called. This function is called by drivers, so the security checks do not make any sense. Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/sysfs/file.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index e7735f6..3f07893 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -585,9 +586,11 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; - rc = notify_change(victim, &newattrs); + newattrs.ia_ctime = current_fs_time(inode->i_sb); + rc = sysfs_setattr(victim, &newattrs); if (rc == 0) { + fsnotify_change(victim, newattrs.ia_valid); mutex_lock(&sysfs_mutex); victim_sd->s_mode = newattrs.ia_mode; mutex_unlock(&sysfs_mutex); -- 1.5.6.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/