trim(8): candelete() returns wrong results because fd is opened O_WRONLY

This was discovered while using trim(8) to test bhyve trim

Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D24371
This commit is contained in:
Allan Jude 2020-04-23 20:14:59 +00:00
parent 22769bbe30
commit 9d433cb875
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360230

View file

@ -220,7 +220,7 @@ trim(const char *path, off_t offset, off_t length, bool dryrun, bool verbose)
return (0);
}
fd = opendev(path, O_WRONLY | O_DIRECT);
fd = opendev(path, O_RDWR | O_DIRECT);
arg[0] = offset;
arg[1] = length;