NetBSD-Bugs archive

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

Re: kern/47940: "discard" ffs mount option does not work on wedges



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

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/47940: "discard" ffs mount option does not work on wedges
Date: Mon, 17 Jun 2013 11:36:20 -0400

 On Jun 17,  3:15pm, riz%NetBSD.org@localhost (riz%NetBSD.org@localhost) wrote:
 -- Subject: kern/47940: "discard" ffs mount option does not work on wedges
 
 | +    case DIOCGDISCARDPARAMS:
 | +            error = VOP_IOCTL(sc->sc_parent->dk_rawvp, cmd, data, flag,
 | +                              l != NULL ? l->l_cred : NOCRED);
 | +            break;
 | +
 | +    case DIOCDISCARD: {
 | +            struct disk_discard_range *dr;
 | +
 | +            dr = (struct disk_discard_range *)data;
 
 The cast is not needed since data is void *.
 
 | +#define DSIZE sc->sc_parent->dk_geom.dg_secperunit
 | +            if (dr->size > (DSIZE - sc->sc_offset))
 | +                return EINVAL;
 | +            if (dr->bno > DSIZE - sc->sc_offset - dr->size)
 | +                return EINVAL;
 | +            dr->bno += sc->sc_offset;
 | +            if (dr->bno > DSIZE)
 | +                return EINVAL;
 
 These values are all signed so they should not be allowed to be negative.
 
 christos
 


Home | Main Index | Thread Index | Old Index