Messages in this thread | | | Date | Thu, 8 Mar 2007 15:08:17 -0800 | From | "Michael K. Edwards" <> | Subject | sys_write() racy for multi-threaded append? |
| |
from sys_write():
file = fget_light(fd, &fput_needed); if (file) { loff_t pos = file_pos_read(file); ret = vfs_write(file, buf, count, &pos); file_pos_write(file, pos); fput_light(file, fput_needed); }
Surely that's racy when two threads write to the same fd and the first vfs_write call blocks or is preempted. Or does fget_light take some per-file lock that I'm not seeing? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |