Skip to contentSkip to conversation

LTTng-core 0.5.111 : Relay+DebugFS (DebugFS fix)

PATCH In review Mathieu Desnoyers 4 participants 5 messages Sep 16, 2006 – Sep 20, 2006 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/11 LTTng-core 0.5.111 : Relay+DebugFS (DebugFS fix)

1 - DebugFS stalled dentry patch
DebugFS seems to keep a stalled dentry when a process is in a directory that is being removed. Force a differed deletion. patch-2.6.17-lttng-core-0.5.111-debugfs.diff

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 
fs/debugfs/inode.c +4 -2
@@ -266,6 +266,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
 void debugfs_remove(struct dentry *dentry)
 {
 	struct dentry *parent;
+	int ret = 0;
 	
 	if (!dentry)
 		return;
@@ -278,9 +279,10 @@ void debugfs_remove(struct dentry *dentr
 	if (debugfs_positive(dentry)) {
 		if (dentry->d_inode) {
 			if (S_ISDIR(dentry->d_inode->i_mode))
-				simple_rmdir(parent->d_inode, dentry);
+				ret = simple_rmdir(parent->d_inode, dentry);
 			else
-				simple_unlink(parent->d_inode, dentry);
+				ret = simple_unlink(parent->d_inode, dentry);
+			if(ret) d_delete(dentry);
 		dput(dentry);
 		}
 	}
#1 lore raw
Quoted 1 line · Mathieu Desnoyers

1 - DebugFS stalled dentry patch

I think it would be best if patches posted were in the body of the email instead of as attachments. It makes it easier to review and comment.

Thanks,

Karim

Signature · 3 lines
President  / Opersys Inc.
Embedded Linux Training and Expertise
www.opersys.com  /  1.866.677.4546
#2 lore raw
Quoted 7 lines · Karim Yaghmour
Quoted 1 line · Mathieu Desnoyers

1 - DebugFS stalled dentry patch

I think it would be best if patches posted were in the body of the email instead of as attachments. It makes it easier to review and comment.

Also the subject line is utterly useless. Please take a look at Documentation/SubmittingPatches for the general format of a patch.

Quoted 8 lines

Thanks,

Karim

Signature · 3 lines
President  / Opersys Inc.
Embedded Linux Training and Expertise
www.opersys.com  /  1.866.677.4546

---end quoted text---

#3 lore raw
In reply to Mathieu Desnoyers
Quoted 20 lines · Mathieu Desnoyers

1 - DebugFS stalled dentry patch
DebugFS seems to keep a stalled dentry when a process is in a directory that is being removed. Force a differed deletion. patch-2.6.17-lttng-core-0.5.111-debugfs.diff

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 
fs/debugfs/inode.c +1 -0
@@ -266,6 +266,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
 void debugfs_remove(struct dentry *dentry)
 {
 	struct dentry *parent;
+	int ret = 0;
 
 	if (!dentry)
 		return;

fs/debugfs/inode.c void debugfs_remove(struct dentry *dentr · line 285

Quoted 9 lines
fs/debugfs/inode.c +3 -2
@@ -278,9 +279,10 @@ void debugfs_remove(struct dentry *dentr
 	if (debugfs_positive(dentry)) {
 		if (dentry->d_inode) {
 			if (S_ISDIR(dentry->d_inode->i_mode))
-				simple_rmdir(parent->d_inode, dentry);
+				ret = simple_rmdir(parent->d_inode, dentry);
 			else
-				simple_unlink(parent->d_inode, dentry);
+				ret = simple_unlink(parent->d_inode, dentry);
+			if(ret) d_delete(dentry);

Are you saying that perhaps all other users of simple_unlink() are also broken like this? If so, why not just fix simple_unlink()?

Also, wrong coding style used :(

thanks,

greg k-h

#4 lore raw
Quoted 18 lines · * Greg KH ([email protected]) wrote:
Quoted 17 lines · Mathieu Desnoyers

1 - DebugFS stalled dentry patch
DebugFS seems to keep a stalled dentry when a process is in a directory that is being removed. Force a differed deletion. patch-2.6.17-lttng-core-0.5.111-debugfs.diff

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68 
fs/debugfs/inode.c +1 -0
@@ -266,6 +266,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir);
 void debugfs_remove(struct dentry *dentry)
 {
 	struct dentry *parent;
+	int ret = 0;
 
Quoted 16 lines

fs/debugfs/inode.c void debugfs_remove(struct dentry *dentr · line 285

Quoted 12 lines
fs/debugfs/inode.c +3 -2
 	if (!dentry)
 		return;
@@ -278,9 +279,10 @@ void debugfs_remove(struct dentry *dentr
 	if (debugfs_positive(dentry)) {
 		if (dentry->d_inode) {
 			if (S_ISDIR(dentry->d_inode->i_mode))
-				simple_rmdir(parent->d_inode, dentry);
+				ret = simple_rmdir(parent->d_inode, dentry);
 			else
-				simple_unlink(parent->d_inode, dentry);
+				ret = simple_unlink(parent->d_inode, dentry);
+			if(ret) d_delete(dentry);

Are you saying that perhaps all other users of simple_unlink() are also broken like this? If so, why not just fix simple_unlink()?

I don't think that libfs is fundamentally broken, as simple_unlink always returns 0 but simple_rmdir may fail if !simple_empty(dentry). I think that the decision of what to do in such situation is "simply" left to the caller.

But you probably know more than I do on that matter.

Mathieu

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68