From: Yongqiang Yang <xiaoqiangnk@gmail.com>
To: Aditya Kali <adityakali@google.com>
Cc: Jan Kara <jack@suse.cz>, "Ted Ts'o" <tytso@mit.edu>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: attempt to fix race in bigalloc code path
Date: Tue, 23 Aug 2011 09:12:10 +0800 [thread overview]
Message-ID: <CAGBYx2YD5gC6--DqL9XR5ZVDynybA8jmBy9v0YXQGfCH1AeAkw@mail.gmail.com> (raw)
In-Reply-To: <CAGr1F2EG32dkeo+6DU4caQdJtFBLN7kpF9a4Gj_vr+awdGZ6jw@mail.gmail.com>
On Tue, Aug 23, 2011 at 1:30 AM, Aditya Kali <adityakali@google.com> wrote:
> On Mon, Aug 22, 2011 at 6:54 AM, Yongqiang Yang <xiaoqiangnk@gmail.com> wrote:
>> Hi,
>>
>> I can not find the patch - attempt to fix race in bigalloc code path -
>> in the mailing list.
>>
>> I don't think this patch can work. set_buffers_da_mapped() is called
>> under i_data_sem, so it can not lock page. If the page is not locked,
>> calling page_has_buffers() is not secure as Jan pointed out
>> previously. If a page is partially mapped(block size < page size),
>> setting BH_Da_Mapped without locking page is not safe too.
>>
> The BH_Da_Mapped is set only during page writeback when the page is
> locked (in write_cache_pages_da). So, the setting of BH_Da_Mapped
> should be safe, no ?
Sorry for noise and thank you for your explanation, you are right.
IMHO, we can clear BH_Delayed and set BH_Mapped instead.
Yongqiang.
>
>> BTW: find_delalloc_range() does not lock page as ext4_fiemap_cb().
>> As Jan said, it can crash system. BUT we can not lock page in both
>> scenarios, because i_data_sem is hold. So delayed extent list is
>> necessary. I have finished the code implementing delayed extent list,
>> which needs some further testing.
>>
>>
>> What are your opinions?
>>
> I agree that having a delayed extent list will greatly simply this
> solution in this case.
>
>>
>> --
>> Best Wishes
>> Yongqiang Yang
>>
>
--
Best Wishes
Yongqiang Yang
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2011-08-23 1:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 13:54 attempt to fix race in bigalloc code path Yongqiang Yang
2011-08-22 17:30 ` Aditya Kali
2011-08-23 1:12 ` Yongqiang Yang [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=CAGBYx2YD5gC6--DqL9XR5ZVDynybA8jmBy9v0YXQGfCH1AeAkw@mail.gmail.com \
--to=xiaoqiangnk@gmail.com \
--cc=adityakali@google.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).