linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH V2] mke2fs: use ext2fs_open_file() in check_plausibility()
Date: Wed, 21 May 2014 11:00:30 -0700	[thread overview]
Message-ID: <20140521180030.GA17413@birch.djwong.org> (raw)
In-Reply-To: <537CE6C0.1050800@redhat.com>

On Wed, May 21, 2014 at 12:47:44PM -0500, Eric Sandeen wrote:
> The commit:
> 
> 802146c mke2fs: create a regular file if necessary
> 
> caused a regression on 32-bit machines; the open() fails if
> the file size is > 4G.
> 
> Using ext2fs_open_file() fixes it.
> 
> Resolves: Red Hat Bugzilla #1099892
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: against master!  Sorry, first patch was against the
> bisection point.
> 
> TBH I don't know if this should be using ext2fs_open_file(),
> or some other magic like O_LARGEFILE, but this works for me,
> and we use the stat/fstat wrapper here too, so ...

/me suspects do_write_internal() in create_inode.c should use this too.

As for the patch itself, looks good, so
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D
> 
> 
> 
> diff --git a/misc/util.c b/misc/util.c
> index 1c0818f..7e91509 100644
> --- a/misc/util.c
> +++ b/misc/util.c
> @@ -194,10 +194,10 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev)
>  	char *fs_type = NULL;
>  	char *fs_label = NULL;
>  
> -	fd = open(device, fl, 0666);
> +	fd = ext2fs_open_file(device, fl, 0666);
>  	if ((fd < 0) && (errno == ENOENT) && (flags & CREATE_FILE)) {
>  		fl |= O_CREAT;
> -		fd = open(device, fl, 0666);
> +		fd = ext2fs_open_file(device, fl, 0666);
>  		if (fd >= 0 && (flags & VERBOSE_CREATE))
>  			printf(_("Creating regular file %s\n"), device);
>  	}
> 
> 
> --
> 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:[~2014-05-21 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21 17:35 [PATCH] mke2fs: use ext2fs_open_file() in check_plausibility() Eric Sandeen
2014-05-21 17:47 ` [PATCH V2] " Eric Sandeen
2014-05-21 18:00   ` Darrick J. Wong [this message]
2014-05-22 17:56   ` Theodore Ts'o

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=20140521180030.GA17413@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --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).