Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26178
b: refs/heads/master
c: 6dbbcb1
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi committed Apr 26, 2006
1 parent 3eab390 commit fa9bd02
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a5fb1ea74d8b82ca1461b885a1334fb21e037be
refs/heads/master: 6dbbcb120570d747b00783820ee02d1e1bcf63de
13 changes: 11 additions & 2 deletions trunk/fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
}
}

/*
* Called with sbput_sem held for read (request_end) or write
* (fuse_put_super). By the time fuse_put_super() is finished, all
* inodes belonging to background requests must be released, so the
* iputs have to be done within the locked region.
*/
void fuse_release_background(struct fuse_conn *fc, struct fuse_req *req)
{
iput(req->inode);
iput(req->inode2);
if (req->file)
fput(req->file);
spin_lock(&fc->lock);
list_del(&req->bg_entry);
if (fc->num_background == FUSE_MAX_BACKGROUND) {
Expand Down Expand Up @@ -178,6 +182,11 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
if (fc->mounted)
fuse_release_background(fc, req);
up_read(&fc->sbput_sem);

/* fput must go outside sbput_sem, otherwise it can deadlock */
if (req->file)
fput(req->file);

if (end)
end(fc, req);
else
Expand Down

0 comments on commit fa9bd02

Please sign in to comment.