Google is committed to advancing racial equity for Black communities. See how.

SDCardFS Deprecation

SDCardFS support is deprecated in Android 11. VTS testing doesn't allow mounted file systems listed as SDCardFS.

In prior versions of Android, SDCardFS provided a way to control access to emulated internal storage and external SD cards, allowing apps to access only the data relevant to them. Additionally, it provided a layer of case insensitivity, as well as some additional storage tracking.

SDCardFS replacement functionality

In Android 11, case sensitivity is handled directly by the filesystem. This results in lookup times nearly identical in case-sensitive and case-insensitive folders, removing the large folder slowdown from SDCardFS. The quota tracking that SDCardFS was doing to quickly gather storage data for settings is now configured from userspace using project quotas. In some performance-sensitive contexts, directories are bind mounted in place. A new FUSE implementation provides scoped storage for direct filesystem access, primarily to support redaction of location information.

Configuring SDCard replacement functionality

To enable project quotas and case folding for emulated storage without SDCardFS, inherit from emulated_storage.mk in the device.mk file:

$(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk)

Encryption with casefolding support requires using policy v2. To enable this, specify :v2 within the vold flags in the fstab. For example:

fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized

Why deprecate SDCardFS?

There are various reasons to deprecate SDCardFS.

Stability

SDCardFS suffers from several race conditions concerning case sensitivity, as well as some issues concerning low memory circumstances. Case-insensitive lookups can be rather slow in large directories because lookups have to walk the lower directory to find alternate cases. Accessing the upper and lower filesystems at the same time can lead to issues as well.

Upstream parity

SDCardFS requires additional patches to the VFS to support changing options on bind mounts. These patches cause additional work to accept upstream changes to these areas. SDCardFS’s features can be replicated by upstream components, removing this pain point.

Feature parity with API

In the previous release of Android, scoped storage limited access to particular types of metadata. Direct storage access through SDCardFS doesn't support these scoped storage features.