NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/42532: "dm" driver crashes on concurrent access (fwd)



The following reply was made to PR kern/42532; it has been noted by GNATS.

From: Adam Hamsik <haaaad%gmail.com@localhost>
To: Matthias Scheler <tron%NetBSD.org@localhost>
Cc: 
Subject: Re: kern/42532: "dm" driver crashes on concurrent access (fwd)
Date: Mon, 28 Dec 2009 21:00:12 +0100

 Hi,
 
 Can you test something like this ? I think that it will make dm working =
 in your case.
 
 -       /* FIXME: have to be called with IPL_BIO*/
 +       /* FIXME: There is a problem with disk(9) api because disk_busy =
 and
 +          disk_unbusy are not protected against concurrent usage and =
 needs
 +          explicit locking from caller.*/
 +       mutex_enter(&dmv->diskp->dk_openlock);
         disk_busy(dmv->diskp);
 +       mutex_exit(&dmv->diskp->dk_openlock);
        =20
         /* Select active table */
         tbl =3D dm_table_get_entry(&dmv->table_head, DM_TABLE_ACTIVE);
 @@ -459,8 +565,10 @@ dmstrategy(struct buf *bp)
         if (issued_len < buf_len)
                 nestiobuf_done(bp, buf_len - issued_len, EINVAL);
 =20
 -       /* FIXME have to be called with SPL_BIO*/
 +       /* FIXME disk_unbusy need to manage locking by itself. */
 +       mutex_enter(&dmv->diskp->dk_openlock);
         disk_unbusy(dmv->diskp, buf_len, bp !=3D NULL ? bp->b_flags & =
 B_READ : 0);
 +       mutex_exit(&dmv->diskp->dk_openlock);
 
 Regards
 
 Adam.
 


Home | Main Index | Thread Index | Old Index