diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-27 18:10:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-27 18:10:34 -0400 |
commit | 9977b1a71488742606376c09e19e0074e4403cdf (patch) | |
tree | 08d35c71199ea2cd7adef98dd52ef917014d08e7 /fs/9p | |
parent | 568d850e3c6015acec8f854f5be97766497a676b (diff) | |
parent | aafee43b72863f1f70aeaf1332d049916e8df239 (diff) |
Merge tag '9p-for-5.4' of git://github.com/martinetd/linux
Pull 9p updates from Dominique Martinet:
"Some of the usual small fixes and cleanup.
Small fixes all around:
- avoid overlayfs copy-up for PRIVATE mmaps
- KUMSAN uninitialized warning for transport error
- one syzbot memory leak fix in 9p cache
- internal API cleanup for v9fs_fill_super"
* tag '9p-for-5.4' of git://github.com/martinetd/linux:
9p/vfs_super.c: Remove unused parameter data in v9fs_fill_super
9p/cache.c: Fix memory leak in v9fs_cache_session_get_cookie
9p: Transport error uninitialized
9p: avoid attaching writeback_fid on mmap with type PRIVATE
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/cache.c | 2 | ||||
-rw-r--r-- | fs/9p/vfs_file.c | 3 | ||||
-rw-r--r-- | fs/9p/vfs_super.c | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/fs/9p/cache.c b/fs/9p/cache.c index 995e332eee5c..eb2151fb6049 100644 --- a/fs/9p/cache.c +++ b/fs/9p/cache.c | |||
@@ -51,6 +51,8 @@ void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses) | |||
51 | if (!v9ses->cachetag) { | 51 | if (!v9ses->cachetag) { |
52 | if (v9fs_random_cachetag(v9ses) < 0) { | 52 | if (v9fs_random_cachetag(v9ses) < 0) { |
53 | v9ses->fscache = NULL; | 53 | v9ses->fscache = NULL; |
54 | kfree(v9ses->cachetag); | ||
55 | v9ses->cachetag = NULL; | ||
54 | return; | 56 | return; |
55 | } | 57 | } |
56 | } | 58 | } |
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 4cc966a31cb3..fe7f0bd2048e 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -513,6 +513,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma) | |||
513 | v9inode = V9FS_I(inode); | 513 | v9inode = V9FS_I(inode); |
514 | mutex_lock(&v9inode->v_mutex); | 514 | mutex_lock(&v9inode->v_mutex); |
515 | if (!v9inode->writeback_fid && | 515 | if (!v9inode->writeback_fid && |
516 | (vma->vm_flags & VM_SHARED) && | ||
516 | (vma->vm_flags & VM_WRITE)) { | 517 | (vma->vm_flags & VM_WRITE)) { |
517 | /* | 518 | /* |
518 | * clone a fid and add it to writeback_fid | 519 | * clone a fid and add it to writeback_fid |
@@ -614,6 +615,8 @@ static void v9fs_mmap_vm_close(struct vm_area_struct *vma) | |||
614 | (vma->vm_end - vma->vm_start - 1), | 615 | (vma->vm_end - vma->vm_start - 1), |
615 | }; | 616 | }; |
616 | 617 | ||
618 | if (!(vma->vm_flags & VM_SHARED)) | ||
619 | return; | ||
617 | 620 | ||
618 | p9_debug(P9_DEBUG_VFS, "9p VMA close, %p, flushing", vma); | 621 | p9_debug(P9_DEBUG_VFS, "9p VMA close, %p, flushing", vma); |
619 | 622 | ||
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index ca243e658d71..74df32be4c6a 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -58,7 +58,7 @@ static int v9fs_set_super(struct super_block *s, void *data) | |||
58 | 58 | ||
59 | static int | 59 | static int |
60 | v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses, | 60 | v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses, |
61 | int flags, void *data) | 61 | int flags) |
62 | { | 62 | { |
63 | int ret; | 63 | int ret; |
64 | 64 | ||
@@ -132,7 +132,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, | |||
132 | retval = PTR_ERR(sb); | 132 | retval = PTR_ERR(sb); |
133 | goto clunk_fid; | 133 | goto clunk_fid; |
134 | } | 134 | } |
135 | retval = v9fs_fill_super(sb, v9ses, flags, data); | 135 | retval = v9fs_fill_super(sb, v9ses, flags); |
136 | if (retval) | 136 | if (retval) |
137 | goto release_sb; | 137 | goto release_sb; |
138 | 138 | ||