Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: - more ->d_init() stuff (work.dcache) - pathname resolution cleanups (work.namei) - a few missing iov_iter primitives - copy_from_iter_full() and friends. Either copy the full requested amount, advance the iterator and return true, or fail, return false and do _not_ advance the iterator. Quite a few open-coded callers converted (and became more readable and harder to fuck up that way) (work.iov_iter) - several assorted patches, the big one being logfs removal * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: logfs: remove from tree vfs: fix put_compat_statfs64() does not handle errors namei: fold should_follow_link() with the step into not-followed link namei: pass both WALK_GET and WALK_MORE to should_follow_link() namei: invert WALK_PUT logics namei: shift interpretation of LOOKUP_FOLLOW inside should_follow_link() namei: saner calling conventions for mountpoint_last() namei.c: get rid of user_path_parent() switch getfrag callbacks to ..._full() primitives make skb_add_data,{_nocache}() and skb_copy_to_page_nocache() advance only on success [iov_iter] new primitives - copy_from_iter_full() and friends don't open-code file_inode() ceph: switch to use of ->d_init() ceph: unify dentry_operations instances lustre: switch to use of ->d_init()
This commit is contained in:
@@ -2818,12 +2818,12 @@ static inline int skb_add_data(struct sk_buff *skb,
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_NONE) {
|
||||
__wsum csum = 0;
|
||||
if (csum_and_copy_from_iter(skb_put(skb, copy), copy,
|
||||
&csum, from) == copy) {
|
||||
if (csum_and_copy_from_iter_full(skb_put(skb, copy), copy,
|
||||
&csum, from)) {
|
||||
skb->csum = csum_block_add(skb->csum, csum, off);
|
||||
return 0;
|
||||
}
|
||||
} else if (copy_from_iter(skb_put(skb, copy), copy, from) == copy)
|
||||
} else if (copy_from_iter_full(skb_put(skb, copy), copy, from))
|
||||
return 0;
|
||||
|
||||
__skb_trim(skb, off);
|
||||
|
@@ -89,7 +89,9 @@ size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes,
|
||||
struct iov_iter *i);
|
||||
size_t copy_to_iter(const void *addr, size_t bytes, struct iov_iter *i);
|
||||
size_t copy_from_iter(void *addr, size_t bytes, struct iov_iter *i);
|
||||
bool copy_from_iter_full(void *addr, size_t bytes, struct iov_iter *i);
|
||||
size_t copy_from_iter_nocache(void *addr, size_t bytes, struct iov_iter *i);
|
||||
bool copy_from_iter_full_nocache(void *addr, size_t bytes, struct iov_iter *i);
|
||||
size_t iov_iter_zero(size_t bytes, struct iov_iter *);
|
||||
unsigned long iov_iter_alignment(const struct iov_iter *i);
|
||||
unsigned long iov_iter_gap_alignment(const struct iov_iter *i);
|
||||
@@ -155,6 +157,7 @@ static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
|
||||
}
|
||||
size_t csum_and_copy_to_iter(const void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
|
||||
size_t csum_and_copy_from_iter(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
|
||||
bool csum_and_copy_from_iter_full(void *addr, size_t bytes, __wsum *csum, struct iov_iter *i);
|
||||
|
||||
int import_iovec(int type, const struct iovec __user * uvector,
|
||||
unsigned nr_segs, unsigned fast_segs,
|
||||
|
@@ -1836,13 +1836,13 @@ static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
|
||||
{
|
||||
if (skb->ip_summed == CHECKSUM_NONE) {
|
||||
__wsum csum = 0;
|
||||
if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
|
||||
if (!csum_and_copy_from_iter_full(to, copy, &csum, from))
|
||||
return -EFAULT;
|
||||
skb->csum = csum_block_add(skb->csum, csum, offset);
|
||||
} else if (sk->sk_route_caps & NETIF_F_NOCACHE_COPY) {
|
||||
if (copy_from_iter_nocache(to, copy, from) != copy)
|
||||
if (!copy_from_iter_full_nocache(to, copy, from))
|
||||
return -EFAULT;
|
||||
} else if (copy_from_iter(to, copy, from) != copy)
|
||||
} else if (!copy_from_iter_full(to, copy, from))
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
|
@@ -20,7 +20,7 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
|
||||
int len, int odd, struct sk_buff *skb)
|
||||
{
|
||||
struct msghdr *msg = from;
|
||||
return copy_from_iter(to, len, &msg->msg_iter) != len ? -EFAULT : 0;
|
||||
return copy_from_iter_full(to, len, &msg->msg_iter) ? 0 : -EFAULT;
|
||||
}
|
||||
|
||||
/* Designate sk as UDP-Lite socket */
|
||||
|
Reference in New Issue
Block a user