cachefiles: unmark inode in use in error path
Unmark inode in use if error encountered. If the in-use flag leakage
occurs in cachefiles_open_file(), Cachefiles will complain "Inode
already in use" when later another cookie with the same index key is
looked up.
If the in-use flag leakage occurs in cachefiles_create_tmpfile(), though
the "Inode already in use" warning won't be triggered, fix the leakage
anyway.
Reported-by: Gao Xiang <[email protected]>
Fixes: 1f08c925e7a3 ("cachefiles: Implement backing file wrangling")
Signed-off-by: Jeffle Xu <[email protected]>
Signed-off-by: David Howells <[email protected]>
cc:
[email protected]
Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006615.html
Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006618.html