Skip to contentSkip to conversation

vfs: atomic f_pos access in llseek()

PATCH New Eric Biggers 1 participant 1 message Mar 16, 2014 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: atomic f_pos access in llseek()

Commit 9c225f2655e36a4 ("vfs: atomic f_pos accesses as per POSIX") changed several system calls to use fdget_pos() instead of fdget(), but missed sys_llseek(). Fix it.

---
 fs/read_write.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/read_write.c +2 -2
index 54e19b9..28cc9c8 100644
@@ -307,7 +307,7 @@ SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
 		unsigned int, whence)
 {
 	int retval;
-	struct fd f = fdget(fd);
+	struct fd f = fdget_pos(fd);
 	loff_t offset;
 
 	if (!f.file)
@@ -327,7 +327,7 @@ SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
 			retval = 0;
 	}
 out_putf:
-	fdput(f);
+	fdput_pos(f);
 	return retval;
 }
 #endif
Signature · 1 line
1.9.0