From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maneesh Soni Date: Tue, 31 May 2005 05:18:42 +0000 Subject: [patch 0/3] sysfs permissions Message-Id: <20050531050641.GA3631@in.ibm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi Following this post, are the three patches implementing setattr functionality for sysfs objects. This allows sysfs objects to get their default attributes like owner, group, permission modes modified. The changed attributes are saved in a struct iattr linked with struct sysfs_dirent for the corresponding object. This keeps the inode attributes saved even if inode/dentry is evacuated due to memory pressure or umount. The struct iattr is allocated only for those sysfs objects for which inode attributes are getting changed. I did the following test for verifying the patchset [root@llm01 ~]# ls -l /sys/class/net/dummy0/address -r--r--r-- 1 root root 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]# chmod +w /sys/class/net/dummy0/address [root@llm01 ~]# ls -l /sys/class/net/dummy0/address -rw-r--r-- 1 root root 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]# [root@llm01 ~]# chown maneesh /sys/class/net/dummy0/address [root@llm01 ~]# ls -l /sys/class/net/dummy0/address -rw-r--r-- 1 maneesh root 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]# [root@llm01 ~]# chgrp maneesh /sys/class/net/dummy0/address [root@llm01 ~]# ls -l /sys/class/net/dummy0/address -rw-r--r-- 1 maneesh maneesh 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]# [root@llm01 ~]# umount /sys [root@llm01 ~]# ls -l /sys/class/net/dummy0/address ls: /sys/class/net/dummy0/address: No such file or directory [root@llm01 ~]# [root@llm01 ~]# mount -t sysfs none /sys [root@llm01 ~]# ls -l /sys/class/net/dummy0/address -rw-r--r-- 1 maneesh maneesh 4096 May 31 10:32 /sys/class/net/dummy0/address Please review/test. Thanks Maneesh -- Maneesh Soni Linux Technology Center, IBM India Software Labs, Bangalore, India email: maneesh@in.ibm.com Phone: 91-80-25044990 ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel