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

Reported-by: [email protected]
Signed-off-by: Alan Huang <[email protected]>
---
 fs/bcachefs/fs-io-buffered.c | 1 -
 fs/bcachefs/fs.c             | 2 --
 2 files changed, 3 deletions(-)

diff --git a/fs/bcachefs/fs-io-buffered.c b/fs/bcachefs/fs-io-buffered.c
index 0005569ecace..c5ed62a11f23 100644
--- a/fs/bcachefs/fs-io-buffered.c
+++ b/fs/bcachefs/fs-io-buffered.c
@@ -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))) {
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index b5e3090f1cb8..66e32cc66841 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -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;
-- 
2.49.0


Reply via email to