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

Non-existing files are treated as no-write-access which triggers the KitKat-Provider-Trick as fallback deletion method #595

Closed
d4rken opened this Issue Nov 8, 2016 · 1 comment

Comments

1 participant
@d4rken
Owner

d4rken commented Nov 8, 2016

We shouldn't check non-existent files for write-access, but we can't influence at which point they are removed by 3rd parties, so this is prone to race-conditions...

Basically we should introduce an extra write-access state specifically for the KitKat-Provider deletion trick.
For this type of access to be returned we should require the conditions

  • Has Android 4.4
  • File stile exists
  • Write-Access method would be NONE otherwise.

No harm being done here, but this is an unnecessary slowdown during deletion.

1478580140820 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140821 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body965456365.tmp]):NONE
1478580140821 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140821 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body965456365.tmp
1478580140822 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140822 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140822 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140823 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body1502777289.tmp]):NONE
1478580140823 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140823 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body1502777289.tmp
1478580140823 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140824 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140824 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140824 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body1378871510.tmp]):NONE
1478580140824 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140824 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body1378871510.tmp
1478580140825 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140825 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140825 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140825 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body669521033.tmp]):NONE
1478580140825 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140825 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body669521033.tmp
1478580140826 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140826 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140826 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140826 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body438607633.tmp]):NONE
1478580140827 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140827 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body438607633.tmp
1478580140827 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140827 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140827 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140828 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body61832084.tmp]):NONE
1478580140828 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140828 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body61832084.tmp
1478580140828 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140828 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140829 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140829 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body82768294.tmp]):NONE
1478580140829 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140829 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body82768294.tmp
1478580140830 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140830 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)
1478580140830 D/SDM:SmartIO: Processing SmartDeleteTask(...)
1478580140830 W/SDM:SmartIO: determineWriteAccess([/data/user_de/0/com.android.phone/cache/body1052136792.tmp]):NONE
1478580140830 V/SDM:SmartIO: Let's try the kitkat provider trick
1478580140831 D/SDM:KitKatHackyFileDeleter: Processing /data/user_de/0/com.android.phone/cache/body1052136792.tmp
1478580140831 D/SDM:SmartIO: Files failed to delete, but actually no longer existed
1478580140831 D/SDM:SmartIO: Delete result: DeleteResultStub(state=OK, affectedsize=0, deletedFiles=0, errorFiles=0)

@d4rken d4rken added bug c: Core labels Nov 8, 2016

@d4rken d4rken added this to the Next Tasks milestone Nov 8, 2016

@d4rken

This comment has been minimized.

Owner

d4rken commented Nov 8, 2016

1478580113365 I/SDM:StorageManager: Detected storages areas:
1478580113366 I/SDM:StorageManager: Storage(location=PUBLIC_DATA, path=/storage/emulated/0/Android/data, userHandle=0, flags=[PRIMARY, EMULATED], safUri=null, mount=Mountpoint(path=/storage/emulated, blockDevice=/dev/fuse, fileSystemType=FUSE, options=[nodev, group_id=1023, rw, nosuid, noatime, default_permissions, allow_other, user_id=1023, noexec]))
1478580113366 I/SDM:StorageManager: Storage(location=DALVIK_PROFILE, path=/data/dalvik-cache/profiles, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113367 I/SDM:StorageManager: Storage(location=SDCARD, path=/storage/emulated/0, userHandle=0, flags=[PRIMARY, EMULATED], safUri=null, mount=Mountpoint(path=/storage/emulated, blockDevice=/dev/fuse, fileSystemType=FUSE, options=[nodev, group_id=1023, rw, nosuid, noatime, default_permissions, allow_other, user_id=1023, noexec]))
1478580113367 I/SDM:StorageManager: Storage(location=APP_LIB, path=/data/app-lib, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113367 I/SDM:StorageManager: Storage(location=PRIVATE_DATA, path=/data/user/0, userHandle=0, flags=[PRIMARY], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113367 I/SDM:StorageManager: Storage(location=VENDOR, path=/vendor, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/vendor, blockDevice=/dev/block/platform/soc.0/f9824900.sdhci/by-name/vendor, fileSystemType=EXT4, options=[data=ordered, ro, seclabel, inode_readahead_blks=8, noatime]))
1478580113368 I/SDM:StorageManager: Storage(location=DALVIK_DEX, path=/data/dalvik-cache/arm, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113368 I/SDM:StorageManager: Storage(location=DALVIK_DEX, path=/data/dalvik-cache/arm64, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113368 I/SDM:StorageManager: Storage(location=APP_APP, path=/data/app, userHandle=-1, flags=[PRIMARY], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113368 I/SDM:StorageManager: Storage(location=SYSTEM, path=/system, userHandle=-1, flags=[PRIMARY], safUri=null, mount=Mountpoint(path=/system, blockDevice=/dev/block/platform/soc.0/f9824900.sdhci/by-name/system, fileSystemType=EXT4, options=[data=ordered, ro, seclabel, inode_readahead_blks=8, noatime]))
1478580113369 I/SDM:StorageManager: Storage(location=SYSTEM_PRIV_APP, path=/system/priv-app, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/system, blockDevice=/dev/block/platform/soc.0/f9824900.sdhci/by-name/system, fileSystemType=EXT4, options=[data=ordered, ro, seclabel, inode_readahead_blks=8, noatime]))
1478580113369 I/SDM:StorageManager: Storage(location=OEM, path=/oem, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/, blockDevice=rootfs, fileSystemType=ROOTFS, options=[seclabel, ro]))
1478580113369 I/SDM:StorageManager: Storage(location=SYSTEM_APP, path=/system/app, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/system, blockDevice=/dev/block/platform/soc.0/f9824900.sdhci/by-name/system, fileSystemType=EXT4, options=[data=ordered, ro, seclabel, inode_readahead_blks=8, noatime]))
1478580113369 I/SDM:StorageManager: Storage(location=APP_ASEC, path=/data/app-asec, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113370 I/SDM:StorageManager: Storage(location=DATA, path=/data, userHandle=-1, flags=[PRIMARY], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113370 I/SDM:StorageManager: Storage(location=DOWNLOAD_CACHE, path=/data/cache, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113370 I/SDM:StorageManager: Storage(location=PUBLIC_OBB, path=/storage/emulated/0/Android/obb, userHandle=0, flags=[PRIMARY, EMULATED], safUri=null, mount=Mountpoint(path=/storage/emulated, blockDevice=/dev/fuse, fileSystemType=FUSE, options=[nodev, group_id=1023, rw, nosuid, noatime, default_permissions, allow_other, user_id=1023, noexec]))
1478580113371 I/SDM:StorageManager: Storage(location=APP_APP_PRIVATE, path=/data/app-private, userHandle=-1, flags=[], safUri=null, mount=Mountpoint(path=/data, blockDevice=/dev/block/dm-0, fileSystemType=EXT4, options=[data=ordered, seclabel, nodev, errors=panic, rw, nosuid, noatime, noauto_da_alloc, inode_readahead_blks=8, discard]))
1478580113371 I/SDM:StorageManager: Storage(location=PUBLIC_MEDIA, path=/storage/emulated/0/Android/media, userHandle=0, flags=[PRIMARY, EMULATED], safUri=null, mount=Mountpoint(path=/storage/emulated, blockDevice=/dev/fuse, fileSystemType=FUSE, options=[nodev, group_id=1023, rw, nosuid, noatime, default_permissions, allow_other, user_id=1023, noexec]))

@d4rken d4rken modified the milestones: v4.4.2, Next Tasks Nov 18, 2016

@d4rken d4rken closed this Nov 19, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment