aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 640fc229df10..5cb8614508c3 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -258,10 +258,14 @@ void fuse_queue_forget(struct fuse_conn *fc, struct fuse_forget_link *forget,
258 forget->forget_one.nlookup = nlookup; 258 forget->forget_one.nlookup = nlookup;
259 259
260 spin_lock(&fc->lock); 260 spin_lock(&fc->lock);
261 fc->forget_list_tail->next = forget; 261 if (fc->connected) {
262 fc->forget_list_tail = forget; 262 fc->forget_list_tail->next = forget;
263 wake_up(&fc->waitq); 263 fc->forget_list_tail = forget;
264 kill_fasync(&fc->fasync, SIGIO, POLL_IN); 264 wake_up(&fc->waitq);
265 kill_fasync(&fc->fasync, SIGIO, POLL_IN);
266 } else {
267 kfree(forget);
268 }
265 spin_unlock(&fc->lock); 269 spin_unlock(&fc->lock);
266} 270}
267 271
@@ -1358,6 +1362,10 @@ static int fuse_notify_inval_entry(struct fuse_conn *fc, unsigned int size,
1358 if (outarg.namelen > FUSE_NAME_MAX) 1362 if (outarg.namelen > FUSE_NAME_MAX)
1359 goto err; 1363 goto err;
1360 1364
1365 err = -EINVAL;
1366 if (size != sizeof(outarg) + outarg.namelen + 1)
1367 goto err;
1368
1361 name.name = buf; 1369 name.name = buf;
1362 name.len = outarg.namelen; 1370 name.len = outarg.namelen;
1363 err = fuse_copy_one(cs, buf, outarg.namelen + 1); 1371 err = fuse_copy_one(cs, buf, outarg.namelen + 1);