From: Miklos Szeredi During heavy parallel filesystem activity it was possible to Oops the kernel. The reason is that read_cache_pages() could skip pages which have already been inserted into the cache by another task. Occasionally this may result in zero pages actually being sent, while fuse_send_readpages() relies on at least one page being in the request. So check this corner case and just free the request instead of trying to send it. Reported and tested by Konstantin Isakov. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton --- fs/fuse/file.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff -puN fs/fuse/file.c~fuse-fix-oops-in-fuse_send_readpages fs/fuse/file.c --- devel/fs/fuse/file.c~fuse-fix-oops-in-fuse_send_readpages 2006-04-01 16:22:35.000000000 -0800 +++ devel-akpm/fs/fuse/file.c 2006-04-01 16:22:35.000000000 -0800 @@ -397,8 +397,12 @@ static int fuse_readpages(struct file *f return -EINTR; err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data); - if (!err) - fuse_send_readpages(data.req, file, inode); + if (!err) { + if (data.req->num_pages) + fuse_send_readpages(data.req, file, inode); + else + fuse_put_request(fc, data.req); + } return err; } _