lkml.org 
[lkml]   [2013]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 6/7] Squashfs: Directly decompress into the page cache for file data
Date
Hello, Phillip.

one remark below:

>
> +static int squashfs_read_cache(struct page *target_page, u64 block, int
bsize,
> + int pages, struct page **page)
> +{
> + struct inode *i = target_page->mapping->host;
> + struct squashfs_cache_entry *buffer = squashfs_get_datablock(i-
>i_sb,
> + block, bsize);
> + int bytes = buffer->length, res = buffer->error, n, offset = 0;
> + void *pageaddr;
> +
> + if (res) {
> + ERROR("Unable to read page, block %llx, size %x\n", block,
> + bsize);
> + goto out;


have you forgotten to unlock the pages on error path?

in case of error squashfs_readpage will unlock only target page.


> + }
> +
> + for (n = 0; n < pages && bytes > 0; n++,
> + bytes -= PAGE_CACHE_SIZE, offset +=
PAGE_CACHE_SIZE) {
> + int avail = min_t(int, bytes, PAGE_CACHE_SIZE);




\
 
 \ /
  Last update: 2013-11-22 09:01    [W:0.093 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site