From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] GFS2: bz 496716 - GFS2 ">>" will not update ctime, mtime after appending to the file
Date: Tue, 12 May 2009 17:21:45 +0100 [thread overview]
Message-ID: <1242145305.29604.292.camel@localhost.localdomain> (raw)
In-Reply-To: <4A09A0D4.9090404@redhat.com>
Hi,
Now in the -nmw git tree. Thanks,
Steve.
On Tue, 2009-05-12 at 11:16 -0500, Abhijith Das wrote:
> This patch copies the timestamps from the vfs inode into gfs2 and syncs
> it to the disk inode during writes.
>
> Signed-off-by: Abhijith Das <adas@redhat.com>
> plain text document attachment (bz496716-4-git.patch)
> diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
> index a6dde17..e566421 100644
> --- a/fs/gfs2/ops_address.c
> +++ b/fs/gfs2/ops_address.c
> @@ -781,10 +781,12 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
> unlock_page(page);
> page_cache_release(page);
>
> - if (inode->i_size < to) {
> - i_size_write(inode, to);
> - ip->i_disksize = inode->i_size;
> - di->di_size = cpu_to_be64(inode->i_size);
> + if (copied) {
> + if (inode->i_size < to) {
> + i_size_write(inode, to);
> + ip->i_disksize = inode->i_size;
> + }
> + gfs2_dinode_out(ip, di);
> mark_inode_dirty(inode);
> }
>
> @@ -824,7 +826,6 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
> struct gfs2_sbd *sdp = GFS2_SB(inode);
> struct buffer_head *dibh;
> struct gfs2_alloc *al = ip->i_alloc;
> - struct gfs2_dinode *di;
> unsigned int from = pos & (PAGE_CACHE_SIZE - 1);
> unsigned int to = from + len;
> int ret;
> @@ -847,11 +848,10 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,
> gfs2_page_add_databufs(ip, page, from, to);
>
> ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata);
> -
> - if (likely(ret >= 0) && (inode->i_size > ip->i_disksize)) {
> - di = (struct gfs2_dinode *)dibh->b_data;
> - ip->i_disksize = inode->i_size;
> - di->di_size = cpu_to_be64(inode->i_size);
> + if (ret > 0) {
> + if (inode->i_size > ip->i_disksize)
> + ip->i_disksize = inode->i_size;
> + gfs2_dinode_out(ip, dibh->b_data);
> mark_inode_dirty(inode);
> }
>
prev parent reply other threads:[~2009-05-12 16:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-12 16:16 [Cluster-devel] [PATCH] GFS2: bz 496716 - GFS2 ">>" will not update ctime, mtime after appending to the file Abhijith Das
2009-05-12 16:21 ` Steven Whitehouse [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=1242145305.29604.292.camel@localhost.localdomain \
--to=swhiteho@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.