-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix Android device issues related to filesystem/IO #58586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1427,6 +1427,7 @@ int64_t SystemNative_GetFileSystemType(intptr_t fd) | |||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "befs") == 0) result = 0x42465331; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "bdevfs") == 0) result = 0x62646576; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "bfs") == 0) result = 0x1BADFACE; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "bpf_fs") == 0) result = 0xCAFE4A11; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "binfmt_misc") == 0) result = 0x42494E4D; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "bootfs") == 0) result = 0xA56D3FF9; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "btrfs") == 0) result = 0x9123683E; | ||||||||||||||||||||||||||
|
@@ -1452,6 +1453,7 @@ int64_t SystemNative_GetFileSystemType(intptr_t fd) | |||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "ext2") == 0) result = 0xEF53; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "ext3") == 0) result = 0xEF53; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "ext4") == 0) result = 0xEF53; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "f2fs") == 0) result = 0xF2F52010; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "fat") == 0) result = 0x4006; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "fd") == 0) result = 0xF00D1E; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "fhgfs") == 0) result = 0x19830326; | ||||||||||||||||||||||||||
|
@@ -1519,6 +1521,7 @@ int64_t SystemNative_GetFileSystemType(intptr_t fd) | |||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "sysv2") == 0) result = 0x012FF7B6; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "sysv4") == 0) result = 0x012FF7B5; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "tmpfs") == 0) result = 0x01021994; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "tracefs") == 0) result = 0x74726163; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "ubifs") == 0) result = 0x24051905; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "udf") == 0) result = 0x15013346; | ||||||||||||||||||||||||||
else if (strcmp(statfsArgs.f_basetype, "ufs") == 0) result = 0x00011954; | ||||||||||||||||||||||||||
|
@@ -1560,13 +1563,21 @@ int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, | |||||||||||||||||||||||||
struct flock lockArgs; | ||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
#if defined(TARGET_ANDROID) && defined(HAVE_FLOCK64) | ||||||||||||||||||||||||||
// On Android, fcntl is always implemented by fcntl64 but before https://github.com/aosp-mirror/platform_bionic/commit/09e77f35ab8d291bf88302bb9673aaa518c6bcb0 | ||||||||||||||||||||||||||
// there was no remapping of F_SETLK to F_SETLK64 when _FILE_OFFSET_BITS=64 (which we set in eng/native/configurecompiler.cmake) so we need to always pass F_SETLK64 | ||||||||||||||||||||||||||
int command = F_SETLK64; | ||||||||||||||||||||||||||
#else | ||||||||||||||||||||||||||
int command = F_SETLK; | ||||||||||||||||||||||||||
#endif | ||||||||||||||||||||||||||
Comment on lines
+1566
to
+1572
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a case where generic condition won't work:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure and since I want the change to go back to release/6.0 I thought it's better to keep the existing code as is. We can try your version for 7.0. |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
lockArgs.l_type = unixLockType; | ||||||||||||||||||||||||||
lockArgs.l_whence = SEEK_SET; | ||||||||||||||||||||||||||
lockArgs.l_start = (off_t)offset; | ||||||||||||||||||||||||||
lockArgs.l_len = (off_t)length; | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
int32_t ret; | ||||||||||||||||||||||||||
while ((ret = fcntl (ToFileDescriptor(fd), F_SETLK, &lockArgs)) < 0 && errno == EINTR); | ||||||||||||||||||||||||||
while ((ret = fcntl (ToFileDescriptor(fd), command, &lockArgs)) < 0 && errno == EINTR); | ||||||||||||||||||||||||||
return ret; | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.