From: Jan Kara <jack@suse.cz>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH] ext3: retry failed direct IO allocations
Date: Wed, 14 Oct 2009 14:53:16 +0200 [thread overview]
Message-ID: <20091014125316.GF12701@duck.suse.cz> (raw)
In-Reply-To: <4AD3E733.4080903@redhat.com>
On Mon 12-10-09 21:34:27, Eric Sandeen wrote:
> On a 256M 4k block filesystem, doing this in a loop:
>
> dd if=/dev/zero of=test oflag=direct bs=1M count=64
> rm -f test
>
> eventually leads to spurious ENOSPC:
>
> dd: writing `test': No space left on device
>
> As with other block allocation callers, it looks like we need to
> potentially retry the allocations on the initial ENOSPC.
>
> A similar patch went into ext4 (commit
> fbbf69456619de5d251cb9f1df609069178c62d5)
Thanks for the patch Eric. Committed to my tree.
Honza
> ---
>
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index acf1b14..069a163 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -1735,6 +1735,7 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
> ssize_t ret;
> int orphan = 0;
> size_t count = iov_length(iov, nr_segs);
> + int retries = 0;
>
> if (rw == WRITE) {
> loff_t final_size = offset + count;
> @@ -1757,9 +1758,12 @@ static ssize_t ext3_direct_IO(int rw, struct kiocb *iocb,
> }
> }
>
> +retry:
> ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
> offset, nr_segs,
> ext3_get_block, NULL);
> + if (ret == -ENOSPC && ext3_should_retry_alloc(inode->i_sb, &retries))
> + goto retry;
>
> if (orphan) {
> int err;
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
prev parent reply other threads:[~2009-10-14 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 2:34 [PATCH] ext3: retry failed direct IO allocations Eric Sandeen
2009-10-14 12:53 ` Jan Kara [this message]
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=20091014125316.GF12701@duck.suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.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;
as well as URLs for NNTP newsgroup(s).