Merge branch 'for-linus2' of git://git.kernel.dk/linux-2.6-block
[safe/jmp/linux-2.6] / kernel / sysctl.c
index 84ff5e7..d24f761 100644 (file)
@@ -1471,12 +1471,12 @@ static struct ctl_table fs_table[] = {
        },
 #endif
        {
-               .procname       = "pipe-max-pages",
-               .data           = &pipe_max_pages,
+               .procname       = "pipe-max-size",
+               .data           = &pipe_max_size,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .extra1         = &two,
+               .proc_handler   = &pipe_proc_fn,
+               .extra1         = &pipe_min_size,
        },
 /*
  * NOTE: do not add new entries to this table unless you have read
@@ -2287,6 +2287,8 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
                if (write) {
                        left -= proc_skip_spaces(&kbuf);
 
+                       if (!left)
+                               break;
                        err = proc_get_long(&kbuf, &left, &lval, &neg,
                                             proc_wspace_sep,
                                             sizeof(proc_wspace_sep), NULL);
@@ -2313,7 +2315,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
 
        if (!write && !first && left && !err)
                err = proc_put_char(&buffer, &left, '\n');
-       if (write && !err)
+       if (write && !err && left)
                left -= proc_skip_spaces(&kbuf);
 free:
        if (write) {