public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: fengyubo <fengyubo3@huawei.com>, <fangwei1@huawei.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes
Date: Tue, 30 Jun 2020 19:59:14 +0900	[thread overview]
Message-ID: <87k0zoom4d.fsf@mail.parknet.co.jp> (raw)
In-Reply-To: <1593308053-12702-1-git-send-email-fengyubo3@huawei.com> (fengyubo's message of "Sun, 28 Jun 2020 09:34:13 +0800")

fengyubo <fengyubo3@huawei.com> writes:

> From: Yubo Feng <fengyubo3@huawei.com>
>
> There is no necessery 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>

Looks good.

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

> ---
>  fs/fat/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fat/file.c b/fs/fat/file.c
> index 42134c5..f9ee27c 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);
>  }

-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

      reply	other threads:[~2020-06-30 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28  1:34 [PATCH] fatfs: switch write_lock to read_lock in fat_ioctl_get_attributes fengyubo
2020-06-30 10:59 ` OGAWA Hirofumi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0zoom4d.fsf@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=fangwei1@huawei.com \
    --cc=fengyubo3@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox