mirror of
https://github.com/libfuse/libfuse.git
synced 2024-11-23 12:14:15 +08:00
fix oops
This commit is contained in:
parent
c149266326
commit
3f2fb4a05a
@ -1,3 +1,8 @@
|
||||
2004-11-14 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
* Fix bug in fuse_readpages() causing Oops in certain situations.
|
||||
Bug found by Vincenzo Ciancia.
|
||||
|
||||
2004-11-11 Miklos Szeredi <miklos@szeredi.hu>
|
||||
|
||||
* Check kernel interface version in fusermount to prevent
|
||||
|
16
kernel/dev.c
16
kernel/dev.c
@ -131,24 +131,22 @@ static struct fuse_req *do_get_request(struct fuse_conn *fc)
|
||||
|
||||
struct fuse_req *fuse_get_request(struct fuse_conn *fc)
|
||||
{
|
||||
struct fuse_req *req;
|
||||
|
||||
if (down_interruptible(&fc->unused_sem))
|
||||
return NULL;
|
||||
return do_get_request(fc);
|
||||
}
|
||||
|
||||
req = do_get_request(fc);
|
||||
return req;
|
||||
struct fuse_req *fuse_get_request_nonint(struct fuse_conn *fc)
|
||||
{
|
||||
down(&fc->unused_sem);
|
||||
return do_get_request(fc);
|
||||
}
|
||||
|
||||
struct fuse_req *fuse_get_request_nonblock(struct fuse_conn *fc)
|
||||
{
|
||||
struct fuse_req *req;
|
||||
|
||||
if (down_trylock(&fc->unused_sem))
|
||||
return NULL;
|
||||
|
||||
req = do_get_request(fc);
|
||||
return req;
|
||||
return do_get_request(fc);
|
||||
}
|
||||
|
||||
void fuse_put_request(struct fuse_conn *fc, struct fuse_req *req)
|
||||
|
@ -375,7 +375,7 @@ static int fuse_readpages_fill(void *_data, struct page *page)
|
||||
req->pages[req->num_pages - 1]->index + 1 != page->index)) {
|
||||
struct fuse_conn *fc = INO_FC(page->mapping->host);
|
||||
fuse_send_readpages(req, data->file, inode);
|
||||
data->req = req = fuse_get_request(fc);
|
||||
data->req = req = fuse_get_request_nonint(fc);
|
||||
}
|
||||
req->pages[req->num_pages] = page;
|
||||
req->num_pages ++;
|
||||
@ -389,7 +389,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
|
||||
struct fuse_conn *fc = INO_FC(inode);
|
||||
struct fuse_readpages_data data;
|
||||
|
||||
data.req = fuse_get_request(fc);
|
||||
data.req = fuse_get_request_nonint(fc);
|
||||
data.file = file;
|
||||
data.inode = inode;
|
||||
|
||||
|
@ -343,6 +343,11 @@ void fuse_reset_request(struct fuse_req *req);
|
||||
*/
|
||||
struct fuse_req *fuse_get_request(struct fuse_conn *fc);
|
||||
|
||||
/**
|
||||
* Reserve a preallocated request, non-interruptible
|
||||
*/
|
||||
struct fuse_req *fuse_get_request_nonint(struct fuse_conn *fc);
|
||||
|
||||
/**
|
||||
* Reserve a preallocated request, non-blocking
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user