From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RHEL5 gfs-kmod patch] GFS: Write vfs inode attributes to disk in gfs_inode_write
Date: Wed, 26 Mar 2014 09:01:18 +0000 [thread overview]
Message-ID: <1395824478.2729.0.camel@menhir> (raw)
In-Reply-To: <20140325203227.GF13879@dhcp80-209.msp.redhat.com>
Hi,
On Tue, 2014-03-25 at 15:32 -0500, Benjamin Marzinski wrote:
> GFS wasn't ever updating mtime during mmaps to a file. This patch makes
> gfs_write_inode write the vfs inode attributes out to disk, so that they
> get updated when the mmap data is written back to disk.
>
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Looks good to me. ACK,
Steve.
> ---
> diff --git a/gfs-kernel/src/gfs/ops_super.c b/gfs-kernel/src/gfs/ops_super.c
> index c111a2e..0d17735 100644
> --- a/gfs-kernel/src/gfs/ops_super.c
> +++ b/gfs-kernel/src/gfs/ops_super.c
> @@ -39,6 +39,7 @@
> #include "super.h"
> #include "sys.h"
> #include "mount.h"
> +#include "trans.h"
>
> /**
> * gfs_write_inode - Make sure the inode is stable on the disk
> @@ -51,14 +52,50 @@
> static int
> gfs_write_inode(struct inode *inode, int sync)
> {
> + int ret = 0;
> struct gfs_inode *ip = get_v2ip(inode);
> + struct buffer_head *dibh;
> + struct gfs_holder i_gh;
> + int need_unlock = 0;
> +
> + if (!ip)
> + return 0;
>
> atomic_inc(&ip->i_sbd->sd_ops_super);
>
> - if (ip && sync)
> + if (current->flags & PF_MEMALLOC)
> + goto do_flush;
> +
> + if (!gfs_glock_is_locked_by_me(ip->i_gl)) {
> + ret = gfs_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh);
> + if (ret)
> + goto do_flush;
> + need_unlock = 1;
> + }
> + /* Trans may require:
> + one dinode block. */
> + ret = gfs_trans_begin(ip->i_sbd, 1, 0);
> + if (ret)
> + goto do_unlock;
> +
> + ret = gfs_get_inode_buffer(ip, &dibh);
> + if (ret == 0) {
> + gfs_inode_attr_out(ip);
> + gfs_trans_add_bh(ip->i_gl, dibh);
> + gfs_dinode_out(&ip->i_di, dibh->b_data);
> + brelse(dibh);
> + }
> +
> + gfs_trans_end(ip->i_sbd);
> +
> +do_unlock:
> + if (need_unlock)
> + gfs_glock_dq_uninit(&i_gh);
> +do_flush:
> + if (sync)
> gfs_log_flush_glock(ip->i_gl, 0);
>
> - return 0;
> + return ret;
> }
>
> /**
>
prev parent reply other threads:[~2014-03-26 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 20:32 [Cluster-devel] [RHEL5 gfs-kmod patch] GFS: Write vfs inode attributes to disk in gfs_inode_write Benjamin Marzinski
2014-03-26 9:01 ` 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=1395824478.2729.0.camel@menhir \
--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 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).