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] [day] [month] [year] [list]
Date:	Fri, 7 Sep 2012 08:29:28 +0200
From:	Marco Stornelli <marco.stornelli@...il.com>
To:	Lukáš Czerner <lczerner@...hat.com>
Cc:	Linux FS Devel <linux-fsdevel@...r.kernel.org>, linux-mm@...ck.org,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 00/21] drop vmtruncate

2012/9/6 Lukáš Czerner <lczerner@...hat.com>:
> On Fri, 31 Aug 2012, Marco Stornelli wrote:
>
>> Date: Fri, 31 Aug 2012 15:50:20 +0200
>> From: Marco Stornelli <marco.stornelli@...il.com>
>> To: Linux FS Devel <linux-fsdevel@...r.kernel.org>, linux-mm@...ck.org
>> Cc: Linux Kernel <linux-kernel@...r.kernel.org>
>> Subject: [PATCH 00/21] drop vmtruncate
>>
>> Hi all,
>>
>> with this patch series I try to clean the vmtruncate code. The theory of
>> operation:
>>
>> old               new
>> vmtruncate() =>   inode_newsize_ok+truncate_setsize+fs truncate
>>
>> Where vmtruncate was used without any error check, the code now is:
>>
>> if (inode_newsize_ok() == 0) {
>>       truncate_setsize();
>>       fs truncate();
>> }
>>
>> So, performance and semantic nothing change at all. I think that maybe in some
>> point we can skip inode_newsize_ok (where the error check of vmtruncate wasn't
>> used) but since there is a swap check in case of no-extension, maybe it's
>> better to avoid regressions. After this clean, of course, each fs can clean in
>> a deeply way.
>>
>> With these patches even the inode truncate callback is deleted.
>>
>> Any comments/feedback/bugs are welcome.
>
> Could you explain the reason behind this change a little bit more ?
> This does not make any sense to me since you're replacing
> vmtruncate() which does basically
>
> if (inode_newsize_ok() == 0) {
>         truncate_setsize();
>         fs truncate();
> }
>
> as you mentioned above by exactly the same thing but doing it within
> the file system. It does not seem like an improvement to me ... how
> is this a clean up ?
>
> Thanks!
> -Lukas
>

First of all we have one function less in our stack :) Vmtruncate (see
comments) is deprecated, so it's better to remove it completly. In
this way we can remove even the truncate call back in inode operations
(so save 4byte/8byte per struct for the pointer). The first goal of
this cleaning activity, however, is remove a "deprecated" function to
have a code much more readable. As I said, this patch series is only a
*first* cleanup, each fs can of course clean its code in a deeply way.
As you can see, the patch span over several fs, to be *safe* I
preferred to use a conservative approach. Where vmtruncate was called
without error check, as I said, maybe we can remove
inode_newsize_ok(), but since in this way we skip a check, I preferred
that approach. It seems that for NTFS and Raiserfs it's ok.

Marco

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