mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-22 11:17:19 +00:00
Acquire periph reference when handling d_getattr() method call.
While GEOM in general has provider opened while sending BIO_GETATTR, GEOM DISK does not really need to open disk to read medium-unrelated attributes for own use. Proposed by: ken
This commit is contained in:
parent
33d6ebecd5
commit
7912f917ca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251649
@ -1080,10 +1080,13 @@ adagetattr(struct bio *bp)
|
||||
struct cam_periph *periph;
|
||||
|
||||
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
|
||||
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
|
||||
return (ENXIO);
|
||||
cam_periph_lock(periph);
|
||||
ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,
|
||||
periph->path);
|
||||
cam_periph_unlock(periph);
|
||||
cam_periph_release(periph);
|
||||
if (ret == 0)
|
||||
bp->bio_completed = bp->bio_length;
|
||||
return ret;
|
||||
|
@ -1427,10 +1427,13 @@ dagetattr(struct bio *bp)
|
||||
struct cam_periph *periph;
|
||||
|
||||
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
|
||||
if (cam_periph_acquire(periph) != CAM_REQ_CMP)
|
||||
return (ENXIO);
|
||||
cam_periph_lock(periph);
|
||||
ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute,
|
||||
periph->path);
|
||||
cam_periph_unlock(periph);
|
||||
cam_periph_release(periph);
|
||||
if (ret == 0)
|
||||
bp->bio_completed = bp->bio_length;
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user