Commit 2516b615 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'driver-core-3.13-rc5' of...

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

Pull driver core fix from Greg KH:
 "Here's a single sysfs fix for 3.13-rc5 that resolves a lockdep issue
  in sysfs that has been reported"

* tag 'driver-core-3.13-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  sysfs: give different locking key to regular and bin files
parents a81bddde a8b14744
...@@ -609,7 +609,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file) ...@@ -609,7 +609,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
struct sysfs_open_file *of; struct sysfs_open_file *of;
bool has_read, has_write, has_mmap; bool has_read, has_write;
int error = -EACCES; int error = -EACCES;
/* need attr_sd for attr and ops, its parent for kobj */ /* need attr_sd for attr and ops, its parent for kobj */
...@@ -621,7 +621,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file) ...@@ -621,7 +621,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
has_read = battr->read || battr->mmap; has_read = battr->read || battr->mmap;
has_write = battr->write || battr->mmap; has_write = battr->write || battr->mmap;
has_mmap = battr->mmap;
} else { } else {
const struct sysfs_ops *ops = sysfs_file_ops(attr_sd); const struct sysfs_ops *ops = sysfs_file_ops(attr_sd);
...@@ -633,7 +632,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file) ...@@ -633,7 +632,6 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
has_read = ops->show; has_read = ops->show;
has_write = ops->store; has_write = ops->store;
has_mmap = false;
} }
/* check perms and supported operations */ /* check perms and supported operations */
...@@ -661,9 +659,9 @@ static int sysfs_open_file(struct inode *inode, struct file *file) ...@@ -661,9 +659,9 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
* open file has a separate mutex, it's okay as long as those don't * open file has a separate mutex, it's okay as long as those don't
* happen on the same file. At this point, we can't easily give * happen on the same file. At this point, we can't easily give
* each file a separate locking class. Let's differentiate on * each file a separate locking class. Let's differentiate on
* whether the file has mmap or not for now. * whether the file is bin or not for now.
*/ */
if (has_mmap) if (sysfs_is_bin(attr_sd))
mutex_init(&of->mutex); mutex_init(&of->mutex);
else else
mutex_init(&of->mutex); mutex_init(&of->mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment