1. 14 May, 2012 1 commit
    • Russell King's avatar
      Fix blkdev.h build errors when BLOCK=n · 85fd0bc9
      Russell King authored
      I see builds failing with:
      
        CC [M]  drivers/mmc/host/dw_mmc.o
      In file included from drivers/mmc/host/dw_mmc.c:15:
      include/linux/blkdev.h:1404: warning: 'struct task_struct' declared inside parameter list
      include/linux/blkdev.h:1404: warning: its scope is only this definition or declaration, which is probably not what you want
      include/linux/blkdev.h:1408: warning: 'struct task_struct' declared inside parameter list
      include/linux/blkdev.h:1413: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'blk_needs_flush_plug'
      make[4]: *** [drivers/mmc/host/dw_mmc.o] Error 1
      
      This is because dw_mmc.c includes linux/blkdev.h as the very first file,
      and when CONFIG_BLOCK=n, blkdev.h omits all includes.
      
      As it requires linux/sched.h even when CONFIG_BLOCK=n, move this out of
      the #ifdef.
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      85fd0bc9
  2. 11 May, 2012 4 commits
    • Bernd Schubert's avatar
      bio allocation failure due to bio_get_nr_vecs() · f908ee94
      Bernd Schubert authored
      The number of bio_get_nr_vecs() is passed down via bio_alloc() to
      bvec_alloc_bs(), which fails the bio allocation if
      nr_iovecs > BIO_MAX_PAGES. For the underlying caller this causes an
      unexpected bio allocation failure.
      Limiting to queue_max_segments() is not sufficient, as max_segments
      also might be very large.
      
      bvec_alloc_bs(gfp_mask, nr_iovecs, ) => NULL when nr_iovecs  > BIO_MAX_PAGES
      bio_alloc_bioset(gfp_mask, nr_iovecs, ...)
      bio_alloc(GFP_NOIO, nvecs)
      xfs_alloc_ioend_bio()
      Signed-off-by: default avatarBernd Schubert <bernd.schubert@itwm.fraunhofer.de>
      Cc: stable@kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f908ee94
    • Jeff Moyer's avatar
      block: don't mark buffers beyond end of disk as mapped · 080399aa
      Jeff Moyer authored
      Hi,
      
      We have a bug report open where a squashfs image mounted on ppc64 would
      exhibit errors due to trying to read beyond the end of the disk.  It can
      easily be reproduced by doing the following:
      
      [root@ibm-p750e-02-lp3 ~]# ls -l install.img
      -rw-r--r-- 1 root root 142032896 Apr 30 16:46 install.img
      [root@ibm-p750e-02-lp3 ~]# mount -o loop ./install.img /mnt/test
      [root@ibm-p750e-02-lp3 ~]# dd if=/dev/loop0 of=/dev/null
      dd: reading `/dev/loop0': Input/output error
      277376+0 records in
      277376+0 records out
      142016512 bytes (142 MB) copied, 0.9465 s, 150 MB/s
      
      In dmesg, you'll find the following:
      
      squashfs: version 4.0 (2009/01/31) Phillip Lougher
      [   43.106012] attempt to access beyond end of device
      [   43.106029] loop0: rw=0, want=277410, limit=277408
      [   43.106039] Buffer I/O error on device loop0, logical block 138704
      [   43.106053] attempt to access beyond end of device
      [   43.106057] loop0: rw=0, want=277412, limit=277408
      [   43.106061] Buffer I/O error on device loop0, logical block 138705
      [   43.106066] attempt to access beyond end of device
      [   43.106070] loop0: rw=0, want=277414, limit=277408
      [   43.106073] Buffer I/O error on device loop0, logical block 138706
      [   43.106078] attempt to access beyond end of device
      [   43.106081] loop0: rw=0, want=277416, limit=277408
      [   43.106085] Buffer I/O error on device loop0, logical block 138707
      [   43.106089] attempt to access beyond end of device
      [   43.106093] loop0: rw=0, want=277418, limit=277408
      [   43.106096] Buffer I/O error on device loop0, logical block 138708
      [   43.106101] attempt to access beyond end of device
      [   43.106104] loop0: rw=0, want=277420, limit=277408
      [   43.106108] Buffer I/O error on device loop0, logical block 138709
      [   43.106112] attempt to access beyond end of device
      [   43.106116] loop0: rw=0, want=277422, limit=277408
      [   43.106120] Buffer I/O error on device loop0, logical block 138710
      [   43.106124] attempt to access beyond end of device
      [   43.106128] loop0: rw=0, want=277424, limit=277408
      [   43.106131] Buffer I/O error on device loop0, logical block 138711
      [   43.106135] attempt to access beyond end of device
      [   43.106139] loop0: rw=0, want=277426, limit=277408
      [   43.106143] Buffer I/O error on device loop0, logical block 138712
      [   43.106147] attempt to access beyond end of device
      [   43.106151] loop0: rw=0, want=277428, limit=277408
      [   43.106154] Buffer I/O error on device loop0, logical block 138713
      [   43.106158] attempt to access beyond end of device
      [   43.106162] loop0: rw=0, want=277430, limit=277408
      [   43.106166] attempt to access beyond end of device
      [   43.106169] loop0: rw=0, want=277432, limit=277408
      ...
      [   43.106307] attempt to access beyond end of device
      [   43.106311] loop0: rw=0, want=277470, limit=2774
      
      Squashfs manages to read in the end block(s) of the disk during the
      mount operation.  Then, when dd reads the block device, it leads to
      block_read_full_page being called with buffers that are beyond end of
      disk, but are marked as mapped.  Thus, it would end up submitting read
      I/O against them, resulting in the errors mentioned above.  I fixed the
      problem by modifying init_page_buffers to only set the buffer mapped if
      it fell inside of i_size.
      
      Cheers,
      Jeff
      Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Acked-by: default avatarNick Piggin <npiggin@kernel.dk>
      
      --
      
      Changes from v1->v2: re-used max_block, as suggested by Nick Piggin.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      080399aa
    • Asai Thambi S P's avatar
      mtip32xx: release the semaphore on an error path · a09ba13e
      Asai Thambi S P authored
      Release the semaphore in an error path in mtip_hw_get_scatterlist(). This
      fixes the smatch warning inconsistent returns.
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarAsai Thambi S P <asamymuthupa@micron.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      a09ba13e
    • Jesper Juhl's avatar
      dac960: Remove unused variables from DAC960_CreateProcEntries() · d88a440e
      Jesper Juhl authored
      The variables 'StatusProcEntry' and 'UserCommandProcEntry' are
      assigned to once and then never used. This patch gets rid of the
      variables.
      
      While I was there I also fixed the indentation of the function to use
      tabs rather than spaces for the lines that did not already do so.
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      d88a440e
  3. 10 May, 2012 22 commits
  4. 09 May, 2012 13 commits