From: Theodore Ts'o <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 5/7] mke2fs: proceed if the user doesn't type anything after 5 seconds
Date: Mon, 28 Apr 2014 19:26:34 -0400 [thread overview]
Message-ID: <20140428232634.GD7857@thunk.org> (raw)
In-Reply-To: <535E74D4.4050805@redhat.com>
On Mon, Apr 28, 2014 at 10:33:40AM -0500, Eric Sandeen wrote:
> On 4/26/14, 7:00 PM, Theodore Ts'o wrote:
> > If mke2fs needs to ask the user for permission, and the user doesn't
> > type anything for five seconds, proceed as if the user had said yes.
> >
> > This will allow us to add more stringent checks without breaking
> > existing scripts (much).
>
> Hm, this sounds a little dangerous - "-F" overrides a lot.
Actually, if you take a look at what we use proceed_question() for, it
doesn't actually override anything (up until now) that might lead to
data loss. It's for things like trying to create an file system with
a block size greater than 4k on an x86 platform, creating a file
system larger than the apparent block size, etc. The main goal was to
make sure the user actually *sees* the darned message.
Perhaps the only case where proceed_question() can prevent data loss
is the one where the user typo's /dev/sda3 as /dev/sda. Everything
else is in the category of "we want to make sure the user sees the
warning".
The motivation behind this is adding this safety check:
% ./misc/mke2fs -t ext4 -L test-filesystem /dev/sdc3 8M
mke2fs 1.42.9 (4-Feb-2014)
/dev/sdc3 contains a ext4 file system labelled 'test-filesystem'
Proceed anyway (or wait 5 seconds) ? (y,n)
Previously, we would blithely blow away /dev/sdc3 without even giving
a warning. So if stdin (fd 0) is not a tty, we skip this test
entirely --- otherwise existing scripts would fail. However, if a
script is attached to a tty, we would end up stalling the script
waiting for the user to answer yes/no where previously no question
would be asked at all. This is the case where it's important that
proceed_question() will now pause five seconds, and then continue.
- Ted
next prev parent reply other threads:[~2014-04-28 23:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-27 0:00 [PATCH 1/7] mke2fs: don't ask the proceed question using a regular file Theodore Ts'o
2014-04-27 0:00 ` [PATCH 2/7] mke2fs, tune2fs: call proceed_question() from check_plausibility()'s caller Theodore Ts'o
2014-04-27 0:00 ` [PATCH 3/7] mke2fs: don't complain if the regular file is too small Theodore Ts'o
2014-04-28 15:26 ` Eric Sandeen
2014-04-27 0:00 ` [PATCH 4/7] mke2fs: create a regular file if necessary Theodore Ts'o
2014-04-30 12:21 ` Lukáš Czerner
2014-04-30 14:06 ` Theodore Ts'o
2014-04-30 14:14 ` Lukáš Czerner
2014-04-30 14:18 ` Theodore Ts'o
2014-04-30 14:35 ` Lukáš Czerner
2014-04-30 15:26 ` Theodore Ts'o
2014-05-05 15:17 ` Eric Sandeen
2014-04-27 0:00 ` [PATCH 5/7] mke2fs: proceed if the user doesn't type anything after 5 seconds Theodore Ts'o
2014-04-28 15:33 ` Eric Sandeen
2014-04-28 15:36 ` Eric Sandeen
2014-04-28 23:26 ` Theodore Ts'o [this message]
2014-04-29 0:32 ` Eric Sandeen
2014-04-30 6:53 ` Lukáš Czerner
2014-04-27 0:00 ` [PATCH 6/7] mke2fs: check for pre-existing file system Theodore Ts'o
2014-04-30 11:50 ` Lukáš Czerner
2014-04-30 13:44 ` Lukáš Czerner
2014-04-30 14:10 ` Theodore Ts'o
2014-04-27 0:00 ` [PATCH 7/7] mke2fs: only print the low-level file system stats in verbose mode Theodore Ts'o
2014-04-30 11:22 ` Lukáš Czerner
2014-04-30 14:01 ` Theodore Ts'o
2014-04-30 14:25 ` Lukáš Czerner
2014-04-28 15:24 ` [PATCH 1/7] mke2fs: don't ask the proceed question using a regular file Eric Sandeen
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=20140428232634.GD7857@thunk.org \
--to=tytso@mit.edu \
--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).