diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2010-11-08 21:11:36 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2010-11-08 21:11:36 +0100 |
commit | f4d861ed02b698a38f3859856e900fa6e68fa910 (patch) | |
tree | 56d64ae3c28f33001e6346f589815787e2fb4eab /lib/fuse_lowlevel.c | |
parent | 86cbeb4203997bb8e3aa937f6f8a753eb5420e11 (diff) | |
download | android_external_fuse-f4d861ed02b698a38f3859856e900fa6e68fa910.tar.gz android_external_fuse-f4d861ed02b698a38f3859856e900fa6e68fa910.tar.bz2 android_external_fuse-f4d861ed02b698a38f3859856e900fa6e68fa910.zip |
fix pipe cleanup in do_write_buf()
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r-- | lib/fuse_lowlevel.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index f30156f..2a5e8d2 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -1127,6 +1127,7 @@ static void do_write(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid, const void *inarg, const struct fuse_buf *ibuf) { + struct fuse_ll *f = req->f; struct fuse_buf buf = *ibuf; struct fuse_bufvec bufv = { .buf = &buf, @@ -1157,15 +1158,16 @@ static void do_write_buf(fuse_req_t req, fuse_ino_t nodeid, const void *inarg, if (buf.size < arg->size) { fprintf(stderr, "fuse: do_write_buf: buffer size too small\n"); fuse_reply_err(req, EIO); - return; + goto out; } buf.size = arg->size; req->f->op.write_buf(req, nodeid, &bufv, arg->offset, &fi); +out: /* Need to reset the pipe if ->write_buf() didn't consume all data */ if ((ibuf->flags & FUSE_BUF_IS_FD) && bufv.idx < bufv.count) - fuse_ll_clear_pipe(req->f); + fuse_ll_clear_pipe(f); } static void do_flush(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) |