[stgt] [PATCH] Add support for WRITEVERIFY10/12/16

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Sat Jul 14 05:14:17 CEST 2012


On Sat, 14 Jul 2012 13:00:21 +1000
ronnie sahlberg <ronniesahlberg at gmail.com> wrote:

> On Sat, Jul 14, 2012 at 12:54 PM, ronnie sahlberg
> <ronniesahlberg at gmail.com> wrote:
> > On Sat, Jul 14, 2012 at 12:20 PM, FUJITA Tomonori
> > <fujita.tomonori at lab.ntt.co.jp> wrote:
> >> On Sat, 14 Jul 2012 08:30:40 +1000
> >> ronnie sahlberg <ronniesahlberg at gmail.com> wrote:
> >>
> >>> From 7717d0bdaaf1f37943f659390cf20179c6e3c9ef Mon Sep 17 00:00:00 2001
> >>> From: Ronnie Sahlberg <ronniesahlberg at gmail.com>
> >>> Date: Sat, 14 Jul 2012 08:28:26 +1000
> >>> Subject: [PATCH] Add support for WRITEVERIFY10/12/16
> >>
> >> Thanks!
> >>
> >>> Signed-off-by: Ronnie Sahlberg <ronniesahlberg at gmail.com>
> >>> ---
> >>>  usr/bs_rdwr.c |   13 ++++++++++++-
> >>>  usr/sbc.c     |   20 ++++++++++----------
> >>>  usr/scsi.c    |    4 +++-
> >>>  3 files changed, 25 insertions(+), 12 deletions(-)
> >>
> >> (snip)
> >>
> >>> @@ -417,12 +423,6 @@ static int sbc_verify(int host_no, struct scsi_cmd *cmd)
> >>>               goto sense;
> >>>       }
> >>>
> >>> -     bytchk = cmd->scb[1] & 0x02;
> >>> -     if (!bytchk) {
> >>> -             /* no data compare with the media */
> >>> -             return SAM_STAT_GOOD;
> >>> -     }
> >>> -
> >>
> >> What's this change for?
> >
> > There is no BYTCHK flag in WRITEVERIFY*
> > WRITEVERIFY* will always perform a compare to the data.
> > Thats why the check is removed from WRITEVERIFY.
> 
> 
> So the check is moved down into the bs_rdwr() backend instead. And
> there it is only triggered for VERIFY*  commands
> but not for WRITEVERIFY* commands

But VERIFY_* in the previous code with BYTCHK disabled, the command
doesn't go to bs_rdwc.c. But now such commands goes to bs_rdwc.c
unnecessarily? Also looks like the BYTCHK code in bs_rdwc.c leads
memory leak.


--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list