mirror of https://github.com/vitalif/e2fsprogs
mke2fs: Don't erase flash device if "-n" is given
If "mke2fs -n" is used, there should be no changes to the underlying
device. Unfortunately, when the "discard" option was added in commit
c7cd908be5
, it did not check for the "-n"
flag, and will discard all data on a flash device even if "-n" is given.
Check for the "noaction" flag before discarding any filesystem data.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
bitmap-optimize
parent
bcb942c201
commit
8185ab9f38
|
@ -2142,7 +2142,7 @@ int main (int argc, char *argv[])
|
|||
}
|
||||
|
||||
/* Can't undo discard ... */
|
||||
if (discard && (io_ptr != undo_io_manager)) {
|
||||
if (!noaction && discard && (io_ptr != undo_io_manager)) {
|
||||
retval = mke2fs_discard_blocks(fs);
|
||||
|
||||
if (!retval && mke2fs_discard_zeroes_data(fs)) {
|
||||
|
|
Loading…
Reference in New Issue