[PATCH] e2fsprogs: open device writable for trim/discard

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

 



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

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

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@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