public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guillaume Chazarain <guichaz@yahoo.fr>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] Handle error in sync_sb_inodes()
Date: Wed, 03 Jan 2007 23:30:05 +0100	[thread overview]
Message-ID: <459C2E6D.2040406@yahoo.fr> (raw)
In-Reply-To: <20070102132645.264d2b89.akpm@osdl.org>

Andrew Morton a écrit :
>> @@ -365,7 +366,8 @@ sync_sb_inodes(struct super_block *sb, s
>>  		BUG_ON(inode->i_state & I_FREEING);
>>  		__iget(inode);
>>  		pages_skipped = wbc->pages_skipped;
>> -		__writeback_single_inode(inode, wbc);
>> +		ret = __writeback_single_inode(inode, wbc);
>> +		mapping_set_error(mapping, ret);
>>  		if (wbc->sync_mode == WB_SYNC_HOLD) {
>>  			inode->dirtied_when = jiffies;
>>  			list_move(&inode->i_list, &sb->s_dirty);
>>     
> --- a/fs/buffer.c~a
> +++ a/fs/buffer.c
> @@ -1739,6 +1739,7 @@ recover:
>  		}
>  	} while ((bh = bh->b_this_page) != head);
>  	SetPageError(page);
> +	mapping_set_error(page->mapping, err);
>  	BUG_ON(PageWriteback(page));
>  	set_page_writeback(page);
>  	unlock_page(page);
>   


Unfortunately, with your patch and not mine, the problem is still 
present: msync()
does not return the error. Both pieces of code (yours and mine) are 
called for the
same mapping though, albeit yours more frequently.

My interpretation (based more on imagination than experience) is that
__writeback_single_inode() ends up calling __block_write_full_page() which
sets the page flags (your patch), then calls wait_on_page_writeback_range()
which clears the flags but returns the error as its return value. And this
error code is dropped by sync_sb_inodes() (my patch not applied).

With my patch, wait_on_page_writeback_range() would get the error code
by some other mean, and sync_sb_inodes() would re-put it in the flags for
msync() later.

Sorry, for the speculation, but I would need some hint to debug this ;-)

Thanks.

-- 
Guillaume


  reply	other threads:[~2007-01-03 22:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-29 21:53 [PATCH 2/2] Handle error in sync_sb_inodes() Guillaume Chazarain
2007-01-02 21:26 ` Andrew Morton
2007-01-03 22:30   ` Guillaume Chazarain [this message]
2007-01-03 22:56     ` Andrew Morton
2007-01-04 13:22       ` Guillaume Chazarain
2007-01-04 14:04       ` Guillaume Chazarain
2007-01-05 10:41         ` Guillaume Chazarain

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=459C2E6D.2040406@yahoo.fr \
    --to=guichaz@yahoo.fr \
    --cc=akpm@osdl.org \
    --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