All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Jouko Orava <jouko.orava@helsinki.fi>
Cc: linux-ext4@vger.kernel.org, Zheng Liu <gnehzuil.liu@gmail.com>
Subject: Re: Bug: Large writes can fail on ext4 if the write buffer is not empty
Date: Thu, 19 Apr 2012 09:15:40 -0500	[thread overview]
Message-ID: <4F901E0C.3010008@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.00.1204191543570.13563@ruuvi.it.helsinki.fi>

On 4/19/12 8:10 AM, Jouko Orava wrote:
> Hi Zheng,
> 
> I can confirm the bug exists on latest RHEL 6 x86_64 kernels (2.6.32-220).
> 
> On current mainline kernels all writes are limited to one page under 2GB,
> which masks the problem. I have not checked if mainline 2.6.32 has this
> limit or not. It does not matter: the limit is just a band-aid to paper
> over filesystem bugs, and should not mean you don't fix filesystem bugs.

FWIW, we tried fairly hard to get the limit lifted in the vfs, to no avail.

> I can confirm the one line patch to fs/ext4/file.c does fix the problem.
> I have test kernels based on 2.6.32-220.7.1.el6.x86_64 with only
> the patch applied, at
> 	http://www.helsinki.fi/~joorava/kernel/
> if anyone else is interested in testing.
> 
> I did some (limited) testing on ext4 with the patch. It fixes the problem:
> large writes work very well too. No problems popped up in testing.
> 
> Tested-by: Jouko Orava <jouko.orava@helsinki.fi>
> 
> 
> I'd also like to point at the real bug here, in Jouni's original strace:
> 
> 	writev(3, [{"\0\0\0\0\0\0\0\0", 8}, {"", 2147483648}], 2) = -2147483640
> 
> The syscall returns a negative value, which is not the actual number of
> bytes written (since it is 32-bit wrapped), and errno has not been
> changed. There is no way for userspace to handle this result correctly!
> 
> There is no way anyone sane should just gloss over this saying
> "programmer fault, you're doing it wrong".
> This is a real bug, and deserves fixing sooner rather than later.

Agreed, I think Dave was a little to quick on the draw on his reply.  :)

-Eric

> Thanks,
>    Jouko Orava
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2012-04-19 14:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 14:47 Bug: Large writes can fail on ext4 if the write buffer is not empty Jouni Siren
2012-04-12 16:06 ` Zheng Liu
2012-04-12 20:20   ` Jan Kara
2012-04-13  1:22     ` [PATCH RESEND] ext4: change return value from int to ssize_t in ext4_file_write Zheng Liu
2012-05-22 19:44       ` Eric Sandeen
2012-05-28 22:08       ` Ted Ts'o
2012-04-19 13:10   ` Bug: Large writes can fail on ext4 if the write buffer is not empty Jouko Orava
2012-04-19 14:15     ` Eric Sandeen [this message]
2012-04-19 14:38       ` Jouko Orava
2012-04-19 14:45         ` Eric Sandeen
2012-04-19 15:09           ` Jouko Orava
2012-04-19 15:28             ` Zheng Liu
2012-04-20  2:12       ` Dave Chinner
2012-04-19 14:56     ` Zheng Liu
2012-04-13  0:10 ` Dave Chinner

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=4F901E0C.3010008@redhat.com \
    --to=sandeen@redhat.com \
    --cc=gnehzuil.liu@gmail.com \
    --cc=jouko.orava@helsinki.fi \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.