lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Nov 2009 15:49:03 -0600
From:	Eric Sandeen <sandeen@...hat.com>
To:	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH] e2fsprogs: open device writable for trim/discard

Sorry about that, the discard ioctl doesn't actually work
unless you open the file with write capabilities...

Signed-off-by: Eric Sandeen <sandeen@...hat.com>
---

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 94b4c81..0aa31d8 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1877,7 +1877,7 @@ static void mke2fs_discard_blocks(ext2_filsys fs)
 	range[0] = 0;
 	range[1] = blocks * blocksize;
 
-	fd = open64(fs->device_name, O_RDONLY);
+	fd = open64(fs->device_name, O_RDWR);
 
 	/*
 	 * We don't care about whether the ioctl succeeds; it's only an

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

Powered by blists - more mailing lists