Skip to content

Commit 9977b1a

Browse files
committed
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
2 parents 568d850 + aafee43 commit 9977b1a

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

fs/9p/cache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ void v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses)
5151
if (!v9ses->cachetag) {
5252
if (v9fs_random_cachetag(v9ses) < 0) {
5353
v9ses->fscache = NULL;
54+
kfree(v9ses->cachetag);
55+
v9ses->cachetag = NULL;
5456
return;
5557
}
5658
}

fs/9p/vfs_file.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma)
513513
v9inode = V9FS_I(inode);
514514
mutex_lock(&v9inode->v_mutex);
515515
if (!v9inode->writeback_fid &&
516+
(vma->vm_flags & VM_SHARED) &&
516517
(vma->vm_flags & VM_WRITE)) {
517518
/*
518519
* clone a fid and add it to writeback_fid
@@ -614,6 +615,8 @@ static void v9fs_mmap_vm_close(struct vm_area_struct *vma)
614615
(vma->vm_end - vma->vm_start - 1),
615616
};
616617

618+
if (!(vma->vm_flags & VM_SHARED))
619+
return;
617620

618621
p9_debug(P9_DEBUG_VFS, "9p VMA close, %p, flushing", vma);
619622

fs/9p/vfs_super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static int v9fs_set_super(struct super_block *s, void *data)
5858

5959
static int
6060
v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
61-
int flags, void *data)
61+
int flags)
6262
{
6363
int ret;
6464

@@ -132,7 +132,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
132132
retval = PTR_ERR(sb);
133133
goto clunk_fid;
134134
}
135-
retval = v9fs_fill_super(sb, v9ses, flags, data);
135+
retval = v9fs_fill_super(sb, v9ses, flags);
136136
if (retval)
137137
goto release_sb;
138138

net/9p/client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ p9_tag_alloc(struct p9_client *c, int8_t type, unsigned int max_size)
281281

282282
p9pdu_reset(&req->tc);
283283
p9pdu_reset(&req->rc);
284+
req->t_err = 0;
284285
req->status = REQ_STATUS_ALLOC;
285286
init_waitqueue_head(&req->wq);
286287
INIT_LIST_HEAD(&req->req_list);

0 commit comments

Comments
 (0)