linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Kazuya Mio <k-mio@sx.jp.nec.com>
Cc: ext4 <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>,
	Andreas Dilger <adilger@dilger.ca>
Subject: Re: [PATCH 2/2] ext3: Don't update ctime in ext3_splice_branch()
Date: Mon, 30 Jan 2012 18:52:17 +0100	[thread overview]
Message-ID: <20120130175217.GA7827@quack.suse.cz> (raw)
In-Reply-To: <4F2657BD.8030208@sx.jp.nec.com>

On Mon 30-01-12 17:41:33, Kazuya Mio wrote:
> VFS handles updating ctime, so we don't need to update i_ctime
> in ext3_splace_branch().
  Thanks for the patches.  This is true for ordinary writes but not true
when you write via mmap. We call file_update_time() during page fault so
ctime won't be completely wrong but still we should update it after block
is allocated during writeback to reflect that new block is allocated to
the inode.

								Honza

> I backport the following patch for ext3:
> http://marc.info/?l=linux-ext4&m=124505184027078&w=4
> 
> Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
> ---
>  fs/ext3/inode.c |    6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index 2d0afec..95cb0d1 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -795,10 +795,6 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
>  	}
>  
>  	/* We are done with atomic stuff, now do the rest of housekeeping */
> -
> -	inode->i_ctime = CURRENT_TIME_SEC;
> -	ext3_mark_inode_dirty(handle, inode);
> -	/* ext3_mark_inode_dirty already updated i_sync_tid */
>  	atomic_set(&ei->i_datasync_tid, handle->h_transaction->t_tid);
>  
>  	/* had we spliced it onto indirect block? */
> @@ -819,9 +815,9 @@ static int ext3_splice_branch(handle_t *handle, struct inode *inode,
>  	} else {
>  		/*
>  		 * OK, we spliced it into the inode itself on a direct block.
> -		 * Inode was dirtied above.
>  		 */
>  		jbd_debug(5, "splicing direct\n");
> +		ext3_mark_inode_dirty(handle, inode);
>  	}
>  	return err;
>  
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2012-01-30 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30  8:41 [PATCH 2/2] ext3: Don't update ctime in ext3_splice_branch() Kazuya Mio
2012-01-30 17:52 ` Jan Kara [this message]
2012-02-01  7:56   ` Kazuya Mio
2012-02-01 10:46     ` Jan Kara
2012-02-08  8:36       ` Kazuya Mio

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=20120130175217.GA7827@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=adilger@dilger.ca \
    --cc=k-mio@sx.jp.nec.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;
as well as URLs for NNTP newsgroup(s).