I think we won't need this patch. the coming sysfs changes will
have entry point to handle missing devices/FSID. (inspired by md).
That will be much cleaner to trigger the clean up based on the
device FS changes.
The proposed fix in this Patch, can it handle things like when
customer decides to overwrite btrfs device with ext FS. ? would
that still leave some stale fs_devices. ?

Thanks, Anand.


On 01/24/2015 02:10 AM, David Sterba wrote:
On Thu, Jan 15, 2015 at 04:53:08PM +0800, Gui Hecheng wrote:
The following patch:
        btrfs: remove empty fs_devices to prevent memory runout

introduces @valid_dev_root aiming at recording @btrfs_device objects that
have corresponding block devices with btrfs.
But if a block device is broken or unplugged, no one tells the
@valid_dev_root to cleanup the "dead" objects.

To recycle the memory occuppied by those "dead"s, we could rely on
the shrinker. The shrinker's scan function will traverse the
@valid_dev_root and trys to open the devices one by one, if it fails
or encounters a non-btrfs it will remove the "dead" @btrfs_device.

I don't see why shrinker is used here.

linux.git/linux/shrinker.h:

"A callback you can register to apply pressure to ageable caches."

How is guaranteed that it will take action at the right time?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to