Creating procfs entry on linux in Kernel Module
memset

for (int i = 0; i &lt; sizeof(data) - 1; i++){
    data[i] = 'a';
}


shouldn't be needed. Just use memset from string.h, which is indeed available in the kernel.

sizeof

You have this:

int i = 0; i &lt; sizeof(data) - 1; i++


but also this:

pos + len &lt; sizeof data ? len : sizeof data - pos


Today I learned that the parens are needed on types and optional on expressions:


  The operator has a single operand, which is either an expression or a data type cast. A cast is a data type enclosed in parenthesis. 


The only syntax I've ever seen is with parens. You should at least stay internally consistent.

Buffer sizes

5000 is a little unusual, especially inside the kernel. Unless there are hidden motivations, consider just making it 1024*4 == 4096.