Skip to contentSkip to conversation

bcachefs: Don't lock inode around page_symlink

PATCH New Alan Huang 1 participant 1 message Aug 4, 2025

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

PATCH 1/1 bcachefs: Don't lock inode around page_symlink

The new inode is not visible before __bch2_link successfully return, no need to lock it.

---
 fs/bcachefs/fs-io-buffered.c | 1 -
 fs/bcachefs/fs.c             | 2 --
 2 files changed, 3 deletions(-)
fs/bcachefs/fs-io-buffered.c +0 -1
index 0005569ecace..c5ed62a11f23 100644
@@ -759,7 +759,6 @@ int bch2_write_end(struct file *file, struct address_space *mapping,
 	struct bch2_folio_reservation *res = fsdata;
 	unsigned offset = pos - folio_pos(folio);
 
-	lockdep_assert_held(&inode->v.i_rwsem);
 	BUG_ON(offset + copied > folio_size(folio));
 
 	if (unlikely(copied < len && !folio_test_uptodate(folio))) {
fs/bcachefs/fs.c +0 -2
index b5e3090f1cb8..66e32cc66841 100644
@@ -865,9 +865,7 @@ static int bch2_symlink(struct mnt_idmap *idmap,
 	if (IS_ERR(inode))
 		return bch2_err_class(PTR_ERR(inode));
 
-	inode_lock(&inode->v);
 	ret = page_symlink(&inode->v, symname, strlen(symname) + 1);
-	inode_unlock(&inode->v);
 
 	if (unlikely(ret))
 		goto err;
Signature · 1 line
2.49.0