From: Maxim Patlasov <mpatlasov@parallels.com>
To: Anand Avati <avati@redhat.com>
Cc: <miklos@szeredi.hu>, <fuse-devel@lists.sourceforge.net>,
<bfoster@redhat.com>, <linux-kernel@vger.kernel.org>,
<devel@openvz.org>
Subject: Re: [PATCH] fuse: hold i_mutex in fuse_file_fallocate()
Date: Thu, 13 Jun 2013 11:15:44 +0400 [thread overview]
Message-ID: <51B971A0.8050406@parallels.com> (raw)
In-Reply-To: <51B8C639.7060500@redhat.com>
Anand, Brian,
06/12/2013 11:04 PM, Anand Avati пишет:
> On 6/11/13 3:59 AM, Maxim Patlasov wrote:
>
>> - if (mode & FALLOC_FL_PUNCH_HOLE) {
>> + if (lock_inode)
>> mutex_lock(&inode->i_mutex);
>
>> + if (mode & FALLOC_FL_PUNCH_HOLE)
>> fuse_set_nowrite(inode);
>> - }
>
> Just for clarity, can you make the condition to check
> FALLOC_FL_PUNCH_HOLE and call to fuse_set_nowrite() nested within the
> larger if (lock_inode) { .. } block? fuse_set_nowrite() should not be
> called without i_mutex acquired. The current style of calling
> mutex_lock() and fuse_set_nowrite() in separate conditions can
> potentially cause bugs in the future if they were to get re-ordered
> due to some unrelated patch. Nesting them makes the relation more
> explicit and clear.
Thanks a lot for review. I'll post updated patch soon.
Thanks,
Maxim
prev parent reply other threads:[~2013-06-13 7:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-11 10:59 [PATCH] fuse: hold i_mutex in fuse_file_fallocate() Maxim Patlasov
2013-06-12 11:40 ` Brian Foster
2013-06-12 18:56 ` Anand Avati
2013-06-12 19:04 ` Anand Avati
2013-06-13 7:15 ` Maxim Patlasov [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=51B971A0.8050406@parallels.com \
--to=mpatlasov@parallels.com \
--cc=avati@redhat.com \
--cc=bfoster@redhat.com \
--cc=devel@openvz.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.