Whamcloud - gitweb
mke2fs: Don't erase flash device if "-n" is given 24/1324/1
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 7 Jun 2011 16:22:29 +0000 (10:22 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 1 Sep 2011 23:04:03 +0000 (17:04 -0600)
commit23537a11dff73d6bd9c87debac5a0345e81e719a
tree6ad210916e27b3f10625bbadc88cb4058aafbc1f
parent89dad1f4433ee9655e6938986aa64ac718c4377b
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
c7cd908be59f48c66b4f3ac9a631ffe3dde4f1ab, 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>
Change-Id: I8ed6cfa06b6c6dd9ef3e64f1153eb1ec925ac312
misc/mke2fs.c