Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'driver-core-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
"Here are three small fixes for 4.8-rc5.

One for sysfs, one for kernfs, and one documentation fix, all for
reported issues. All of these have been in linux-next for a while"

* tag 'driver-core-4.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
sysfs: correctly handle read offset on PREALLOC attrs
documentation: drivers/core/of: fix name of of_node symlink
kernfs: don't depend on d_find_any_alias() when generating notifications

+29 -9
+1 -1
Documentation/ABI/stable/sysfs-devices
··· 1 1 # Note: This documents additional properties of any device beyond what 2 2 # is documented in Documentation/sysfs-rules.txt 3 3 4 - What: /sys/devices/*/of_path 4 + What: /sys/devices/*/of_node 5 5 Date: February 2015 6 6 Contact: Device Tree mailing list <devicetree@vger.kernel.org> 7 7 Description:
+21 -7
fs/kernfs/file.c
··· 840 840 mutex_lock(&kernfs_mutex); 841 841 842 842 list_for_each_entry(info, &kernfs_root(kn)->supers, node) { 843 + struct kernfs_node *parent; 843 844 struct inode *inode; 844 - struct dentry *dentry; 845 845 846 + /* 847 + * We want fsnotify_modify() on @kn but as the 848 + * modifications aren't originating from userland don't 849 + * have the matching @file available. Look up the inodes 850 + * and generate the events manually. 851 + */ 846 852 inode = ilookup(info->sb, kn->ino); 847 853 if (!inode) 848 854 continue; 849 855 850 - dentry = d_find_any_alias(inode); 851 - if (dentry) { 852 - fsnotify_parent(NULL, dentry, FS_MODIFY); 853 - fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE, 854 - NULL, 0); 855 - dput(dentry); 856 + parent = kernfs_get_parent(kn); 857 + if (parent) { 858 + struct inode *p_inode; 859 + 860 + p_inode = ilookup(info->sb, parent->ino); 861 + if (p_inode) { 862 + fsnotify(p_inode, FS_MODIFY | FS_EVENT_ON_CHILD, 863 + inode, FSNOTIFY_EVENT_INODE, kn->name, 0); 864 + iput(p_inode); 865 + } 866 + 867 + kernfs_put(parent); 856 868 } 857 869 870 + fsnotify(inode, FS_MODIFY, inode, FSNOTIFY_EVENT_INODE, 871 + kn->name, 0); 858 872 iput(inode); 859 873 } 860 874
+7 -1
fs/sysfs/file.c
··· 114 114 * If buf != of->prealloc_buf, we don't know how 115 115 * large it is, so cannot safely pass it to ->show 116 116 */ 117 - if (pos || WARN_ON_ONCE(buf != of->prealloc_buf)) 117 + if (WARN_ON_ONCE(buf != of->prealloc_buf)) 118 118 return 0; 119 119 len = ops->show(kobj, of->kn->priv, buf); 120 + if (pos) { 121 + if (len <= pos) 122 + return 0; 123 + len -= pos; 124 + memmove(buf, buf + pos, len); 125 + } 120 126 return min(count, len); 121 127 } 122 128