Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 304923 Details for
Bug 445787
debugfs: file/directory creation error
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[PATCH]DebugFS : more file/directory creation error handling
0002-DebugFS-more-file-directory-creation-error-handlin.patch (text/plain), 2.10 KB, created by
Tao Ma
on 2008-05-09 06:07:16 UTC
(
hide
)
Description:
[PATCH]DebugFS : more file/directory creation error handling
Filename:
MIME Type:
Creator:
Tao Ma
Created:
2008-05-09 06:07:16 UTC
Size:
2.10 KB
patch
obsolete
>From 65c333367b1aea57d58168ad3dc1df27b0227401 Mon Sep 17 00:00:00 2001 >From: Mathieu Desnoyers <compudj@krystal.dyndns.org> >Date: Fri, 24 Nov 2006 13:50:09 -0500 >Subject: DebugFS : more file/directory creation error handling > >Correct dentry count to handle creation errors. > >This patch puts a dput at the file creation instead of the file removal : >lookup_one_len already returns a dentry with reference count of 1. Then, >the dget() in simple_mknod increments it when the dentry is associated >with a file. In a scenario where simple_create or simple_mkdir returns >an error, this would lead to an unwanted increment of the reference >counter, therefore making file removal impossible. > >Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> >Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> >--- > fs/debugfs/inode.c | 14 ++++++++++---- > 1 files changed, 10 insertions(+), 4 deletions(-) > >diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c >index d6c5fb5..554f4a9 100644 >--- a/fs/debugfs/inode.c >+++ b/fs/debugfs/inode.c >@@ -162,6 +162,7 @@ static int debugfs_create_by_name(const char *name, mode_t mode, > error = debugfs_mkdir(parent->d_inode, *dentry, mode); > else > error = debugfs_create(parent->d_inode, *dentry, mode); >+ dput(*dentry); > } else > error = PTR_ERR(*dentry); > mutex_unlock(&parent->d_inode->i_mutex); >@@ -273,6 +274,7 @@ EXPORT_SYMBOL_GPL(debugfs_create_dir); > void debugfs_remove(struct dentry *dentry) > { > struct dentry *parent; >+ int ret = 0; > > if (!dentry) > return; >@@ -284,11 +286,15 @@ void debugfs_remove(struct dentry *dentry) > mutex_lock(&parent->d_inode->i_mutex); > if (debugfs_positive(dentry)) { > if (dentry->d_inode) { >- if (S_ISDIR(dentry->d_inode->i_mode)) >- simple_rmdir(parent->d_inode, dentry); >- else >+ if (S_ISDIR(dentry->d_inode->i_mode)) { >+ ret = simple_rmdir(parent->d_inode, dentry); >+ if (ret) >+ printk(KERN_ERR >+ "DebugFS rmdir on %s failed : " >+ "directory not empty.\n", >+ dentry->d_name.name); >+ } else > simple_unlink(parent->d_inode, dentry); >- dput(dentry); > } > } > mutex_unlock(&parent->d_inode->i_mutex); >-- >1.5.3.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 445787
: 304923 |
304924
|
305682