| To: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 2/9] db: verify buffer on type change |
| From: | Dave Chinner <david@xxxxxxxxxxxxx> |
| Date: | Tue, 22 Apr 2014 09:14:02 +1000 |
| Cc: | xfs@xxxxxxxxxxx |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <20140421070252.GD20384@xxxxxxxxxxxxx> |
| References: | <1397550301-31883-1-git-send-email-david@xxxxxxxxxxxxx> <1397550301-31883-3-git-send-email-david@xxxxxxxxxxxxx> <20140421070252.GD20384@xxxxxxxxxxxxx> |
| User-agent: | Mutt/1.5.21 (2010-09-15) |
On Mon, Apr 21, 2014 at 12:02:52AM -0700, Christoph Hellwig wrote:
> > +void
> > +set_iocur_type(
> > + const typ_t *t)
> > +{
> > + const struct xfs_buf_ops *ops = t ? t->bops : NULL;
> > + struct xfs_buf *bp = iocur_top->bp;
> > +
> > + iocur_top->typ = t;
> > +
> > + /* verify the buffer if the type has one. */
> > + if (!bp)
> > + return;
> > + if (!ops) {
> > + bp->b_ops = NULL;
> > + bp->b_flags |= LIBXFS_B_UNCHECKED;
> > + return;
> > + }
>
> The only caller currently makes sure we never pass a NULL t argument,
> and I think keeping it that way is sensible. If we want to allow
> clearing the type we should add a separate clear_iocur_type helper for
> it.
Ok, I'll clear the conditional initialisation of *ops.
--
Dave Chinner
david@xxxxxxxxxxxxx
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 1/9] db: don't claim unchecked CRCs are correct, Dave Chinner |
|---|---|
| Next by Date: | Re: [PATCH 9/9] repair: detect and handle attribute tree CRC errors, Dave Chinner |
| Previous by Thread: | Re: [PATCH 2/9] db: verify buffer on type change, Christoph Hellwig |
| Next by Thread: | [PATCH 3/9] repair: ensure prefetched buffers have CRCs validated, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |