You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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
This commit is contained in:
+3
-5
@@ -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 kobject *kobj = attr_sd->s_parent->s_dir.kobj;
|
||||
struct sysfs_open_file *of;
|
||||
bool has_read, has_write, has_mmap;
|
||||
bool has_read, has_write;
|
||||
int error = -EACCES;
|
||||
|
||||
/* 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)
|
||||
|
||||
has_read = battr->read || battr->mmap;
|
||||
has_write = battr->write || battr->mmap;
|
||||
has_mmap = battr->mmap;
|
||||
} else {
|
||||
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)
|
||||
|
||||
has_read = ops->show;
|
||||
has_write = ops->store;
|
||||
has_mmap = false;
|
||||
}
|
||||
|
||||
/* check perms and supported operations */
|
||||
@@ -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
|
||||
* happen on the same file. At this point, we can't easily give
|
||||
* 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);
|
||||
else
|
||||
mutex_init(&of->mutex);
|
||||
|
||||
Reference in New Issue
Block a user