2009-09-17 21:55:35

by Curt Wohlgemuth

[permalink] [raw]
Subject: [PATCH 1/2] ext4: clean up ext4_dirty_inode()

This patch cleans up ext4_dirty_inode(); it's attempt to detect non-matching
transactions can never be executed.

Signed-off-by: Curt Wohlgemuth <[email protected]>
---

If 'current_handle' is non-NULL, then ext4_start_journal() will return the
same handle with it's h_ref count incremented, and the h_transaction
pointers will be the same.

diff -uprN orig/fs/ext4/inode.c new/fs/ext4/inode.c
--- orig/fs/ext4/inode.c 2009-09-17 13:59:48.000000000 -0700
+++ new/fs/ext4/inode.c 2009-09-17 14:14:43.000000000 -0700
@@ -5379,24 +5379,13 @@ void ext4_dirty_inode(struct inode *inod
handle_t *current_handle = ext4_journal_current_handle();
handle_t *handle;

- if (!ext4_handle_valid(current_handle)) {
- ext4_mark_inode_dirty(current_handle, inode);
- return;
- }


2009-09-23 14:37:07

by Curt Wohlgemuth

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext4: clean up ext4_dirty_inode()

Ted, any comment on this patch?

Thanks,
Curt

On Thu, Sep 17, 2009 at 2:55 PM, Curt Wohlgemuth <[email protected]> wrote:
> This patch cleans up ext4_dirty_inode(); it's attempt to detect non-matching
> transactions can never be executed.
>
> ? ? ? ?Signed-off-by: Curt Wohlgemuth <[email protected]>
> ---
>
> If 'current_handle' is non-NULL, then ext4_start_journal() will return the
> same handle with it's h_ref count incremented, and the h_transaction
> pointers will be the same.
>
> diff -uprN orig/fs/ext4/inode.c new/fs/ext4/inode.c
> --- orig/fs/ext4/inode.c ? ? ? ?2009-09-17 13:59:48.000000000 -0700
> +++ new/fs/ext4/inode.c 2009-09-17 14:14:43.000000000 -0700
> @@ -5379,24 +5379,13 @@ void ext4_dirty_inode(struct inode *inod
> ? ? ? ?handle_t *current_handle = ext4_journal_current_handle();
> ? ? ? ?handle_t *handle;
>
> - ? ? ? if (!ext4_handle_valid(current_handle)) {
> - ? ? ? ? ? ? ? ext4_mark_inode_dirty(current_handle, inode);
> - ? ? ? ? ? ? ? return;
> - ? ? ? }
> -
> ? ? ? ?handle = ext4_journal_start(inode, 2);
> ? ? ? ?if (IS_ERR(handle))
> ? ? ? ? ? ? ? ?goto out;
> - ? ? ? if (current_handle &&
> - ? ? ? ? ? ? ? current_handle->h_transaction != handle->h_transaction) {
> - ? ? ? ? ? ? ? /* This task has a transaction open against a different fs */
> - ? ? ? ? ? ? ? printk(KERN_EMERG "%s: transactions do not match!\n",
> - ? ? ? ? ? ? ? ? ? ? ?__func__);
> - ? ? ? } else {
> - ? ? ? ? ? ? ? jbd_debug(5, "marking dirty. ?outer handle=%p\n",
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? current_handle);
> - ? ? ? ? ? ? ? ext4_mark_inode_dirty(handle, inode);
> - ? ? ? }
> +
> + ? ? ? jbd_debug(5, "marking dirty. ?outer handle=%p\n", current_handle);
> + ? ? ? ext4_mark_inode_dirty(handle, inode);
> +
> ? ? ? ?ext4_journal_stop(handle);
> ?out:
> ? ? ? ?return;
>

2009-09-23 15:32:17

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext4: clean up ext4_dirty_inode()

On Wed, Sep 23, 2009 at 07:37:06AM -0700, Curt Wohlgemuth wrote:
> Ted, any comment on this patch?

Sorry, at LinuxCon/Plumber's conference this week. I'll try to look
at pending patches before the the merge window closes (and Linus has
alrady said he'll probably push rc1 to next Monday or Tuesday).

- Ted

2009-10-01 05:22:53

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH 1/2] ext4: clean up ext4_dirty_inode()

On Wed, Sep 23, 2009 at 07:37:06AM -0700, Curt Wohlgemuth wrote:
> Ted, any comment on this patch?

Forgot to send you a confirmation, but thanks I've accepted the three
related non-journal patches and they've already been pushed to Linus.
One of them needed to be slightly adjusted to apply with the rest, but
they're all in mainline, as commit ID's d3d1faf, f3dc272, and
830156c/91ac6f4.

- Ted