mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Peter Osterlund <petero2@telia.com>
Cc: axboe@suse.de, packet-writing@suse.com, linux-kernel@vger.kernel.org
Subject: Re: ext2 on a CD-RW
Date: Thu, 1 Jan 2004 16:24:27 -0800	[thread overview]
Message-ID: <20040101162427.4c6c020b.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0401020022060.2407-100000@telia.com>

Peter Osterlund <petero2@telia.com> wrote:
>
> If I create an ext2 filesystem
>  with 2kb blocksize, I hit a bug when I try to write some large files to
>  the filesystem. The problem is that the code in mpage_writepage() fails if
>  a page is mapped to disk across a packet boundary. In that case, the
>  bio_add_page() call at line 543 in mpage.c can fail even if the bio was
>  previously empty. The code then passes an empty bio to submit_bio(), which
>  triggers a bug at line 2303 in ll_rw_blk.c. This patch seems to fix the
>  problem.
> 
>  --- linux/fs/mpage.c.old	2004-01-02 00:26:19.000000000 +0100
>  +++ linux/fs/mpage.c	2004-01-02 00:26:50.000000000 +0100
>  @@ -541,6 +541,11 @@
>   
>   	length = first_unmapped << blkbits;
>   	if (bio_add_page(bio, page, length, 0) < length) {
>  +		if (!bio->bi_size) {
>  +			bio_put(bio);
>  +			bio = NULL;
>  +			goto confused;
>  +		}
>   		bio = mpage_bio_submit(WRITE, bio);
>   		goto alloc_new;
>   	}

Confused.  We initially have an empty BIO, and we run bio_add_page()
against it, adding one page.

How can that bio_add_page() fail to add the page?

Cold you describe the failure a little more please?

>  I noted that performance is quite bad with 2kb blocksize. It is a lot
>  faster with 4kb blocksize. (2kb blocksize with the udf filesystem is not
>  slow, only ext2 seems to have this problem.) Maybe the "confused" case
>  (which calls a_ops->writepage()) in mpage_writepage() isn't really meant
>  to be fast. Is there a better way to fix this problem?

How much slower is it?

  reply	other threads:[~2004-01-02  0:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-01 23:47 Peter Osterlund
2004-01-02  0:24 ` Andrew Morton [this message]
2004-01-02  1:30   ` Peter Osterlund
2004-01-02  9:06     ` Arjan van de Ven
2004-01-02 10:09       ` Jens Axboe
2004-01-02 10:51       ` Peter Osterlund
2004-01-02 10:59         ` Jens Axboe
2004-01-02 12:09           ` Peter Osterlund
2004-01-02 12:19             ` Jens Axboe
2004-01-02 13:38               ` Peter Osterlund
2004-01-02 13:59                 ` Jens Axboe
2004-01-02 16:12           ` Peter Osterlund
2004-03-29 15:38           ` Peter Osterlund
2004-01-02 10:08     ` Jens Axboe
2004-01-03 19:14 ` Pavel Machek
2004-01-03 20:32   ` Peter Osterlund

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=20040101162427.4c6c020b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=packet-writing@suse.com \
    --cc=petero2@telia.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

Powered by JetHome