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 709070 Details for
Bug 920752
cannot open device nodes for writing on RO filesystems
[?]
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
rofs-rwdev.diff (text/plain), 1.93 KB, created by
Mateusz Guzik
on 2013-03-12 16:28:27 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Mateusz Guzik
Created:
2013-03-12 16:28:27 UTC
Size:
1.93 KB
patch
obsolete
>diff --git a/fs/namei.c b/fs/namei.c >index 70f5cc0..017dc91 100644 >--- a/fs/namei.c >+++ b/fs/namei.c >@@ -1848,6 +1848,7 @@ struct file *do_filp_open(int dfd, const char *pathname, > int count = 0; > int will_truncate; > int flag = open_to_namei_flags(open_flag); >+ int got_write = false; > > if (!acc_mode) > acc_mode = MAY_OPEN | ACC_MODE(flag); >@@ -1933,8 +1934,8 @@ struct file *do_filp_open(int dfd, const char *pathname, > * the 'struct file' in nameidata_to_filp(). > */ > error = mnt_want_write(nd.path.mnt); >- if (error) >- goto exit_parent; >+ if (!error) >+ got_write = true; > > mutex_lock(&dir->d_inode->i_mutex); > path.dentry = lookup_hash(&nd); >@@ -1944,7 +1945,8 @@ do_last: > error = PTR_ERR(path.dentry); > if (IS_ERR(path.dentry)) { > mutex_unlock(&dir->d_inode->i_mutex); >- mnt_drop_write(nd.path.mnt); >+ if (got_write) >+ mnt_drop_write(nd.path.mnt); > goto exit; > } > >@@ -1955,6 +1957,10 @@ do_last: > > /* Negative dentry, just create the file */ > if (!path.dentry->d_inode) { >+ if (!got_write) { >+ error = -EROFS; >+ goto exit_mutex_unlock; >+ } > error = __open_namei_create(&nd, &path, open_flag, mode); > if (error) { > mnt_drop_write(nd.path.mnt); >@@ -1978,7 +1984,10 @@ do_last: > * It already exists. > */ > mutex_unlock(&dir->d_inode->i_mutex); >- mnt_drop_write(nd.path.mnt); >+ if (got_write) { >+ mnt_drop_write(nd.path.mnt); >+ got_write = false; >+ } > audit_inode(pathname, path.dentry); > > error = -EEXIST; >@@ -2056,7 +2065,8 @@ ok: > > exit_mutex_unlock: > mutex_unlock(&dir->d_inode->i_mutex); >- mnt_drop_write(nd.path.mnt); >+ if (got_write) >+ mnt_drop_write(nd.path.mnt); > exit_dput: > path_put_conditional(&path, &nd); > exit: >@@ -2114,10 +2124,8 @@ do_link: > } > dir = nd.path.dentry; > error = mnt_want_write(nd.path.mnt); >- if (error) { >- __putname(nd.last.name); >- goto exit; >- } >+ if (!error) >+ got_write = true; > mutex_lock(&dir->d_inode->i_mutex); > path.dentry = lookup_hash(&nd); > path.mnt = nd.path.mnt;
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 920752
: 709070 |
752878
|
752879