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: <20100610082711.GA2173@lst.de>
Date:	Thu, 10 Jun 2010 10:27:11 +0200
From:	Christoph Hellwig <hch@....de>
To:	Tao Ma <tao.ma@...cle.com>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Joel Becker <joel.becker@...cle.com>,
	Christoph Hellwig <hch@....de>, Nick Piggin <npiggin@...e.de>
Subject: Re: [PATCH v3] ocfs2: Let ocfs2_setattr use new truncate sequence.

On Thu, Jun 10, 2010 at 01:08:05PM +0800, Tao Ma wrote:
> Let ocfs2 use the new truncate sequence. The changes include:
> 1. Use truncate_setsize directly since we don't implement our
>    own ->truncate and what we need is "update i_size and
>    truncate_pagecache" which truncate_setsize now does.
> 2. For direct write, ocfs2 actually don't allow write to pass
>    i_size(see ocfs2_prepare_inode_for_write), so we don't have
>    a chance to increase i_size. So remove the bogus check.

You just leave the duplicate inode_newsize_ok in, but still have
one as part of inode_change_ok.  See the previous thread - we'll
need to move inode_change_ok to under the cluster locks, both
for the truncate and non-truncate case.

>  	/*
> +	 * Since all the work for a size change has been done above.
> +	 * Call truncate_setsize directly to change size and truncate
> +	 * pagecache.
>  	 */
>  	if ((attr->ia_valid & ATTR_SIZE) &&
> +	    attr->ia_size != inode->i_size)

this could be on one line now.

> +		truncate_setsize(inode, attr->ia_size);

But any reason this isn't done inside the

        if (size_change && attr->ia_size != inode->i_size) {

conditional above?  You'll never get size and uid/gid changes in the
same request, so there won't be any change in behaviour.


--
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