diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-12-23 02:00:04 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-12-23 02:00:04 +0100 |
commit | 9efa3ed504edb1c1fc88dba96fd32168f50ab77c (patch) | |
tree | b41b035a77e0a738a2769a72aaaf1818961b64bd /lib | |
parent | Merge tag 'xfs-5.5-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff) | |
parent | fs: call fsnotify_sb_delete after evict_inodes (diff) | |
download | linux-9efa3ed504edb1c1fc88dba96fd32168f50ab77c.tar.xz linux-9efa3ed504edb1c1fc88dba96fd32168f50ab77c.zip |
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fixes from Al Viro:
"Eric's s_inodes softlockup fixes + Jan's fix for recent regression
from pipe rework"
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
fs: call fsnotify_sb_delete after evict_inodes
fs: avoid softlockups in s_inodes iterators
pipe: Fix bogus dereference in iov_iter_alignment()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/iov_iter.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c index fb29c02c6a3c..51595bf3af85 100644 --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -1222,11 +1222,12 @@ EXPORT_SYMBOL(iov_iter_discard); unsigned long iov_iter_alignment(const struct iov_iter *i) { - unsigned int p_mask = i->pipe->ring_size - 1; unsigned long res = 0; size_t size = i->count; if (unlikely(iov_iter_is_pipe(i))) { + unsigned int p_mask = i->pipe->ring_size - 1; + if (size && i->iov_offset && allocated(&i->pipe->bufs[i->head & p_mask])) return size | i->iov_offset; return size; |