I am using vfs_write(...)
to write a file in kernel module.
If an error occurs while writing file I want the changes to get reverted and file should be restored to its original state. Currently I am thinking of maintaining a temp file which contains data of file to be written and in case of faliure replace the temp file with original file but its too much work in kernel module.
I am stuck here anyone know any work around this ?