Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/mszeredi/fuse

Pull FUSE fixes from Miklos Szeredi:
 "This contains bugfixes for FUSE and CUSE and a compile warning fix."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
  fuse: fix retrieve length
  fuse: mark variables uninitialized
  cuse: kill connection on initialization error
  cuse: fix fuse_conn_kill()
  • Loading branch information
Linus Torvalds committed Sep 11, 2012
2 parents e9bd8f1 + c9e67d4 commit 44346cf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions fs/fuse/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,
const char __user *buf,
size_t count, loff_t *ppos)
{
unsigned val;
unsigned uninitialized_var(val);
ssize_t ret;

ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
Expand Down Expand Up @@ -154,7 +154,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,
const char __user *buf,
size_t count, loff_t *ppos)
{
unsigned val;
unsigned uninitialized_var(val);
ssize_t ret;

ret = fuse_conn_limit_write(file, buf, count, ppos, &val,
Expand Down
4 changes: 1 addition & 3 deletions fs/fuse/cuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static void cuse_process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
err_region:
unregister_chrdev_region(devt, 1);
err:
fc->conn_error = 1;
fuse_conn_kill(fc);
goto out;
}

Expand Down Expand Up @@ -532,8 +532,6 @@ static int cuse_channel_release(struct inode *inode, struct file *file)
cdev_del(cc->cdev);
}

/* kill connection and shutdown channel */
fuse_conn_kill(&cc->fc);
rc = fuse_dev_release(inode, file); /* puts the base reference */

return rc;
Expand Down
1 change: 1 addition & 0 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode,
req->pages[req->num_pages] = page;
req->num_pages++;

offset = 0;
num -= this_num;
total_len += this_num;
index++;
Expand Down
12 changes: 7 additions & 5 deletions fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,6 @@ void fuse_conn_kill(struct fuse_conn *fc)
wake_up_all(&fc->waitq);
wake_up_all(&fc->blocked_waitq);
wake_up_all(&fc->reserved_req_waitq);
mutex_lock(&fuse_mutex);
list_del(&fc->entry);
fuse_ctl_remove_conn(fc);
mutex_unlock(&fuse_mutex);
fuse_bdi_destroy(fc);
}
EXPORT_SYMBOL_GPL(fuse_conn_kill);

Expand All @@ -380,7 +375,14 @@ static void fuse_put_super(struct super_block *sb)
struct fuse_conn *fc = get_fuse_conn_super(sb);

fuse_send_destroy(fc);

fuse_conn_kill(fc);
mutex_lock(&fuse_mutex);
list_del(&fc->entry);
fuse_ctl_remove_conn(fc);
mutex_unlock(&fuse_mutex);
fuse_bdi_destroy(fc);

fuse_conn_put(fc);
}

Expand Down

0 comments on commit 44346cf

Please sign in to comment.