projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29f1c1a
)
bcachefs: Fix bch2_inode_insert() race path for tmpfiles
author
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 1 Jul 2024 20:23:54 +0000
(16:23 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Wed, 10 Jul 2024 13:53:39 +0000
(09:53 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/bcachefs/fs.c
b/fs/bcachefs/fs.c
index f9c9a95d7d4cada3b4c55a853d99627009b8d39a..1768b2678b3879c30e1146a898d9726e84e72297 100644
(file)
--- a/
fs/bcachefs/fs.c
+++ b/
fs/bcachefs/fs.c
@@
-194,6
+194,12
@@
static struct bch_inode_info *bch2_inode_insert(struct bch_fs *c, struct bch_ino
* discard_new_inode() expects it to be set...
*/
inode->v.i_flags |= I_NEW;
+ /*
+ * We don't want bch2_evict_inode() to delete the inode on disk,
+ * we just raced and had another inode in cache. Normally new
+ * inodes don't have nlink == 0 - except tmpfiles do...
+ */
+ set_nlink(&inode->v, 1);
discard_new_inode(&inode->v);
inode = old;
} else {