Author: allanjude Date: Thu Apr 23 20:14:59 2020 New Revision: 360230 URL: https://svnweb.freebsd.org/changeset/base/360230
Log: 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 Modified: head/usr.sbin/trim/trim.c Modified: head/usr.sbin/trim/trim.c ============================================================================== --- head/usr.sbin/trim/trim.c Thu Apr 23 19:20:58 2020 (r360229) +++ head/usr.sbin/trim/trim.c Thu Apr 23 20:14:59 2020 (r360230) @@ -220,7 +220,7 @@ trim(const char *path, off_t offset, off_t length, boo return (0); } - fd = opendev(path, O_WRONLY | O_DIRECT); + fd = opendev(path, O_RDWR | O_DIRECT); arg[0] = offset; arg[1] = length; _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"