summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYubo Feng <fengyubo3@huawei.com>2020-08-12 04:35:56 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-12 20:58:01 +0300
commite348e65a081d761caf72c2753c4e3d67bfb1ef80 (patch)
tree6797905ce27f7fa95c92d55a5e3f6d6f064af384
parent88b2e9b06381551b707d980627ad0591191f7a2d (diff)
downloadlinux-e348e65a081d761caf72c2753c4e3d67bfb1ef80.tar.xz
fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes
There is no need to hold write_lock in fat_ioctl_get_attributes. write_lock may make an impact on concurrency of fat_ioctl_get_attributes. Signed-off-by: Yubo Feng <fengyubo3@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Link: http://lkml.kernel.org/r/1593308053-12702-1-git-send-email-fengyubo3@huawei.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/fat/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 42134c58c87e..f9ee27cf4d7c 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -25,9 +25,9 @@ static int fat_ioctl_get_attributes(struct inode *inode, u32 __user *user_attr)
{
u32 attr;
- inode_lock(inode);
+ inode_lock_shared(inode);
attr = fat_make_attrs(inode);
- inode_unlock(inode);
+ inode_unlock_shared(inode);
return put_user(attr, user_attr);
}