cachefiles: unmark inode in use in error path
authorJeffle Xu <jefflexu@linux.alibaba.com>
Wed, 30 Mar 2022 09:47:59 +0000 (17:47 +0800)
committerDavid Howells <dhowells@redhat.com>
Fri, 8 Apr 2022 22:32:30 +0000 (23:32 +0100)
commitea5dc046127e857a7873ae55fd57c866e9e86fb2
tree0ccfe88a5a3c8833d16d192ece9e55bb3261e7b4
parent42e7a03d3badebd4e70aea5362d6914dfc7c220b
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 <hsiangkao@linux.alibaba.com>
Fixes: 1f08c925e7a3 ("cachefiles: Implement backing file wrangling")
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cachefs@redhat.com
Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006615.html
Link: https://listman.redhat.com/archives/linux-cachefs/2022-March/006618.html
fs/cachefiles/namei.c