Loading drivers/block/loop.c +2 −0 Original line number Diff line number Diff line Loading @@ -230,9 +230,11 @@ static int __do_lo_send_write(struct file *file, ssize_t bw; mm_segment_t old_fs = get_fs(); file_start_write(file); set_fs(get_ds()); bw = file->f_op->write(file, buf, len, &pos); set_fs(old_fs); file_end_write(file); if (likely(bw == len)) return 0; printk(KERN_ERR "loop: Write error at byte offset %llu, length %i.\n", Loading fs/cachefiles/rdwr.c +2 −0 Original line number Diff line number Diff line Loading @@ -962,12 +962,14 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page) } data = kmap(page); file_start_write(file); old_fs = get_fs(); set_fs(KERNEL_DS); ret = file->f_op->write( file, (const void __user *) data, len, &pos); set_fs(old_fs); kunmap(page); file_end_write(file); if (ret != len) ret = -EIO; } Loading fs/coda/file.c +2 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ coda_file_write(struct file *coda_file, const char __user *buf, size_t count, lo return -EINVAL; host_inode = file_inode(host_file); file_start_write(host_file); mutex_lock(&coda_inode->i_mutex); ret = host_file->f_op->write(host_file, buf, count, ppos); Loading @@ -87,6 +88,7 @@ coda_file_write(struct file *coda_file, const char __user *buf, size_t count, lo coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9; coda_inode->i_mtime = coda_inode->i_ctime = CURRENT_TIME_SEC; mutex_unlock(&coda_inode->i_mutex); file_end_write(host_file); return ret; } Loading fs/coredump.c +2 −0 Original line number Diff line number Diff line Loading @@ -629,9 +629,11 @@ void do_coredump(siginfo_t *siginfo) goto close_fail; if (displaced) put_files_struct(displaced); file_start_write(cprm.file); retval = binfmt->core_dump(&cprm); if (retval) current->signal->group_exit_code |= 0x80; file_end_write(cprm.file); if (ispipe && core_pipe_limit) wait_for_dump_helpers(cprm.file); Loading fs/read_write.c +14 −10 Original line number Diff line number Diff line Loading @@ -398,7 +398,6 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof struct kiocb kiocb; ssize_t ret; file_start_write(filp); init_sync_kiocb(&kiocb, filp); kiocb.ki_pos = *ppos; kiocb.ki_left = len; Loading @@ -414,7 +413,6 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof if (-EIOCBQUEUED == ret) ret = wait_on_sync_kiocb(&kiocb); *ppos = kiocb.ki_pos; file_end_write(filp); return ret; } Loading Loading @@ -458,6 +456,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ ret = rw_verify_area(WRITE, file, pos, count); if (ret >= 0) { count = ret; file_start_write(file); if (file->f_op->write) ret = file->f_op->write(file, buf, count, pos); else Loading @@ -467,6 +466,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ add_wchar(current, ret); } inc_syscw(current); file_end_write(file); } return ret; Loading Loading @@ -758,16 +758,18 @@ static ssize_t do_readv_writev(int type, struct file *file, } else { fn = (io_fn_t)file->f_op->write; fnv = file->f_op->aio_write; file_start_write(file); } if (fnv) { file_start_write(file); if (fnv) ret = do_sync_readv_writev(file, iov, nr_segs, tot_len, pos, fnv); file_end_write(file); } else else ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn); if (type != READ) file_end_write(file); out: if (iov != iovstack) kfree(iov); Loading Loading @@ -936,16 +938,18 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, } else { fn = (io_fn_t)file->f_op->write; fnv = file->f_op->aio_write; file_start_write(file); } if (fnv) { file_start_write(file); if (fnv) ret = do_sync_readv_writev(file, iov, nr_segs, tot_len, pos, fnv); file_end_write(file); } else else ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn); if (type != READ) file_end_write(file); out: if (iov != iovstack) kfree(iov); Loading Loading
drivers/block/loop.c +2 −0 Original line number Diff line number Diff line Loading @@ -230,9 +230,11 @@ static int __do_lo_send_write(struct file *file, ssize_t bw; mm_segment_t old_fs = get_fs(); file_start_write(file); set_fs(get_ds()); bw = file->f_op->write(file, buf, len, &pos); set_fs(old_fs); file_end_write(file); if (likely(bw == len)) return 0; printk(KERN_ERR "loop: Write error at byte offset %llu, length %i.\n", Loading
fs/cachefiles/rdwr.c +2 −0 Original line number Diff line number Diff line Loading @@ -962,12 +962,14 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page) } data = kmap(page); file_start_write(file); old_fs = get_fs(); set_fs(KERNEL_DS); ret = file->f_op->write( file, (const void __user *) data, len, &pos); set_fs(old_fs); kunmap(page); file_end_write(file); if (ret != len) ret = -EIO; } Loading
fs/coda/file.c +2 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,7 @@ coda_file_write(struct file *coda_file, const char __user *buf, size_t count, lo return -EINVAL; host_inode = file_inode(host_file); file_start_write(host_file); mutex_lock(&coda_inode->i_mutex); ret = host_file->f_op->write(host_file, buf, count, ppos); Loading @@ -87,6 +88,7 @@ coda_file_write(struct file *coda_file, const char __user *buf, size_t count, lo coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9; coda_inode->i_mtime = coda_inode->i_ctime = CURRENT_TIME_SEC; mutex_unlock(&coda_inode->i_mutex); file_end_write(host_file); return ret; } Loading
fs/coredump.c +2 −0 Original line number Diff line number Diff line Loading @@ -629,9 +629,11 @@ void do_coredump(siginfo_t *siginfo) goto close_fail; if (displaced) put_files_struct(displaced); file_start_write(cprm.file); retval = binfmt->core_dump(&cprm); if (retval) current->signal->group_exit_code |= 0x80; file_end_write(cprm.file); if (ispipe && core_pipe_limit) wait_for_dump_helpers(cprm.file); Loading
fs/read_write.c +14 −10 Original line number Diff line number Diff line Loading @@ -398,7 +398,6 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof struct kiocb kiocb; ssize_t ret; file_start_write(filp); init_sync_kiocb(&kiocb, filp); kiocb.ki_pos = *ppos; kiocb.ki_left = len; Loading @@ -414,7 +413,6 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof if (-EIOCBQUEUED == ret) ret = wait_on_sync_kiocb(&kiocb); *ppos = kiocb.ki_pos; file_end_write(filp); return ret; } Loading Loading @@ -458,6 +456,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ ret = rw_verify_area(WRITE, file, pos, count); if (ret >= 0) { count = ret; file_start_write(file); if (file->f_op->write) ret = file->f_op->write(file, buf, count, pos); else Loading @@ -467,6 +466,7 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_ add_wchar(current, ret); } inc_syscw(current); file_end_write(file); } return ret; Loading Loading @@ -758,16 +758,18 @@ static ssize_t do_readv_writev(int type, struct file *file, } else { fn = (io_fn_t)file->f_op->write; fnv = file->f_op->aio_write; file_start_write(file); } if (fnv) { file_start_write(file); if (fnv) ret = do_sync_readv_writev(file, iov, nr_segs, tot_len, pos, fnv); file_end_write(file); } else else ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn); if (type != READ) file_end_write(file); out: if (iov != iovstack) kfree(iov); Loading Loading @@ -936,16 +938,18 @@ static ssize_t compat_do_readv_writev(int type, struct file *file, } else { fn = (io_fn_t)file->f_op->write; fnv = file->f_op->aio_write; file_start_write(file); } if (fnv) { file_start_write(file); if (fnv) ret = do_sync_readv_writev(file, iov, nr_segs, tot_len, pos, fnv); file_end_write(file); } else else ret = do_loop_readv_writev(file, iov, nr_segs, pos, fn); if (type != READ) file_end_write(file); out: if (iov != iovstack) kfree(iov); Loading