x86/smpboot: Init apic mapping before usage
[cascardo/linux.git] / fs / pipe.c
index 5ff02c4..8e0d9f2 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -628,6 +628,9 @@ struct pipe_inode_info *alloc_pipe_info(void)
        if (pipe == NULL)
                goto out_free_uid;
 
+       if (pipe_bufs * PAGE_SIZE > pipe_max_size && !capable(CAP_SYS_RESOURCE))
+               pipe_bufs = pipe_max_size >> PAGE_SHIFT;
+
        user_bufs = account_pipe_buffers(user, 0, pipe_bufs);
 
        if (too_many_pipe_buffers_soft(user_bufs)) {