All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: jack@suse.cz, jouni.siren@iki.fi, linux-ext4@vger.kernel.org,
	Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH RESEND] ext4: change return value from int to ssize_t in ext4_file_write
Date: Mon, 28 May 2012 18:08:21 -0400	[thread overview]
Message-ID: <20120528220821.GC5610@thunk.org> (raw)
In-Reply-To: <1334280157-11630-1-git-send-email-wenqing.lz@taobao.com>

On Fri, Apr 13, 2012 at 09:22:37AM +0800, Zheng Liu wrote:
> On 64-platform, when we do a write operation with a huge number of data, it
> will cause that the ret variable overflows.  So it is replaced with ssize_t.
> 
> Reported-by: Jouni Siren <jouni.siren@iki.fi>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>

Applied, with the following commit description:

   ext4: use consistent ssize_t type in ext4_file_write()

   The generic_file_aio_write() function returns ssize_t, and
   ext4_file_write() returns a ssize_t, so use a ssize_t to collect the
   return value from generic_file_aio_write().  It shouldn't matter since
   the VFS read/write paths shouldn't allow a read greater than MAX_INT,
   but there was previously a bug in the AIO code paths, and it's best if
   we use a consistent type so that the return value from
   generic_file_aio_write() can't get truncated.

Regards,

					- Ted

  parent reply	other threads:[~2012-05-28 22:08 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 [this message]
2012-04-13  0:10 ` Bug: Large writes can fail on ext4 if the write buffer is not empty Dave Chinner
2012-04-19 13:10 ` Jouko Orava
2012-04-19 14:15   ` Eric Sandeen
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

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=20120528220821.GC5610@thunk.org \
    --to=tytso@mit.edu \
    --cc=gnehzuil.liu@gmail.com \
    --cc=jack@suse.cz \
    --cc=jouni.siren@iki.fi \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wenqing.lz@taobao.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 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.