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, 24 Jun 2016 16:08:51 -0700
From:	Deepa Dinamani <deepa.kernel@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Linux FS-devel Mailing List <linux-fsdevel@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"Theodore Ts'o" <tytso@....edu>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	y2038 Mailman List <y2038@...ts.linaro.org>,
	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-ext4@...r.kernel.org
Subject: Re: [PATCH v2 06/24] fs: ext4: Use current_time() for inode timestamps

>> @@ -3727,6 +3727,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
>>         };
>>         u8 new_file_type;
>>         int retval;
>> +       struct timespec ctime;
>>
>>         if ((ext4_encrypted_inode(old_dir) ||
>>              ext4_encrypted_inode(new_dir)) &&
>> @@ -3829,8 +3830,9 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
>>          * Like most other Unix systems, set the ctime for inodes on a
>>          * rename.
>>          */
>> -       old.inode->i_ctime = ext4_current_time(old.inode);
>> -       new.inode->i_ctime = ext4_current_time(new.inode);
>> +       ctime = current_time(old.inode);
>> +       old.inode->i_ctime = ctime;
>> +       new.inode->i_ctime = ctime;
>>         ext4_mark_inode_dirty(handle, old.inode);
>>         ext4_mark_inode_dirty(handle, new.inode);
>>
>
> Adding a local variable here looks like it is going to cause us trouble when we
> change the return type of current_time() to timespec64.
>
> I'd write this as
>
>         new.inode->i_ctime = old.inode->i_ctime;
>
> instead.

This should be fine.
There are already instances that use local timespecs for inode time assignments.

These can be changed this way:

+       ctime = vfs_time_to_timespec(current_time(old.inode));
+       old.inode->i_ctime = timespec_to_vfs_time(ctime);
+       new.inode->i_ctime = timespec_to_vfs_time(ctime);

This could be a little inefficient, but only temporary.
The local variable can be changed to timespec64 when the macros are deleted.

I'm trying to make minimal changes.

-Deepa
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ