]> git.hungrycats.org Git - linux/commitdiff
mm: revert "mm: shmem: fix data-race in shmem_getattr()"
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 16 Nov 2024 00:57:24 +0000 (16:57 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Nov 2024 14:37:34 +0000 (15:37 +0100)
commit d1aa0c04294e29883d65eac6c2f72fe95cc7c049 upstream.

Revert d949d1d14fa2 ("mm: shmem: fix data-race in shmem_getattr()") as
suggested by Chuck [1].  It is causing deadlocks when accessing tmpfs over
NFS.

As Hugh commented, "added just to silence a syzbot sanitizer splat: added
where there has never been any practical problem".

Link: https://lkml.kernel.org/r/ZzdxKF39VEmXSSyN@tissot.1015granger.net
Fixes: d949d1d14fa2 ("mm: shmem: fix data-race in shmem_getattr()")
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeongjun Park <aha310510@gmail.com>
Cc: Yu Zhao <yuzhao@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/shmem.c

index 0e1fbc53717df2d0d77d004cfef17f02b77eba80..f7c08e169e4230886ff20426a3eabdab40c0af91 100644 (file)
@@ -1086,9 +1086,7 @@ static int shmem_getattr(struct user_namespace *mnt_userns,
        stat->attributes_mask |= (STATX_ATTR_APPEND |
                        STATX_ATTR_IMMUTABLE |
                        STATX_ATTR_NODUMP);
-       inode_lock_shared(inode);
        generic_fillattr(&init_user_ns, inode, stat);
-       inode_unlock_shared(inode);
 
        if (shmem_is_huge(NULL, inode, 0, false))
                stat->blksize = HPAGE_PMD_SIZE;