public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Phillip Lougher <phillip.lougher@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Roman Peniaev <r.peniaev@gmail.com>
Subject: Re: [PATCH 6/7] Squashfs: Directly decompress into the page cache for file data
Date: Sun, 24 Nov 2013 01:19:09 +0000	[thread overview]
Message-ID: <5291540D.10001@gmail.com> (raw)
In-Reply-To: <loom.20131122T083329-218@post.gmane.org>

On 22/11/13 07:40, Roman Peniaev wrote:
> 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.

Yup, a fix for -rc1 is on its way.

This error path failed to trigger in my stress tests because it is
pretty hard to hit, because it relies on decompress failure at the
same time as we've raced against another process also grabbing
the pages.

Phillip


>
>
>> +	}
>> +
>> +	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);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


  reply	other threads:[~2013-11-24  1:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  1:48 [PATCH 1/7] Squashfs: Refactor decompressor interface and code Phillip Lougher
2013-11-20  1:48 ` [PATCH 2/7] squashfs: Enhance parallel I/O Phillip Lougher
2013-11-20  1:48 ` [PATCH 3/7] Squashfs: add multi-threaded decompression using percpu variables (V2) Phillip Lougher
2013-11-20  8:33   ` Minchan Kim
2013-11-20  9:36     ` Phillip Lougher
2013-11-20  1:48 ` [PATCH 4/7] Squashfs: Generalise paging handling in the decompressors Phillip Lougher
2013-11-20  1:48 ` [PATCH 5/7] Squashfs: Restructure squashfs_readpage() Phillip Lougher
2013-11-20  1:48 ` [PATCH 6/7] Squashfs: Directly decompress into the page cache for file data Phillip Lougher
2013-11-22  7:40   ` Roman Peniaev
2013-11-24  1:19     ` Phillip Lougher [this message]
2013-11-20  1:48 ` [PATCH 7/7] Squashfs: Check stream is not NULL in decompressor_multi.c Phillip Lougher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5291540D.10001@gmail.com \
    --to=phillip.lougher@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=r.peniaev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox