Skip to contentSkip to conversation

: Convert simple_strtoul to strict_strtoul in fs/inode.c

PATCH Manish Katiyar 1 participant 1 message Mar 31, 2009 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 27 lines · Andrew Morton
Quoted 24 lines · On Mon, 23 Mar 2009 09:02:04 +0530 Manish Katiyar <[email protected]> wrote:

Hi Andrew,

Below patch converts simple_strtoul to strict_strtoul in fs/inode.c

---
 fs/inode.c |    8 +++++++-

 1 files changed, 7 insertions(+), 1 deletions(-)
fs/inode.c +4 -1
index e0dad15..ef4a9b1 100644
@@ -1447,9 +1447,15 @@ EXPORT_SYMBOL(inode_double_unlock);
  static __initdata unsigned long ihash_entries;
  static int __init set_ihash_entries(char *str)
  {
+     int ret;
+
       if (!str)
               return 0;
-     ihash_entries = simple_strtoul(str, &str, 0);
+
+     ret = strict_strtoul(str, 0, &ihash_entries);
Quoted 8 lines

fs/inode.c EXPORT_SYMBOL(inode_double_unlock); · line 1461

Quoted 6 lines
fs/inode.c +3 -0
+     if (ret < 0 || ihash_entries == 0)
+             return 0;
+
       return 1;
  }
  __setup("ihash_entries=", set_ihash_entries);

Again, there is no reason given for making the change.

Hi Andrew,

It showed up during cleanup of this file via checkpatch.pl.

Quoted 11 lines

Bear in mind that this is not a backward-compatible change!  If someone (stupidly) has

       ihash_entries=42foo

in their grub.conf then your change would break their kernels.

it's not a serious problem and we can probably make this change, but [email protected] is not a suitable list for discussing and promulgating the change.

I have cced lkml.

Thanks -
Manish

Quoted 2 lines