2000-11-08 06:41:19

by Stephen Rothwell

[permalink] [raw]
Subject: [PATCH] Obscure possible bug in directory notify

Hi Linus,

This patch fixes a place where we could return with a read/write
lock held. Also update MAINTAINERS and CREDITS files.

Cheers,
Stephen
--
Stephen Rothwell, Open Source Researcher, Linuxcare, Inc.
+61-2-62628990 tel, +61-2-62628991 fax
[email protected], http://www.linuxcare.com/
Linuxcare. Support for the revolution.

diff -ruN 2.4.0-test11pre1/CREDITS 2.4.0-test11pre1-not1/CREDITS
--- 2.4.0-test11pre1/CREDITS Wed Nov 8 10:07:59 2000
+++ 2.4.0-test11pre1-not1/CREDITS Wed Nov 8 17:09:20 2000
@@ -2240,11 +2240,12 @@
S: Germany

N: Stephen Rothwell
-E: [email protected]
+E: [email protected]
W: http://linuxcare.com.au/sfr
P: 1024/BD8C7805 CD A4 9D 01 10 6E 7E 3B 91 88 FA D9 C8 40 AA 02
D: Boot/setup/build work for setup > 2K
D: Author, APM driver
+D: Directory notification
S: 66 Maltby Circuit
S: Wanniassa ACT 2903
S: Australia
diff -ruN 2.4.0-test11pre1/MAINTAINERS 2.4.0-test11pre1-not1/MAINTAINERS
--- 2.4.0-test11pre1/MAINTAINERS Wed Nov 1 09:36:12 2000
+++ 2.4.0-test11pre1-not1/MAINTAINERS Wed Nov 8 17:08:05 2000
@@ -353,6 +353,12 @@
L: [email protected]
S: Maintained

+DIRECTORY NOTIFICATION
+P: Stephen Rothwell
+M: [email protected]
+L: [email protected]
+S: Supported
+
DISK GEOMETRY AND PARTITION HANDLING
P: Andries Brouwer
M: [email protected]
diff -ruN 2.4.0-test11pre1/fs/dnotify.c 2.4.0-test11pre1-not1/fs/dnotify.c
--- 2.4.0-test11pre1/fs/dnotify.c Wed Oct 4 10:37:09 2000
+++ 2.4.0-test11pre1-not1/fs/dnotify.c Wed Nov 8 17:06:08 2000
@@ -103,14 +103,14 @@
write_lock(&dn_lock);
prev = &inode->i_dnotify;
while ((dn = *prev) != NULL) {
- if ((dn->dn_mask & event) == 0) {
- prev = &dn->dn_next;
- continue;
- }
if (dn->dn_magic != DNOTIFY_MAGIC) {
printk(KERN_ERR "__inode_dir_notify: bad magic "
"number in dnotify_struct!\n");
- return;
+ goto out;
+ }
+ if ((dn->dn_mask & event) == 0) {
+ prev = &dn->dn_next;
+ continue;
}
fown = &dn->dn_filp->f_owner;
if (fown->pid)
@@ -125,6 +125,7 @@
}
if (changed)
redo_inode_mask(inode);
+out:
write_unlock(&dn_lock);
}