linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mke2fs: use ext2fs_open_file() in check_plausibility()
@ 2014-05-21 17:35 Eric Sandeen
  2014-05-21 17:47 ` [PATCH V2] " Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2014-05-21 17:35 UTC (permalink / raw)
  To: ext4 development

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>
---

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 ...

diff --git a/misc/util.c b/misc/util.c
index f85942e..d638625 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -94,7 +94,7 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev)
 	if (flags & CREATE_FILE)
 		fl |= O_CREAT;
 
-	fd = open(device, fl, 0666);
+	fd = ext2fs_open_file(device, fl, 0666);
 	if (fd < 0) {
 		fprintf(stderr, _("Could not open %s: %s\n"),
 			device, error_message(errno));



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-22 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2014-05-22 17:56   ` Theodore Ts'o

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).