public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@sw.ru>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Alex Tomas <alex@clusterfs.com>, linux-ext4@vger.kernel.org
Subject: Re: delayed allocatiou result in Oops
Date: Thu, 21 Jun 2007 08:50:58 +0400	[thread overview]
Message-ID: <20070621045058.GG20172@localhost.sw.ru> (raw)
In-Reply-To: <1182383170.22978.11.camel@localhost.localdomain>

On 16:46 Срд 20 Июн     , Mingming Cao wrote:
> On Wed, 2007-06-20 at 12:15 +0400, Alex Tomas wrote:
> > Mingming Cao wrote:
> > > Hmm, PageMappedToDisk is probably not sufficient enough for pagesize!
> > > =blocksize. Is that the reason we need page->private to pass the
> > > request?
> > 
> > PageMappedToDisk isn't enough in that case, definitely. bh is the way
> > to track state of each block (this is what i'm implementing now), but
> > I think current nobh version (per-page flags are used) is valuable.
> > 
> > > That's good to know, thanks for the update. So probably above error case
> > > handling will be addressed in the new version? 
> > 
> > well, you actually can move that SetPagePrivate() few lines above
> > (Dmitriy already tested this).
> 
> Like this?
Of course not, we may set page private bit only if 
space was successfully reserved by ext4_wb_reserve_space_page().
So patch looks like this:
diff --git a/fs/ext4/writeback.c b/fs/ext4/writeback.c
index 3e669d6..84e5029 100644
--- a/fs/ext4/writeback.c
+++ b/fs/ext4/writeback.c
@@ -904,9 +904,6 @@ int ext4_wb_commit_write(struct file *file, struct page *page,
 	wb_debug("commit page %lu (%u-%u) for inode %lu\n",
 			page->index, from, to, inode->i_ino);
 
-	/* mark page private so that we get
-	 * called to invalidate/release page */
-	SetPagePrivate(page);
 
 	if (!PageBooked(page) && !PageMappedToDisk(page)) {
 		/* ->prepare_write() observed that block for this
@@ -918,6 +915,9 @@ int ext4_wb_commit_write(struct file *file, struct page *page,
 		if (err)
 			return err;
 	}
+	/* mark page private so that we get
+	 * called to invalidate/release page */
+	SetPagePrivate(page);
 
 	/* ok. block for this page is allocated already or it has
 	 * been reserved succesfully. so, user may use it */
-- 
1.5.2
> 
> Index: linux-2.6.22-rc5/fs/ext4/writeback.c
> ===================================================================
> --- linux-2.6.22-rc5.orig/fs/ext4/writeback.c	2007-06-20 16:41:26.000000000 -0700
> +++ linux-2.6.22-rc5/fs/ext4/writeback.c	2007-06-20 16:44:10.000000000 -0700
> @@ -918,16 +918,16 @@ int ext4_wb_commit_write(struct file *fi
>  	wb_debug("commit page %lu (%u-%u) for inode %lu\n",
>  			page->index, from, to, inode->i_ino);
>  
> -	/* mark page private so that we get
> -	 * called to invalidate/release page */
> -	SetPagePrivate(page);
> -
>  	if (!PageBooked(page) && !PageMappedToDisk(page)) {
>  		/* ->prepare_write() observed that block for this
>  		 * page hasn't been allocated yet. there fore it
>  		 * asked to reserve block for later allocation */
>  		BUG_ON(page->private == 0);
>  		page->private = 0;
> +		/* mark page private so that we get
> +		 * called to invalidate/release page */
> +		SetPagePrivate(page);
> +
>  		err = ext4_wb_reserve_space_page(page, 1);
>  		if (err)
>  			return err;
> 
> 
> -
> 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

      reply	other threads:[~2007-06-21  4:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14  7:23 delayed allocatiou result in Oops Dmitriy Monakhov
2007-06-15  5:14 ` Alex Tomas
2007-06-15 23:16   ` Mingming Cao
2007-06-16  8:02     ` [PATCH] ext4:fix invariant checking in ext4_rebalance_reservation Dmitriy Monakhov
2007-06-18 21:09       ` Mingming Cao
2007-06-19  5:56       ` Dmitry Monakhov
2007-06-16  8:14     ` delayed allocatiou result in Oops Dmitriy Monakhov
2007-06-19  1:01       ` Mingming Cao
2007-06-19  7:11         ` Alex Tomas
2007-06-19  9:16           ` Dmitry Monakhov
2007-06-19  9:36             ` Alex Tomas
2007-06-19 21:50             ` Andreas Dilger
2007-06-19 16:23           ` Mingming Cao
2007-06-19 16:47             ` Aneesh Kumar K.V
2007-06-20  8:15             ` Alex Tomas
2007-06-20 23:46               ` Mingming Cao
2007-06-21  4:50                 ` Dmitry Monakhov [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=20070621045058.GG20172@localhost.sw.ru \
    --to=dmonakhov@sw.ru \
    --cc=alex@clusterfs.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@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