VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Al Viro <viro@zeniv.linux.org.uk> 2014-03-14 10:56:20 -0400 committer: Al Viro <viro@zeniv.linux.org.uk> 2014-04-01 23:19:11 -0400 commit: dd20908a8a06b22c171f6c3fcdbdbd65bed07505 parent: 44ba8406d0005400e56c6b6a279a669eb761d1b8
Commit Summary:
don't bother with {get,put}_write_access() on non-regular files
Diffstat:
1 file changed, 1 insertion, 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);