linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, Matthew Wilcox <willy@infradead.org>,
	linux-fsdevel@vger.kernel.org,
	Ojaswin Mujoo <ojaswin@linux.ibm.com>,
	Disha Goel <disgoel@linux.ibm.com>, Jan Kara <jack@suse.cz>
Subject: Re: [RFCv2 2/5] ext4: Remove PAGE_SIZE assumption of folio from mpage_submit_folio
Date: Mon, 12 Jun 2023 22:55:37 +0530	[thread overview]
Message-ID: <87wn08pp7y.fsf@doe.com> (raw)
In-Reply-To: <87a5x6hy8l.fsf@doe.com>

Ritesh Harjani (IBM) <ritesh.list@gmail.com> writes:

> Please ignore the previous email.
>
> "Theodore Ts'o" <tytso@mit.edu> writes:
>
>> On Mon, May 15, 2023 at 04:10:41PM +0530, Ritesh Harjani (IBM) wrote:
>>> mpage_submit_folio() was converted to take folio. Even though
>>> folio_size() in ext4 as of now is PAGE_SIZE, but it's better to
>>> remove that assumption which I am assuming is a missed left over from
>>> patch[1].
>>>
>>> [1]: https://lore.kernel.org/linux-ext4/20230324180129.1220691-7-willy@infradead.org/
>>>
>>> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
>>
>> I didn't notice this right away, because the failure is not 100%
>> reliable, but this commit will sometimes cause "kvm-xfstests -c
>> ext4/encrypt generic/068" to crash.  Reverting the patch fixes the
>> problem, so I plan to drop this patch from my tree.
>>
>
> Sorry about the crash. I am now able to reproduce the problem on my
> setup as well. I will debug this and will update once I have some more info.
>
> From the initial look, it looks like the problem might be occurring when
> folio_pos(folio) itself is > i_size_read(inode).
>
> If that is indeed the case, then I think even doing this with folio
> conversion (below code after folio conversion) looks incorrect for case
> when size is not PAGE_SIZE aligned.
>
> However, I will spend some more time debugging this.

I am still looking into this. I would like to make sure I go through
all the paths where i_size can be modified.
- buffered-IO
- writeback
- direct-IO
- page fault
- truncate
- fallocate (punch/collapse)
- evict (not relevant though)

It is easily recreatable if we have one thread doing buffered-io +
sync and other thread trying to truncate down inode->i_size.
Kernel panic maybe is happening only with -O encrypt mkfs option +
-o test_dummy_encryption mount option, but the size - folio_pos(folio)
is definitely wrong because inode->i_size is not protected in writeback path.

More on this later...

-ritesh

  reply	other threads:[~2023-06-12 17:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15 10:40 [RFCv2 0/5] ext4: misc left over folio changes Ritesh Harjani (IBM)
2023-05-15 10:40 ` [RFCv2 1/5] ext4: kill unused function ext4_journalled_write_inline_data Ritesh Harjani (IBM)
2023-05-15 10:40 ` [RFCv2 2/5] ext4: Remove PAGE_SIZE assumption of folio from mpage_submit_folio Ritesh Harjani (IBM)
2023-05-16 19:14   ` Matthew Wilcox
2023-06-11  5:58   ` Theodore Ts'o
2023-06-11 14:15     ` Matthew Wilcox
2023-06-11 14:25     ` Ritesh Harjani
2023-06-12 17:25       ` Ritesh Harjani [this message]
2023-06-12 17:43         ` Matthew Wilcox
2023-06-12 18:25           ` Ritesh Harjani
2023-06-12 19:16             ` Matthew Wilcox
2023-06-13  3:57               ` Ritesh Harjani
2023-06-13  9:59                 ` Jan Kara
2023-06-13 19:39                   ` Ritesh Harjani
2023-06-13 19:45                     ` Matthew Wilcox
2023-06-13 20:43                       ` Ritesh Harjani
2023-05-15 10:40 ` [RFCv2 3/5] ext4: Change remaining tracepoints to use folio Ritesh Harjani (IBM)
2023-05-15 10:40 ` [RFCv2 4/5] ext4: Make mpage_journal_page_buffers " Ritesh Harjani (IBM)
2023-05-16 19:16   ` Matthew Wilcox
2023-05-15 10:40 ` [RFCv2 5/5] ext4: Make ext4_write_inline_data_end() " Ritesh Harjani (IBM)
2023-05-16 19:27 ` [PATCH 6/5] ext4: Call fsverity_verify_folio() Matthew Wilcox (Oracle)
2023-05-17  6:45   ` Ritesh Harjani
2023-05-20  1:06   ` Eric Biggers
2023-06-09  3:14 ` [RFCv2 0/5] ext4: misc left over folio changes Theodore Ts'o

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=87wn08pp7y.fsf@doe.com \
    --to=ritesh.list@gmail.com \
    --cc=disgoel@linux.ibm.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ojaswin@linux.ibm.com \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).