It is a very, very bad idea to read/write files in an interrupt service routine. This is not how you should do things, and it cannot work that way.
If you are in an interrupt context, then interrupts are disabled (or at least most of them). But you need interrupts (e.g. timer for timeout, interrupts for SPI) active while writing/reading files.
If you need to trigger file I/O from an interrupt, then simply set a flag from that interrupt.
And do the writing/reading from your main application.
I hope this helps to understand the issue you are facing,
Erich