lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1164970738.3752.508.camel@quoit.chygwyn.com>
Date:	Fri, 01 Dec 2006 10:58:58 +0000
From:	Steven Whitehouse <swhiteho@...hat.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	cluster-devel@...hat.com, linux-kernel@...r.kernel.org
Subject: Re: [GFS2] Don't flush everything on fdatasync [70/70]

Hi,

On Thu, 2006-11-30 at 23:01 -0800, Andrew Morton wrote:
> On Thu, 30 Nov 2006 12:24:08 +0000
> Steven Whitehouse <swhiteho@...hat.com> wrote:
> 
> >  static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync)
> >  {
> > -	struct gfs2_inode *ip = GFS2_I(dentry->d_inode);
> > +	struct inode *inode = dentry->d_inode;
> > +	int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC);
> > +	int ret = 0;
> > +	struct writeback_control wbc = {
> > +		.sync_mode = WB_SYNC_ALL,
> > +		.nr_to_write = 0,
> > +	};
> > +
> > +	if (gfs2_is_jdata(GFS2_I(inode))) {
> > +		gfs2_log_flush(GFS2_SB(inode), GFS2_I(inode)->i_gl);
> > +		return 0;
> > +	}
> >  
> > -	gfs2_log_flush(ip->i_gl->gl_sbd, ip->i_gl);
> > +	if (sync_state != 0) {
> > +		if (!datasync)
> > +			ret = sync_inode(inode, &wbc);
> 
> filemap_fdatawrite() would be simpler.

I was taking my cue here from ext3 which does something similar. The
filemap_fdatawrite() is done by the VFS before this is called with a
filemap_fdatawait() afterwards. This was intended to flush the metadata
via (eventually) ->write_inode() although I guess I should be calling
write_inode_now() instead?

Steve.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ