Re: tcm_loopback broken in for-next of target-pending

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

 



On 12/05/2012 08:13 AM, Nicholas A. Bellinger wrote:
diff --git a/drivers/target/target_core_file.c
b/drivers/target/target_core_file.c
index 0360383..319b87a 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -260,7 +260,7 @@ static int fd_do_readv(struct se_cmd *cmd, struct
scatterlist *sgl,

          for_each_sg(sgl, sg, sgl_nents, i) {
                  iov[i].iov_len = sg->length;
-               iov[i].iov_base = sg_virt(sg);
+               iov[i].iov_base = kmap(sg_page(sg));
          }

          old_fs = get_fs();
@@ -268,6 +268,10 @@ static int fd_do_readv(struct se_cmd *cmd, struct
scatterlist *sgl,
          ret = vfs_readv(fd,&iov[0], sgl_nents,&pos);
          set_fs(old_fs);

+       for_each_sg(sgl, sg, sgl_nents, i) {
+               kunmap(sg_page(sg));
+       }
+
          kfree(iov);
          /*
           * Return zeros and GOOD status even if the READ did not return

Does not work. It bails out even earlier, before the XFS mount
completes. That means the complete code is not highmem aware and it
simply works because page_address() returns something that does not
cause a fault and the memory is not important enough to crash the box.


Mmmm..  Christoph, what do you think for the highmem FILEIO case..?

Just sent a fix. I forgot to add the offset… Oh well.

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


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux