We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b76cce1 commit af5b886Copy full SHA for af5b886
fs/bcachefs/super.c
@@ -1995,6 +1995,22 @@ int bch2_dev_add(struct bch_fs *c, const char *path)
1995
goto err_late;
1996
}
1997
1998
+ /*
1999
+ * We just changed the superblock UUID, invalidate cache and send a
2000
+ * uevent to update /dev/disk/by-uuid
2001
+ */
2002
+ invalidate_bdev(ca->disk_sb.bdev);
2003
+
2004
+ char uuid_str[37];
2005
+ snprintf(uuid_str, sizeof(uuid_str), "UUID=%pUb", &c->sb.uuid);
2006
2007
+ char *envp[] = {
2008
+ "CHANGE=uuid",
2009
+ uuid_str,
2010
+ NULL,
2011
+ };
2012
+ kobject_uevent_env(&ca->disk_sb.bdev->bd_device.kobj, KOBJ_CHANGE, envp);
2013
2014
up_write(&c->state_lock);
2015
out:
2016
printbuf_exit(&label);
0 commit comments