Skip to content

Commit

Permalink
fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: OGAWA Hirofumi <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Yubo Feng authored and torvalds committed Aug 12, 2020
1 parent 88b2e9b commit e348e65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e348e65

Please sign in to comment.