linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext3: journal all modifications in ext3_xattr_set_handle
@ 2009-11-16 22:27 Eric Sandeen
  2009-11-19 14:44 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-11-16 22:27 UTC (permalink / raw)
  To: ext4 development; +Cc: Jan Kara

ext3_xattr_set_handle() was zeroing out an inode outside
of journaling constraints; this is one of the accesses that
was causing the crc errors in journal replay as seen in
kernel.org bugzilla #14354.

Although ext3 doesn't have the crc issue, modifications
out of journal control are a Bad Thing.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 545e37c..387d92d 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -960,6 +960,10 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
 	if (error)
 		goto cleanup;
 
+	error = ext3_journal_get_write_access(handle, is.iloc.bh);
+	if (error)
+		goto cleanup;
+
 	if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) {
 		struct ext3_inode *raw_inode = ext3_raw_inode(&is.iloc);
 		memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size);
@@ -985,9 +989,6 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
 		if (flags & XATTR_CREATE)
 			goto cleanup;
 	}
-	error = ext3_journal_get_write_access(handle, is.iloc.bh);
-	if (error)
-		goto cleanup;
 	if (!value) {
 		if (!is.s.not_found)
 			error = ext3_xattr_ibody_set(handle, inode, &i, &is);


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

* Re: [PATCH] ext3: journal all modifications in ext3_xattr_set_handle
  2009-11-16 22:27 [PATCH] ext3: journal all modifications in ext3_xattr_set_handle Eric Sandeen
@ 2009-11-19 14:44 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2009-11-19 14:44 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development, Jan Kara

On Mon 16-11-09 16:27:30, Eric Sandeen wrote:
> ext3_xattr_set_handle() was zeroing out an inode outside
> of journaling constraints; this is one of the accesses that
> was causing the crc errors in journal replay as seen in
> kernel.org bugzilla #14354.
> 
> Although ext3 doesn't have the crc issue, modifications
> out of journal control are a Bad Thing.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
  Thanks. Looks good. Queue up.

								Honza
> 
> diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
> index 545e37c..387d92d 100644
> --- a/fs/ext3/xattr.c
> +++ b/fs/ext3/xattr.c
> @@ -960,6 +960,10 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
> 	if (error)
> 		goto cleanup;
> 
> +	error = ext3_journal_get_write_access(handle, is.iloc.bh);
> +	if (error)
> +		goto cleanup;
> +
> 	if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) {
> 		struct ext3_inode *raw_inode = ext3_raw_inode(&is.iloc);
> 		memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size);
> @@ -985,9 +989,6 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
> 		if (flags & XATTR_CREATE)
> 			goto cleanup;
> 	}
> -	error = ext3_journal_get_write_access(handle, is.iloc.bh);
> -	if (error)
> -		goto cleanup;
> 	if (!value) {
> 		if (!is.s.not_found)
> 			error = ext3_xattr_ibody_set(handle, inode, &i, &is);
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

end of thread, other threads:[~2009-11-19 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-16 22:27 [PATCH] ext3: journal all modifications in ext3_xattr_set_handle Eric Sandeen
2009-11-19 14:44 ` Jan Kara

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).