* [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
@ 2013-10-15 13:32 Jan Kara
2013-10-15 13:32 ` [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent() Jan Kara
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Jan Kara @ 2013-10-15 13:32 UTC (permalink / raw)
To: Ted Tso; +Cc: linux-ext4, Jan Kara
It doesn't make sense to require io_end->handle when we are in nojournal
mode. So update the assertion accordingly to avoid false warnings from
ext4_add_complete_io().
Reported-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext4/page-io.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index d7d0c7b46ed4..d488f80ee32d 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -197,14 +197,15 @@ static void dump_completed_IO(struct inode *inode, struct list_head *head)
static void ext4_add_complete_io(ext4_io_end_t *io_end)
{
struct ext4_inode_info *ei = EXT4_I(io_end->inode);
+ struct ext4_sb_info *sbi = EXT4_SB(io_end->inode->i_sb);
struct workqueue_struct *wq;
unsigned long flags;
/* Only reserved conversions from writeback should enter here */
WARN_ON(!(io_end->flag & EXT4_IO_END_UNWRITTEN));
- WARN_ON(!io_end->handle);
+ WARN_ON(!io_end->handle && sbi->s_journal);
spin_lock_irqsave(&ei->i_completed_io_lock, flags);
- wq = EXT4_SB(io_end->inode->i_sb)->rsv_conversion_wq;
+ wq = sbi->rsv_conversion_wq;
if (list_empty(&ei->i_rsv_conversion_list))
queue_work(wq, &ei->i_rsv_conversion_work);
list_add_tail(&io_end->list, &ei->i_rsv_conversion_list);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent()
2013-10-15 13:32 [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Jan Kara
@ 2013-10-15 13:32 ` Jan Kara
2013-10-17 3:31 ` Theodore Ts'o
2013-10-15 15:37 ` [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Eric Whitney
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Jan Kara @ 2013-10-15 13:32 UTC (permalink / raw)
To: Ted Tso; +Cc: linux-ext4, Jan Kara
Document give_up_on_write argument of mpage_map_and_submit_extent().
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext4/inode.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index e274e9c1171f..e7e5b3d8f002 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2178,6 +2178,9 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
*
* @handle - handle for journal operations
* @mpd - extent to map
+ * @give_up_on_write - we set this to true iff there is a fatal error and there
+ * is no hope of writing the data. The caller should discard
+ * dirty pages to avoid infinite loops.
*
* The function maps extent starting at mpd->lblk of length mpd->len. If it is
* delayed, blocks are allocated, if it is unwritten, we may need to convert
--
1.8.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
2013-10-15 13:32 [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Jan Kara
2013-10-15 13:32 ` [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent() Jan Kara
@ 2013-10-15 15:37 ` Eric Whitney
2013-10-15 17:20 ` Lukáš Czerner
2013-10-17 3:31 ` Theodore Ts'o
3 siblings, 0 replies; 8+ messages in thread
From: Eric Whitney @ 2013-10-15 15:37 UTC (permalink / raw)
To: Jan Kara; +Cc: Ted Tso, linux-ext4
* Jan Kara <jack@suse.cz>:
> It doesn't make sense to require io_end->handle when we are in nojournal
> mode. So update the assertion accordingly to avoid false warnings from
> ext4_add_complete_io().
>
> Reported-by: Eric Whitney <enwlinux@gmail.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
> fs/ext4/page-io.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> index d7d0c7b46ed4..d488f80ee32d 100644
> --- a/fs/ext4/page-io.c
> +++ b/fs/ext4/page-io.c
> @@ -197,14 +197,15 @@ static void dump_completed_IO(struct inode *inode, struct list_head *head)
> static void ext4_add_complete_io(ext4_io_end_t *io_end)
> {
> struct ext4_inode_info *ei = EXT4_I(io_end->inode);
> + struct ext4_sb_info *sbi = EXT4_SB(io_end->inode->i_sb);
> struct workqueue_struct *wq;
> unsigned long flags;
>
> /* Only reserved conversions from writeback should enter here */
> WARN_ON(!(io_end->flag & EXT4_IO_END_UNWRITTEN));
> - WARN_ON(!io_end->handle);
> + WARN_ON(!io_end->handle && sbi->s_journal);
> spin_lock_irqsave(&ei->i_completed_io_lock, flags);
> - wq = EXT4_SB(io_end->inode->i_sb)->rsv_conversion_wq;
> + wq = sbi->rsv_conversion_wq;
> if (list_empty(&ei->i_rsv_conversion_list))
> queue_work(wq, &ei->i_rsv_conversion_work);
> list_add_tail(&io_end->list, &ei->i_rsv_conversion_list);
> --
> 1.8.1.4
>
> --
I've successfully tested this patch against 3.12-rc5 - it silences the
warning triggered by ext4/271 in xfstests-bld's dioread_nolock test config.
Thanks very much!
Eric
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
2013-10-15 13:32 [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Jan Kara
2013-10-15 13:32 ` [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent() Jan Kara
2013-10-15 15:37 ` [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Eric Whitney
@ 2013-10-15 17:20 ` Lukáš Czerner
2013-10-15 19:54 ` jon ernst
2013-10-17 3:31 ` Theodore Ts'o
3 siblings, 1 reply; 8+ messages in thread
From: Lukáš Czerner @ 2013-10-15 17:20 UTC (permalink / raw)
To: Jan Kara; +Cc: Ted Tso, linux-ext4
On Tue, 15 Oct 2013, Jan Kara wrote:
> Date: Tue, 15 Oct 2013 15:32:28 +0200
> From: Jan Kara <jack@suse.cz>
> To: Ted Tso <tytso@mit.edu>
> Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>
> Subject: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
>
> It doesn't make sense to require io_end->handle when we are in nojournal
> mode. So update the assertion accordingly to avoid false warnings from
> ext4_add_complete_io().
Looks good.
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
>
> Reported-by: Eric Whitney <enwlinux@gmail.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
> fs/ext4/page-io.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> index d7d0c7b46ed4..d488f80ee32d 100644
> --- a/fs/ext4/page-io.c
> +++ b/fs/ext4/page-io.c
> @@ -197,14 +197,15 @@ static void dump_completed_IO(struct inode *inode, struct list_head *head)
> static void ext4_add_complete_io(ext4_io_end_t *io_end)
> {
> struct ext4_inode_info *ei = EXT4_I(io_end->inode);
> + struct ext4_sb_info *sbi = EXT4_SB(io_end->inode->i_sb);
> struct workqueue_struct *wq;
> unsigned long flags;
>
> /* Only reserved conversions from writeback should enter here */
> WARN_ON(!(io_end->flag & EXT4_IO_END_UNWRITTEN));
> - WARN_ON(!io_end->handle);
> + WARN_ON(!io_end->handle && sbi->s_journal);
> spin_lock_irqsave(&ei->i_completed_io_lock, flags);
> - wq = EXT4_SB(io_end->inode->i_sb)->rsv_conversion_wq;
> + wq = sbi->rsv_conversion_wq;
> if (list_empty(&ei->i_rsv_conversion_list))
> queue_work(wq, &ei->i_rsv_conversion_work);
> list_add_tail(&io_end->list, &ei->i_rsv_conversion_list);
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
2013-10-15 17:20 ` Lukáš Czerner
@ 2013-10-15 19:54 ` jon ernst
2013-10-16 12:01 ` Jan Kara
0 siblings, 1 reply; 8+ messages in thread
From: jon ernst @ 2013-10-15 19:54 UTC (permalink / raw)
To: Lukáš Czerner
Cc: Jan Kara, Ted Tso, linux-ext4@vger.kernel.org List
On Tue, Oct 15, 2013 at 1:20 PM, Lukáš Czerner <lczerner@redhat.com> wrote:
> On Tue, 15 Oct 2013, Jan Kara wrote:
>
>> Date: Tue, 15 Oct 2013 15:32:28 +0200
>> From: Jan Kara <jack@suse.cz>
>> To: Ted Tso <tytso@mit.edu>
>> Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>
>> Subject: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
>>
>> It doesn't make sense to require io_end->handle when we are in nojournal
>> mode. So update the assertion accordingly to avoid false warnings from
>> ext4_add_complete_io().
>
> Looks good.
>
> Reviewed-by: Lukas Czerner <lczerner@redhat.com>
>
>>
>> Reported-by: Eric Whitney <enwlinux@gmail.com>
>> Signed-off-by: Jan Kara <jack@suse.cz>
>> ---
>> fs/ext4/page-io.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
>> index d7d0c7b46ed4..d488f80ee32d 100644
>> --- a/fs/ext4/page-io.c
>> +++ b/fs/ext4/page-io.c
>> @@ -197,14 +197,15 @@ static void dump_completed_IO(struct inode *inode, struct list_head *head)
>> static void ext4_add_complete_io(ext4_io_end_t *io_end)
>> {
>> struct ext4_inode_info *ei = EXT4_I(io_end->inode);
>> + struct ext4_sb_info *sbi = EXT4_SB(io_end->inode->i_sb);
>> struct workqueue_struct *wq;
>> unsigned long flags;
>>
>> /* Only reserved conversions from writeback should enter here */
>> WARN_ON(!(io_end->flag & EXT4_IO_END_UNWRITTEN));
>> - WARN_ON(!io_end->handle);
>> + WARN_ON(!io_end->handle && sbi->s_journal);
swap 2 conditions would be better in my opinion. (for no-journal
case, it will be short-circuited. For journal case, no harm, no
difference.)
i know this is too picky. :)
>> spin_lock_irqsave(&ei->i_completed_io_lock, flags);
>> - wq = EXT4_SB(io_end->inode->i_sb)->rsv_conversion_wq;
>> + wq = sbi->rsv_conversion_wq;
>> if (list_empty(&ei->i_rsv_conversion_list))
>> queue_work(wq, &ei->i_rsv_conversion_work);
>> list_add_tail(&io_end->list, &ei->i_rsv_conversion_list);
>>
> --
> 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
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
2013-10-15 19:54 ` jon ernst
@ 2013-10-16 12:01 ` Jan Kara
0 siblings, 0 replies; 8+ messages in thread
From: Jan Kara @ 2013-10-16 12:01 UTC (permalink / raw)
To: jon ernst
Cc: Lukáš Czerner, Jan Kara, Ted Tso,
linux-ext4@vger.kernel.org List
On Tue 15-10-13 15:54:18, jon ernst wrote:
> On Tue, Oct 15, 2013 at 1:20 PM, Lukáš Czerner <lczerner@redhat.com> wrote:
> > On Tue, 15 Oct 2013, Jan Kara wrote:
> >
> >> Date: Tue, 15 Oct 2013 15:32:28 +0200
> >> From: Jan Kara <jack@suse.cz>
> >> To: Ted Tso <tytso@mit.edu>
> >> Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>
> >> Subject: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
> >>
> >> It doesn't make sense to require io_end->handle when we are in nojournal
> >> mode. So update the assertion accordingly to avoid false warnings from
> >> ext4_add_complete_io().
> >
> > Looks good.
> >
> > Reviewed-by: Lukas Czerner <lczerner@redhat.com>
> >
> >>
> >> Reported-by: Eric Whitney <enwlinux@gmail.com>
> >> Signed-off-by: Jan Kara <jack@suse.cz>
> >> ---
> >> fs/ext4/page-io.c | 5 +++--
> >> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
> >> index d7d0c7b46ed4..d488f80ee32d 100644
> >> --- a/fs/ext4/page-io.c
> >> +++ b/fs/ext4/page-io.c
> >> @@ -197,14 +197,15 @@ static void dump_completed_IO(struct inode *inode, struct list_head *head)
> >> static void ext4_add_complete_io(ext4_io_end_t *io_end)
> >> {
> >> struct ext4_inode_info *ei = EXT4_I(io_end->inode);
> >> + struct ext4_sb_info *sbi = EXT4_SB(io_end->inode->i_sb);
> >> struct workqueue_struct *wq;
> >> unsigned long flags;
> >>
> >> /* Only reserved conversions from writeback should enter here */
> >> WARN_ON(!(io_end->flag & EXT4_IO_END_UNWRITTEN));
> >> - WARN_ON(!io_end->handle);
> >> + WARN_ON(!io_end->handle && sbi->s_journal);
>
> swap 2 conditions would be better in my opinion. (for no-journal
> case, it will be short-circuited. For journal case, no harm, no
> difference.)
> i know this is too picky. :)
OTOH you will check sbi->s_journal unnecessarily for the more common
case when the journal is enabled. But I don't care tham much really.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io()
2013-10-15 13:32 [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Jan Kara
` (2 preceding siblings ...)
2013-10-15 17:20 ` Lukáš Czerner
@ 2013-10-17 3:31 ` Theodore Ts'o
3 siblings, 0 replies; 8+ messages in thread
From: Theodore Ts'o @ 2013-10-17 3:31 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-ext4
On Tue, Oct 15, 2013 at 03:32:28PM +0200, Jan Kara wrote:
> It doesn't make sense to require io_end->handle when we are in nojournal
> mode. So update the assertion accordingly to avoid false warnings from
> ext4_add_complete_io().
>
> Reported-by: Eric Whitney <enwlinux@gmail.com>
> Signed-off-by: Jan Kara <jack@suse.cz>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent()
2013-10-15 13:32 ` [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent() Jan Kara
@ 2013-10-17 3:31 ` Theodore Ts'o
0 siblings, 0 replies; 8+ messages in thread
From: Theodore Ts'o @ 2013-10-17 3:31 UTC (permalink / raw)
To: Jan Kara; +Cc: linux-ext4
On Tue, Oct 15, 2013 at 03:32:29PM +0200, Jan Kara wrote:
> Document give_up_on_write argument of mpage_map_and_submit_extent().
>
> Signed-off-by: Jan Kara <jack@suse.cz>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-17 3:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-15 13:32 [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Jan Kara
2013-10-15 13:32 ` [PATCH 2/2] ext4: Fixup kerndoc annotation of mpage_map_and_submit_extent() Jan Kara
2013-10-17 3:31 ` Theodore Ts'o
2013-10-15 15:37 ` [PATCH 1/2] ext4: Fix assertion in ext4_add_complete_io() Eric Whitney
2013-10-15 17:20 ` Lukáš Czerner
2013-10-15 19:54 ` jon ernst
2013-10-16 12:01 ` Jan Kara
2013-10-17 3:31 ` Theodore Ts'o
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).