We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29f1c1a commit b02f973Copy full SHA for b02f973
fs/bcachefs/fs.c
@@ -194,6 +194,12 @@ static struct bch_inode_info *bch2_inode_insert(struct bch_fs *c, struct bch_ino
194
* discard_new_inode() expects it to be set...
195
*/
196
inode->v.i_flags |= I_NEW;
197
+ /*
198
+ * We don't want bch2_evict_inode() to delete the inode on disk,
199
+ * we just raced and had another inode in cache. Normally new
200
+ * inodes don't have nlink == 0 - except tmpfiles do...
201
+ */
202
+ set_nlink(&inode->v, 1);
203
discard_new_inode(&inode->v);
204
inode = old;
205
} else {
0 commit comments