summaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-14 15:56:20 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2014-04-02 05:19:11 +0200
commitdd20908a8a06b22c171f6c3fcdbdbd65bed07505 (patch)
tree447e2df881b2f056608098d3b24ab6d9734ce992 /fs/file_table.c
parentncpfs: switch to sockfd_lookup()/sockfd_put() (diff)
downloadlinux-dd20908a8a06b22c171f6c3fcdbdbd65bed07505.tar.xz
linux-dd20908a8a06b22c171f6c3fcdbdbd65bed07505.zip
don't bother with {get,put}_write_access() on non-regular files
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). Cc: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index 5b24008ea4f6..79ecae62209a 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -209,10 +209,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);