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: <6ccf3581-71b8-6502-5050-643006423a63@oracle.com>
Date:   Mon, 21 Jan 2019 10:19:15 -0600
From:   Dave Kleikamp <dave.kleikamp@...cle.com>
To:     Christoph Hellwig <hch@....de>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     linux-kernel@...r.kernel.org, Dave Kleikamp <shaggy@...nel.org>,
        jfs-discussion@...ts.sourceforge.net
Subject: Re: [PATCH v1] fs/jfs: Switch to use new generic UUID API

On 1/21/19 2:49 AM, Christoph Hellwig wrote:
>> +	buf->f_fsid.val[1] = (u32)crc32_le(0, (char *)&sbi->uuid + sizeof(sbi->uuid)/2,
> 
> This adds an overly long line, and has weird operator spacing.
> 
> In fact given how much deep magic it does it should probably be moved
> into a helper and properly documented when you touch it anyway.
> 

I cleaned this up a bit when I pushed it to the jfs tree.

https://github.com/kleikamp/linux-shaggy/commit/2e3bc6125154c691e987e2554f2c99ec10f83b73

Here's the relevant part. It's still a bit ugly, but I got rid of an
unnecessary cast and kept the lines from exceeding 80 characters.

diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 65d8fc87ab11..c15ff56a8516 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -174,9 +174,11 @@ static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	buf->f_files = maxinodes;
 	buf->f_ffree = maxinodes - (atomic_read(&imap->im_numinos) -
 				    atomic_read(&imap->im_numfree));
-	buf->f_fsid.val[0] = (u32)crc32_le(0, sbi->uuid, sizeof(sbi->uuid)/2);
-	buf->f_fsid.val[1] = (u32)crc32_le(0, sbi->uuid + sizeof(sbi->uuid)/2,
-					sizeof(sbi->uuid)/2);
+	buf->f_fsid.val[0] = crc32_le(0, (char *)&sbi->uuid,
+				      sizeof(sbi->uuid)/2);
+	buf->f_fsid.val[1] = crc32_le(0,
+				      (char *)&sbi->uuid + sizeof(sbi->uuid)/2,
+				      sizeof(sbi->uuid)/2);
 
 	buf->f_namelen = JFS_NAME_MAX;
 	return 0;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ