summaryrefslogtreecommitdiff
path: root/jni
diff options
context:
space:
mode:
author Hobin Woo <hobin.woo@samsung.corp-partner.google.com> 2024-09-06 10:20:22 +0000
committer Dipankar Bhardwaj <dipankarb@google.com> 2024-09-09 08:23:58 +0000
commitbff215d8322ff73a8dcc88a7c7c4db42c82250f0 (patch)
treee3016420627a32e6b5ee60ff3547254fb961fabe /jni
parentc42b606dd28284ff436e4ae10f7c0bd8e04827a9 (diff)
FuseDaemon: support RENAME_NOREPLACE rename
Current FuseDaemon is incompatible with renaming a file with RENAME_NOREPLACE which does not allow a file to be renamed if newpath already exists. However, there's no reason to disallow this because checking EEXIST is already done in upper vfs kernel and thus it does not affect the behavior of FuseDaemon. Co-developed-by: Yoonho Shin <yoonho.shin@samsung.corp-partner.google.com> Signed-off-by: Hobin Woo <hobin.woo@samsung.corp-partner.google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:af401d1ec047186dec7d0977069df8c02adde1d6) Merged-In: I0eed8a58efb6f61d916adc3f2596c63220ceb8ff Change-Id: I0eed8a58efb6f61d916adc3f2596c63220ceb8ff Flag: EXEMPT bug fix
Diffstat (limited to 'jni')
-rw-r--r--jni/FuseDaemon.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/jni/FuseDaemon.cpp b/jni/FuseDaemon.cpp
index 2f2302271..e77fe5705 100644
--- a/jni/FuseDaemon.cpp
+++ b/jni/FuseDaemon.cpp
@@ -1348,7 +1348,9 @@ static int do_rename(fuse_req_t req, fuse_ino_t parent, const char* name, fuse_i
ATRACE_CALL();
struct fuse* fuse = get_fuse(req);
- if (flags != 0) {
+ // VFS handles request with RENAME_NOREPLACE by ensuring that new file does not exist
+ // before redirecting the call to FuseDaemon.
+ if (flags & ~RENAME_NOREPLACE) {
return EINVAL;
}