title: How can I get a filename from a file descriptor inside a kernel module?
body: <p>I need to get the name of a file from a given file descriptor, inside a small linux kernel module that I wrote. I tried the solution given at <a href="https://stackoverflow.com/questions/1188757/getting-filename-from-file-descriptor-in-c">Getting Filename from file descriptor in C</a>, but for some reason, it prints out garbage values (on using <code>readlink</code> on <code>/proc/self/fd/NNN</code> as mentioned in the solution). How can I do it?</p>