diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-09-08 01:06:57 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-09-10 10:52:16 -0400 |
commit | ee64e00984ec3ea3fbf9b4331cbd073690ff8765 (patch) | |
tree | 66666b08bee97f7b69826e2062d9d33d91549d77 /fs/bcachefs/fs.c | |
parent | 6700f5b9af27d3feea1162fa43c4861e98f8f021 (diff) |
bcachefs: Don't delete open files in online fsckbcachefs-v6.10.9-fixesbcachefs-for-v6.10
[ Upstream commit 16005147cca41a0f67b5def2a4656286f8c0db4a ]
If a file is unlinked but still open, we don't want online fsck to
delete it - or fun inconsistencies will happen.
https://github.com/koverstreet/bcachefs/issues/727
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r-- | fs/bcachefs/fs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index fa1fee05cf8f..162f7836ca79 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -177,6 +177,14 @@ static unsigned bch2_inode_hash(subvol_inum inum) return jhash_3words(inum.subvol, inum.inum >> 32, inum.inum, JHASH_INITVAL); } +struct bch_inode_info *__bch2_inode_hash_find(struct bch_fs *c, subvol_inum inum) +{ + return to_bch_ei(ilookup5_nowait(c->vfs_sb, + bch2_inode_hash(inum), + bch2_iget5_test, + &inum)); +} + static struct bch_inode_info *bch2_inode_insert(struct bch_fs *c, struct bch_inode_info *inode) { subvol_inum inum = inode_inum(inode); |