e2fsprogs: open device writable for trim/discard
PATCH 1/1 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 <[email protected]>
---
misc/mke2fs.c +1 -1
@@ -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
[email protected]
AppliedQuoted 2 lines · Eric Sandeen
Sorry about that, the discard ioctl doesn't actually work unless you open the file with write capabilities...
Applied, thanks.
- Ted