diff options
author | Tejun Heo <tj@kernel.org> | 2013-10-24 11:49:07 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-29 15:12:06 -0700 |
commit | 56b3f3b884652395e1025a8e4f1c4bd47bc112c4 (patch) | |
tree | 8253438bdcaddafb5ce406828bd8b9073f215a7b /fs/sysfs/inode.c | |
parent | 6fffcfa7c0fc438d3667b4eb2074d94f69c12c7b (diff) | |
download | linux-56b3f3b884652395e1025a8e4f1c4bd47bc112c4.tar.bz2 |
sysfs: merge sysfs_elem_bin_attr into sysfs_elem_attr
3124eb1679 ("sysfs: merge regular and bin file handling") folded bin
file handling into regular file handling. Among other things, bin
file now shares the same open path including sysfs_open_dirent
association using sysfs_dirent->s_attr.open. This is buggy because
->s_bin_attr lives in the same union and doesn't have the field. This
bug doesn't trigger because sysfs_elem_bin_attr doesn't have an active
field at the conflicting position. It does have a field "buffers" but
it isn't used anymore.
This patch collapses sysfs_elem_bin_attr into sysfs_elem_attr so that
the bin_attr is accessed through ->s_attr.bin_attr which lives with
->s_attr.attr in an anonymous union. The code paths already assume
bin_attr contains attr as the first element, so this doesn't add any
more assumptions while making it explicit that the two types are
handled together.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs/inode.c')
-rw-r--r-- | fs/sysfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 2cb1b6b8ccbc..825c55607af8 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c @@ -258,7 +258,7 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode) inode->i_fop = &sysfs_file_operations; break; case SYSFS_KOBJ_BIN_ATTR: - bin_attr = sd->s_bin_attr.bin_attr; + bin_attr = sd->s_attr.bin_attr; inode->i_size = bin_attr->size; inode->i_fop = &sysfs_bin_operations; break; |