Don't update provider properties and don't set DISKFLAG_OPEN if d_open()

disk method call returned error.  GEOM considers devices in such case as
still closed, and won't call symmetric d_close() for them.
This commit is contained in:
Alexander Motin 2013-06-11 10:06:07 +00:00
parent f184cec5a9
commit c145d6005f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251616

View File

@ -138,6 +138,8 @@ g_disk_access(struct g_provider *pp, int r, int w, int e)
printf("Opened disk %s -> %d\n",
pp->name, error);
g_disk_unlock_giant(dp);
if (error != 0)
return (error);
}
pp->mediasize = dp->d_mediasize;
pp->sectorsize = dp->d_sectorsize;