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: <4C1072D3.4020109@oracle.com>
Date:	Thu, 10 Jun 2010 13:06:27 +0800
From:	Tao Ma <tao.ma@...cle.com>
To:	Nick Piggin <npiggin@...e.de>
CC:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Joel Becker <joel.becker@...cle.com>,
	Christoph Hellwig <hch@....de>
Subject: Re: [PATCH v2] ocfs2: Let ocfs2_setattr use new truncate sequence.

Hi Nick,

On 06/10/2010 12:42 PM, Nick Piggin wrote:
> On Thu, Jun 10, 2010 at 11:53:06AM +0800, Tao Ma wrote:
>> Let ocfs2 use the new truncate sequence. The changes include:
>> 1. Remove the extra check for inode_newsize_ok since Christoph
>>     has moved it into inode_change_ok. So we will check it at the
>>     beginning of ocfs2_setattr.
>
> So this deals with our questions regarding check of i_size outside
> the inode cluster lock? (see fsdevel discussion)
oh, I forget about this. yes, we should have cluster lock and shouldn't 
remove this check.
>
>
>> 2. 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.
>> 3. 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.
>>
>> Cc: Joel Becker<joel.becker@...cle.com>
>> Cc: Christoph Hellwig<hch@....de>
>> Cc: Nick Piggin<npiggin@...e.de>
>> Signed-off-by: Tao Ma<tao.ma@...cle.com>
>> ---
>>   fs/ocfs2/file.c |   34 +++++-----------------------------
>>   1 files changed, 5 insertions(+), 29 deletions(-)
>>
>> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
>> index 1fb0985..764fffb 100644
>> --- a/fs/ocfs2/file.c
>> +++ b/fs/ocfs2/file.c
>> @@ -983,10 +983,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
>>   	}
>>
>>   	if (size_change&&  attr->ia_size != i_size_read(inode)) {
>> -		status = inode_newsize_ok(inode, attr->ia_size);
>> -		if (status)
>> -			goto bail_unlock;
>> -
>>   		if (i_size_read(inode)>  attr->ia_size) {
>
> While you're here, you should be able to use inode->i_size if you're
> under i_mutex, no?
ok, will change it and the correpsonding part in truncate_setsize.

Regards,
Tao
--
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