public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BUG][reiserfs] page fault during kernel boot
@ 2010-08-17  8:25 Marin Mitov
  2010-08-17 22:20 ` Frederic Weisbecker
  2010-08-17 22:30 ` Frederic Weisbecker
  0 siblings, 2 replies; 3+ messages in thread
From: Marin Mitov @ 2010-08-17  8:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Al Viro

Hi all,

The function: reiserfs_evict_inode() ends with:

<snip>
out:
	end_writeback(inode);	/* note this must go after the journal_end to prevent deadlock */
	dquot_drop(inode);
	inode->i_blocks = 0;
	reiserfs_write_unlock_once(inode->i_sb, depth);

no_delete:
	end_writeback(inode);
	dquot_drop(inode);
}
<snip>

When goto out path is taken,

end_writeback(inode);
dquot_drop(inode);

are executed twice, leading to page fault (in my case) during the kernel boot.

Add return; before no_delete label (but I am not quite sure that this is correct :-).

Signed-off-by: Marin Mitov <mitov@issp.bas.bg>

====================================================================
--- a/fs/reiserfs/inode.c	2010-08-17 09:51:27.000000000 +0300
+++ b/fs/reiserfs/inode.c	2010-08-17 10:45:20.000000000 +0300
@@ -78,11 +78,12 @@ void reiserfs_evict_inode(struct inode *
 		/* no object items are in the tree */
 		;
 	}
-      out:
+out:
 	end_writeback(inode);	/* note this must go after the journal_end to prevent deadlock */
 	dquot_drop(inode);
 	inode->i_blocks = 0;
 	reiserfs_write_unlock_once(inode->i_sb, depth);
+	return;
 
 no_delete:
 	end_writeback(inode);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG][reiserfs] page fault during kernel boot
  2010-08-17  8:25 [BUG][reiserfs] page fault during kernel boot Marin Mitov
@ 2010-08-17 22:20 ` Frederic Weisbecker
  2010-08-17 22:30 ` Frederic Weisbecker
  1 sibling, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2010-08-17 22:20 UTC (permalink / raw)
  To: Marin Mitov; +Cc: linux-kernel, Al Viro

On Tue, Aug 17, 2010 at 11:25:25AM +0300, Marin Mitov wrote:
> Hi all,
> 
> The function: reiserfs_evict_inode() ends with:
> 
> <snip>
> out:
> 	end_writeback(inode);	/* note this must go after the journal_end to prevent deadlock */
> 	dquot_drop(inode);
> 	inode->i_blocks = 0;
> 	reiserfs_write_unlock_once(inode->i_sb, depth);
> 
> no_delete:
> 	end_writeback(inode);
> 	dquot_drop(inode);
> }
> <snip>
> 
> When goto out path is taken,
> 
> end_writeback(inode);
> dquot_drop(inode);
> 
> are executed twice, leading to page fault (in my case) during the kernel boot.


Indeed. More precisely it triggers a BUG in end_writeback():

	BUG_ON(inode->i_state & I_CLEAR);

that because we call it twice.

 
> Add return; before no_delete label (but I am not quite sure that this is correct :-).



That looks correct. 

Also Andrew Benton reported this issue and tested almost
the same patch and it seemed to solve the issue.

Thanks.



> Signed-off-by: Marin Mitov <mitov@issp.bas.bg>
> 
> ====================================================================
> --- a/fs/reiserfs/inode.c	2010-08-17 09:51:27.000000000 +0300
> +++ b/fs/reiserfs/inode.c	2010-08-17 10:45:20.000000000 +0300
> @@ -78,11 +78,12 @@ void reiserfs_evict_inode(struct inode *
>  		/* no object items are in the tree */
>  		;
>  	}
> -      out:
> +out:
>  	end_writeback(inode);	/* note this must go after the journal_end to prevent deadlock */
>  	dquot_drop(inode);
>  	inode->i_blocks = 0;
>  	reiserfs_write_unlock_once(inode->i_sb, depth);
> +	return;
>  
>  no_delete:
>  	end_writeback(inode);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG][reiserfs] page fault during kernel boot
  2010-08-17  8:25 [BUG][reiserfs] page fault during kernel boot Marin Mitov
  2010-08-17 22:20 ` Frederic Weisbecker
@ 2010-08-17 22:30 ` Frederic Weisbecker
  1 sibling, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2010-08-17 22:30 UTC (permalink / raw)
  To: Marin Mitov; +Cc: linux-kernel, Al Viro, Andrew Benton

On Tue, Aug 17, 2010 at 11:25:25AM +0300, Marin Mitov wrote:
> Hi all,
> 
> The function: reiserfs_evict_inode() ends with:
> 
> <snip>
> out:
> 	end_writeback(inode);	/* note this must go after the journal_end to prevent deadlock */
> 	dquot_drop(inode);
> 	inode->i_blocks = 0;
> 	reiserfs_write_unlock_once(inode->i_sb, depth);
> 
> no_delete:
> 	end_writeback(inode);
> 	dquot_drop(inode);
> }
> <snip>
> 
> When goto out path is taken,
> 
> end_writeback(inode);
> dquot_drop(inode);
> 
> are executed twice, leading to page fault (in my case) during the kernel boot.
> 
> Add return; before no_delete label (but I am not quite sure that this is correct :-).
> 
> Signed-off-by: Marin Mitov <mitov@issp.bas.bg>


In fact the sam patch has been submitted and applied to the vfs tree already:

http://lkml.org/lkml/2010/8/11/98

The patch will probably reach mainline soon.

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-17 22:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-17  8:25 [BUG][reiserfs] page fault during kernel boot Marin Mitov
2010-08-17 22:20 ` Frederic Weisbecker
2010-08-17 22:30 ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox