]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bcachefs: Check if extending inode differently
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 9 Oct 2019 13:44:36 +0000 (09:44 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:29 +0000 (17:08 -0400)
commitdaf3fe502a4c20be99579097cc351e91d27fc789
treee96a6c0e8d925fd7aab4d225791400e6c39f93f3
parent14989d547ee308033e080792239e640e076a4460
bcachefs: Check if extending inode differently

In bch2_extent_update(), we have to update the inode if i_size is
changing (the file is being extend) or if i_sectors is changing, but we
want to avoid touching the inode if it's not necessary.

Change sum_sector_overwrites() to also check if there's already data
above where we're writing to - this means we're definitely not extending
the file.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs-io.c
fs/bcachefs/fs-io.h
fs/bcachefs/reflink.c