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: <20070906164306.GC25035@filer.fsl.cs.sunysb.edu>
Date:	Thu, 6 Sep 2007 12:43:06 -0400
From:	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>
To:	akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	hch@...radead.org, viro@....linux.org.uk,
	bharata@...ux.vnet.ibm.com, j.blunck@...harburg.de,
	jengelh@...putergmbh.de, Erez Zadok <ezk@...sunysb.edu>
Subject: Re: [PATCH 1/1] Unionfs: cache-coherency - dentries

On Mon, Sep 03, 2007 at 07:39:48PM -0400, Josef 'Jeff' Sipek wrote:
...
>  /*
> + * Determine if the lower inode objects have changed from below the unionfs
> + * inode.  Return 1 if changed, 0 otherwise.
> + */
> +bool is_newer_lower(const struct dentry *dentry)
> +{
> +	int bindex;
> +	struct inode *inode;
> +	struct inode *lower_inode;
> +
> +	/* ignore if we're called on semi-initialized dentries/inodes */
> +	if (!dentry || !UNIONFS_D(dentry))
> +		return false;
> +	inode = dentry->d_inode;
> +	if (!inode || !UNIONFS_I(inode) ||
> +	    ibstart(inode) < 0 || ibend(inode) < 0)
> +		return false;
> +
> +	for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
> +		lower_inode = unionfs_lower_inode_idx(inode, bindex);
> +		if (!lower_inode)
> +			continue;
> +		/*
> +		 * We may want to apply other tests to determine if the
> +		 * lower inode's data has changed, but checking for changed
> +		 * ctime and mtime on the lower inode should be enough.
> +		 */
> +		if (timespec_compare(&inode->i_mtime,
> +				     &lower_inode->i_mtime) < 0) {
> +			printk("unionfs: new lower inode mtime "
> +			       "(bindex=%d, name=%s)\n", bindex,
> +			       dentry->d_name.name);
> +			return true; /* mtime changed! */
> +		}
> +		if (timespec_compare(&inode->i_ctime,
> +				     &lower_inode->i_ctime) < 0) {
> +			printk("unionfs: new lower inode ctime "
> +			       "(bindex=%d, name=%s)\n", bindex,
> +			       dentry->d_name.name);
> +			return true; /* ctime changed! */
> +		}
> +	}
> +	return true;		/* default: lower is not newer */

This was a thinko, it should have returned false. I'll send an updated
patch for completeness.

Josef 'Jeff' Sipek.

-- 
Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
		- Albert Einstein
-
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