Re: [PATCH 4/4] target/file: enable WRITE SAME when protection info is enabled

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

 



2015-04-21 8:36 GMT+09:00 Akinobu Mita <akinobu.mita@xxxxxxxxx>:
> Now we can generate correct PI for WRITE SAME command, so it is
> unnecessary to disallow WRITE SAME when protection info is enabled.

I noticed that this patch has multiple problems.

> @@ -381,11 +381,6 @@ fd_execute_write_same(struct se_cmd *cmd)
>                 target_complete_cmd(cmd, SAM_STAT_GOOD);
>                 return 0;
>         }
> -       if (cmd->prot_op) {
> -               pr_err("WRITE_SAME: Protection information with FILEIO"
> -                      " backends not supported\n");
> -               return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
> -       }
>
>         if (cmd->t_data_nents > 1 ||
>             cmd->t_data_sg[0].length != cmd->se_dev->dev_attrib.block_size) {
> @@ -401,6 +396,14 @@ fd_execute_write_same(struct se_cmd *cmd)
>         if (!bvec)
>                 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
>
> +       if (cmd->prot_op) {
> +               ret = fd_do_rw(cmd, fd_dev->fd_prot_file, se_dev->prot_length,
> +                               cmd->t_prot_sg, cmd->t_prot_nents,
> +                               cmd->prot_length, 0);

The last argument should be '1' as this is write. and we need to
perform DIF verify
before writing.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux