Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-04-22 15:23:53 +0200
committerJiri Kosina <jkosina@suse.cz>2013-04-22 15:34:08 +0200
commitd484b0117fd3a513df6ad8978234778de749c898 (patch)
tree25889f75c945fed1584343a5ac3b5dc4638190a4
parent10b1a250c519ba19711e985aaeddcfa42435c4b5 (diff)
[PATCH 3.0-stable] Revert "sysfs: fix race between readdirrpm-3.0.74-0.9
and lseek" (bnc#816443).
-rw-r--r--patches.kernel.org/revert-sfs-fifix-race-between-readdir-and-lseek.patch46
-rw-r--r--series.conf1
2 files changed, 47 insertions, 0 deletions
diff --git a/patches.kernel.org/revert-sfs-fifix-race-between-readdir-and-lseek.patch b/patches.kernel.org/revert-sfs-fifix-race-between-readdir-and-lseek.patch
new file mode 100644
index 0000000000..d9504e8809
--- /dev/null
+++ b/patches.kernel.org/revert-sfs-fifix-race-between-readdir-and-lseek.patch
@@ -0,0 +1,46 @@
+From: Jiri Kosina <jkosina@suse.cz>
+Subject: [PATCH 3.0-stable] Revert "sysfs: fix race between readdir and lseek"
+Patch-mainline: no
+References: bnc#816443
+
+This reverts commit 991f76f837bf22c5bb07261cfd86525a0a96650c.
+
+It depends on ef3d0fd27e90f ("vfs: do (nearly) lockless generic_file_llseek")
+which is available only in 3.2+.
+
+When applied on 3.0 codebase, it causes A-A deadlock, whenever anyone does
+seek() on sysfs, as both generic_file_llseek() and sysfs_dir_llseek() obtain
+i_mutex.
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+---
+ fs/sysfs/dir.c | 13 +------------
+ 1 files changed, 1 insertions(+), 12 deletions(-)
+
+Index: linux-3.0-SLE11-SP3-sysfs-hang-debug/fs/sysfs/dir.c
+===================================================================
+--- linux-3.0-SLE11-SP3-sysfs-hang-debug.orig/fs/sysfs/dir.c
++++ linux-3.0-SLE11-SP3-sysfs-hang-debug/fs/sysfs/dir.c
+@@ -961,21 +961,9 @@ static int sysfs_readdir(struct file * f
+ return 0;
+ }
+
+-static loff_t sysfs_dir_llseek(struct file *file, loff_t offset, int whence)
+-{
+- struct inode *inode = file->f_path.dentry->d_inode;
+- loff_t ret;
+-
+- mutex_lock(&inode->i_mutex);
+- ret = generic_file_llseek(file, offset, whence);
+- mutex_unlock(&inode->i_mutex);
+-
+- return ret;
+-}
+-
+ const struct file_operations sysfs_dir_operations = {
+ .read = generic_read_dir,
+ .readdir = sysfs_readdir,
+ .release = sysfs_dir_release,
+- .llseek = sysfs_dir_llseek,
++ .llseek = generic_file_llseek,
+ };
diff --git a/series.conf b/series.conf
index 3954c924c1..b33b3f455b 100644
--- a/series.conf
+++ b/series.conf
@@ -119,6 +119,7 @@
patches.kernel.org/revert-hwmon-coretemp-fix-oops-on-driver-load.patch
patches.kernel.org/revert-removal-of-ACPI-procfs-entries.patch
patches.suse/Revert-8021q-fix-a-potential-use-after-free.patch
+ patches.kernel.org/revert-sfs-fifix-race-between-readdir-and-lseek.patch
########################################################
# Build fixes that apply to the vanilla kernel too.