bcachefs: fix truncate with ATTR_MODE
authorKent Overstreet <kent.overstreet@gmail.com>
Tue, 15 Jun 2021 02:29:54 +0000 (22:29 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:07 +0000 (17:09 -0400)
commit68a507a2e8cdc9b90599bb5d220a696abdc54838
tree5250c2cf969bea932b9f6f853ebdae29d8b50052
parent8c3f6da9fc526e7ba0f6449efa1040084406e9ba
bcachefs: fix truncate with ATTR_MODE

After the v5.12 rebase, we started oopsing when truncate was passed
ATTR_MODE, due to not passing mnt_userns to setattr_copy(). This
refactors things so that truncate/extend finish by using
bch2_setattr_nonsize(), which solves the problem.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/fs-io.c
fs/bcachefs/fs-io.h
fs/bcachefs/fs.c
fs/bcachefs/fs.h