[PATCH] md: helper function to match commands written to sysfs files