* [PATCH] e2fsprogs: open device writable for trim/discard
@ 2009-11-17 21:49 Eric Sandeen
2009-11-25 12:05 ` tytso
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-11-17 21:49 UTC (permalink / raw)
To: ext4 development
Sorry about that, the discard ioctl doesn't actually work
unless you open the file with write capabilities...
Signed-off-by: Eric Sandeen <sandeen@redhat.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-25 12:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17 21:49 [PATCH] e2fsprogs: open device writable for trim/discard Eric Sandeen
2009-11-25 12:05 ` tytso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.