[OP] v2.6.22.24-op1-rc1

From: Oliver Pinter
Date: Wed May 07 2008 - 12:46:54 EST


linux v2.6.22.21-op1-rc2
"stable" review patch

---

http://repo.or.cz/w/linux-2.6.22.y-op.git rc
http://repo.or.cz/w/linux-2.6.22.y-op-patches.git

---

Al Viro (1):
Fix dnotify/close race

Li Zefan (1):
ACPI: check a return value correctly in acpi_power_get_context()

Oliver Pinter (1):
v2.6.22.24-op1-rc1


---

Makefile | 2 +-
drivers/acpi/power.c | 2 +-
fs/dnotify.c | 11 +++++++++++
3 files changed, 13 insertions(+), 2 deletions(-)

--
Thanks,
Oliver

---
diff --git a/Makefile b/Makefile
index d001959..493c973 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 22
-EXTRAVERSION = .23-op1
+EXTRAVERSION = .24-op1-rc1
NAME = Holy Dancing Manatees, Batman!

# *DOCUMENTATION*
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 4ffecd1..d295ed1 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -116,7 +116,7 @@ acpi_power_get_context(acpi_handle handle,
}

*resource = acpi_driver_data(device);
- if (!resource)
+ if (!*resource)
return -ENODEV;

return 0;
diff --git a/fs/dnotify.c b/fs/dnotify.c
index 936409f..91b9753 100644
--- a/fs/dnotify.c
+++ b/fs/dnotify.c
@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
+#include <linux/file.h>

int dir_notify_enable __read_mostly = 1;

@@ -66,6 +67,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
struct dnotify_struct **prev;
struct inode *inode;
fl_owner_t id = current->files;
+ struct file *f;
int error = 0;

if ((arg & ~DN_MULTISHOT) == 0) {
@@ -92,6 +94,15 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
prev = &odn->dn_next;
}

+ rcu_read_lock();
+ f = fcheck(fd);
+ rcu_read_unlock();
+ /* we'd lost the race with close(), sod off silently */
+ /* note that inode->i_lock prevents reordering problems
+ * between accesses to descriptor table and ->i_dnotify */
+ if (f != filp)
+ goto out_free;
+
error = __f_setown(filp, task_pid(current), PIDTYPE_PID, 0);
if (error)
goto out_free;