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]
Date:	Mon, 22 Apr 2013 15:03:02 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Namjae Jeon <linkinjeon@...il.com>
Cc:	hirofumi@...l.parknet.co.jp, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Namjae Jeon <namjae.jeon@...sung.com>,
	Amit Sahrawat <a.sahrawat@...sung.com>
Subject: Re: [PATCH v5] fat: editions to support fat_fallocate

On Thu, 18 Apr 2013 22:54:15 +0900 Namjae Jeon <linkinjeon@...il.com> wrote:

> Change Log:
> v5: change to avoid compilation warning:
>   fs/fat/inode.c: In function 'fat_zero_falloc_area':
> >> fs/fat/inode.c:169:11: warning: comparison of distinct pointer
> types lacks a cast [enabled by default]

The patch does more than that - here's the v4->v5 delta:

--- a/fs/fat/file.c~fat-additions-to-support-fat_fallocate-v5
+++ a/fs/fat/file.c
@@ -153,7 +153,6 @@ static int fat_file_release(struct inode
 	 */
 	mutex_lock(&inode->i_mutex);
 	mmu_private_ideal = round_up(inode->i_size, sb->s_blocksize);
-
 	if (mmu_private_ideal < MSDOS_I(inode)->mmu_private &&
 	    filp->f_dentry->d_count == 1)
 		fat_truncate_blocks(inode, inode->i_size);
@@ -231,7 +230,6 @@ static int fat_cont_expand(struct inode
 out:
 	return err;
 }
-
 /*
  * Preallocate space for a file. This implements fat's fallocate file
  * operation, which gets called from sys_fallocate system call. User
@@ -281,10 +279,8 @@ static long fat_fallocate(struct file *f
 						      sbi->cluster_bits;
 		} else
 			nr_bytes = offset + len - inode->i_size;
-
 		nr_cluster = (nr_bytes + (sbi->cluster_size - 1)) >>
 			     sbi->cluster_bits;
-
 		/* Start the allocation.We are not zeroing out the clusters */
 		while (nr_cluster-- > 0) {
 			err = fat_alloc_clusters(inode, &cluster, 1);
@@ -308,12 +304,10 @@ static long fat_fallocate(struct file *f
 				"fat_fallocate(): fat_cont_expand() error");
 		}
 	}
-
 error:
 	mutex_unlock(&inode->i_mutex);
 	return err;
 }
-
 /* Free all clusters after the skip'th cluster. */
 static int fat_free(struct inode *inode, int skip)
 {
--- a/fs/fat/inode.c~fat-additions-to-support-fat_fallocate-v5
+++ a/fs/fat/inode.c
@@ -166,7 +166,7 @@ static int fat_zero_falloc_area(struct f
 
 		offset = (curpos & (PAGE_CACHE_SIZE - 1));
 		bytes = PAGE_CACHE_SIZE - offset;
-		bytes = min(bytes, count);
+		bytes = min_t(size_t, bytes, count);
 
 		err = pagecache_write_begin(NULL, mapping, curpos, bytes,
 					AOP_FLAG_UNINTERRUPTIBLE,

The whitespace changes are mostly dubious and the ones which remove the
newline after a function's final brace are simply wrong.  The min_t
change is unneeded - it's better to make the type of `bytes' size_t. 
So I shall skip v5.

BTW, I don't intend to send this patch into Linus until I have
heard from hirofumi.  Please let me know if he has already reviewed
and acked it?
--
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