bcachefs: fix truncate without a size change
authorDan Robertson <dan@dlrobertson.com>
Mon, 28 Jun 2021 00:54:34 +0000 (20:54 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:07 +0000 (17:09 -0400)
commit78d66ab1ca541ba95a9ad89780466398b348c230
treec0788ce2190647a93f6c282675e54ce3c6fd4569
parent6f152b0f375450b72724b6eb2ec00f7669fc910e
bcachefs: fix truncate without a size change

Do not attempt to shortcut a truncate when the given new size is
the same as the current size. There may be blocks allocated to the
file that extend beyond the i_size. The ctime and mtime should
not be updated in this case.

Signed-off-by: Dan Robertson <dan@dlrobertson.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io.c