[PATCH] mke2fs: restore verbose message for BLKDISCARD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Stephen Warren <swarren@xxxxxxxxxx>

mke2fs on a large slow eMMC device may appear to hang while executing
ioctl(BLKDISCARD). CTRL-C and CTRL-\ don't appear to respond, or respond
extremely slowly. -v doesn't give any hints what's happening. Only strace
is a clue. Make -v print some clues to make it easier to track down the
apparent hang.

This change re-uses the original messages that were implemented as part
of 5827d24 "mke2fs support for BLKDISCARD" in order to easily re-use the
translations of that message. Note that this patch prints the first
message before executing the IOCTL, so the user is told what's going on
before the long wait.

Signed-off-by: Stephen Warren <swarren@xxxxxxxxxx>
---
Note: I've left mke2fs running for a while now (tens of minutes on a 16GiB
eMMC), and this IOCTL still hasn't completed. I'm not sure how long it's
meant to take. Perhaps the long execution time is actually a kernel bug in
the MMC core or our SDHCI driver.
---
 misc/mke2fs.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index bbf477a..defb932 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2272,7 +2272,20 @@ static int mke2fs_discard_device(ext2_filsys fs)
 	 * we do not print numeric progress resulting in failure
 	 * afterwards.
 	 */
+	if (verbose) {
+		printf(_("Calling BLKDISCARD from %llu to %llu "),
+			(unsigned long long)0,
+			(unsigned long long)fs->blocksize);
+		fflush(stdout);
+	}
 	retval = io_channel_discard(fs->io, 0, fs->blocksize);
+	if (verbose) {
+		if (retval)
+			printf(_("failed.\n"));
+		else
+			printf(_("succeeded.\n"));
+	}
+
 	if (retval)
 		return retval;
 	cur = fs->blocksize;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux