VisionFive2 Linux kernel

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

More than 9999 Commits   32 Branches   54 Tags
author: Linus Torvalds <torvalds@linux-foundation.org> 2019-11-26 11:34:06 -0800 committer: Linus Torvalds <torvalds@linux-foundation.org> 2019-11-26 11:34:06 -0800 commit: 2be7d348fe924f0c5583c6a805bd42cecda93104 parent: ab851d49f6bfc781edd8bd44c72ec1e49211670b
Commit Summary:
Revert "vfs: properly and reliably lock f_pos in fdget_pos()"
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/fs/file.c b/fs/file.c
index b241ea7f1aa4..3da91a112bab 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -795,7 +795,7 @@ unsigned long __fdget_pos(unsigned int fd)
 	unsigned long v = __fdget(fd);
 	struct file *file = (struct file *)(v & ~3);
 
-	if (file && !(file->f_mode & FMODE_STREAM)) {
+	if (file && (file->f_mode & FMODE_ATOMIC_POS)) {
 		if (file_count(file) > 1) {
 			v |= FDPUT_POS_UNLOCK;
 			mutex_lock(&file->f_pos_lock);