Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix iov_iter_fault_in_readable()

... by turning it into what used to be multipages counterpart

Cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Al Viro and committed by
Linus Torvalds
d4690f1e f32a10df

+3 -23
+1 -1
include/linux/uio.h
··· 76 76 struct iov_iter *i, unsigned long offset, size_t bytes); 77 77 void iov_iter_advance(struct iov_iter *i, size_t bytes); 78 78 int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); 79 - int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes); 79 + #define iov_iter_fault_in_multipages_readable iov_iter_fault_in_readable 80 80 size_t iov_iter_single_seg_count(const struct iov_iter *i); 81 81 size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, 82 82 struct iov_iter *i);
+2 -22
lib/iov_iter.c
··· 291 291 } 292 292 293 293 /* 294 - * Fault in the first iovec of the given iov_iter, to a maximum length 295 - * of bytes. Returns 0 on success, or non-zero if the memory could not be 296 - * accessed (ie. because it is an invalid address). 297 - * 298 - * writev-intensive code may want this to prefault several iovecs -- that 299 - * would be possible (callers must not rely on the fact that _only_ the 300 - * first iovec will be faulted with the current implementation). 301 - */ 302 - int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) 303 - { 304 - if (!(i->type & (ITER_BVEC|ITER_KVEC))) { 305 - char __user *buf = i->iov->iov_base + i->iov_offset; 306 - bytes = min(bytes, i->iov->iov_len - i->iov_offset); 307 - return fault_in_pages_readable(buf, bytes); 308 - } 309 - return 0; 310 - } 311 - EXPORT_SYMBOL(iov_iter_fault_in_readable); 312 - 313 - /* 314 294 * Fault in one or more iovecs of the given iov_iter, to a maximum length of 315 295 * bytes. For each iovec, fault in each page that constitutes the iovec. 316 296 * 317 297 * Return 0 on success, or non-zero if the memory could not be accessed (i.e. 318 298 * because it is an invalid address). 319 299 */ 320 - int iov_iter_fault_in_multipages_readable(struct iov_iter *i, size_t bytes) 300 + int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes) 321 301 { 322 302 size_t skip = i->iov_offset; 323 303 const struct iovec *iov; ··· 314 334 } 315 335 return 0; 316 336 } 317 - EXPORT_SYMBOL(iov_iter_fault_in_multipages_readable); 337 + EXPORT_SYMBOL(iov_iter_fault_in_readable); 318 338 319 339 void iov_iter_init(struct iov_iter *i, int direction, 320 340 const struct iovec *iov, unsigned long nr_segs,