diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-14 10:56:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-30 21:52:12 -0700 |
commit | 68ad89c73da6085d14e18f18ec7298821d408b2d (patch) | |
tree | c426b7c447d78b45a9d0a1f07e8be23ea3056799 /fs/file_table.c | |
parent | cd09dfbdad430e807be3dee98ce03f452b7ef001 (diff) | |
download | lwn-68ad89c73da6085d14e18f18ec7298821d408b2d.tar.gz lwn-68ad89c73da6085d14e18f18ec7298821d408b2d.zip |
don't bother with {get,put}_write_access() on non-regular files
commit dd20908a8a06b22c171f6c3fcdbdbd65bed07505 upstream.
it's pointless and actually leads to wrong behaviour in at least one
moderately convoluted case (pipe(), close one end, try to get to
another via /proc/*/fd and run into ETXTBUSY).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r-- | fs/file_table.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 485dc0eddd67..54a34be444f9 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -211,10 +211,10 @@ static void drop_file_write_access(struct file *file) struct dentry *dentry = file->f_path.dentry; struct inode *inode = dentry->d_inode; - put_write_access(inode); - if (special_file(inode->i_mode)) return; + + put_write_access(inode); if (file_check_writeable(file) != 0) return; __mnt_drop_write(mnt); |