<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/block_dev.c, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/block_dev.c?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/block_dev.c?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-05-11T14:42:14Z</updated>
<entry>
<title>block: don't mark buffers beyond end of disk as mapped</title>
<updated>2012-05-11T14:42:14Z</updated>
<author>
<name>Jeff Moyer</name>
<email>jmoyer@redhat.com</email>
</author>
<published>2012-05-11T14:34:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=080399aaaf3531f5b8761ec0ac30ff98891e8686'/>
<id>urn:sha1:080399aaaf3531f5b8761ec0ac30ff98891e8686</id>
<content type='text'>
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: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Acked-by: Nick Piggin &lt;npiggin@kernel.dk&gt;

--

Changes from v1-&gt;v2: re-used max_block, as suggested by Nick Piggin.
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>magic.h: move some FS magic numbers into magic.h</title>
<updated>2012-03-23T23:58:31Z</updated>
<author>
<name>Muthu Kumar</name>
<email>muthu.lkml@gmail.com</email>
</author>
<published>2012-03-23T22:01:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b502bd1152472dc1b98c60434f23c23b280c7b94'/>
<id>urn:sha1:b502bd1152472dc1b98c60434f23c23b280c7b94</id>
<content type='text'>
- Move open-coded filesystem magic numbers into magic.h

- Rearrange magic.h so that the filesystem-related constants are grouped
  together.

Signed-off-by: Muthukumar R &lt;muthur@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'stable/cleancache.v13' into linux-next</title>
<updated>2012-03-19T16:12:19Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2012-03-19T16:12:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=16c0cfa425b8e1488f7a1873bd112a7a099325f0'/>
<id>urn:sha1:16c0cfa425b8e1488f7a1873bd112a7a099325f0</id>
<content type='text'>
* stable/cleancache.v13:
  mm: cleancache: Use __read_mostly as appropiate.
  mm: cleancache: report statistics via debugfs instead of sysfs.
  mm: zcache/tmem/cleancache: s/flush/invalidate/
  mm: cleancache: s/flush/invalidate/
</content>
</entry>
<entry>
<title>block: Fix NULL pointer dereference in sd_revalidate_disk</title>
<updated>2012-03-02T09:38:33Z</updated>
<author>
<name>Jun'ichi Nomura</name>
<email>j-nomura@ce.jp.nec.com</email>
</author>
<published>2012-03-02T09:38:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fe316bf2d5847bc5dd975668671a7b1067603bc7'/>
<id>urn:sha1:fe316bf2d5847bc5dd975668671a7b1067603bc7</id>
<content type='text'>
Since 2.6.39 (1196f8b), when a driver returns -ENOMEDIUM for open(),
__blkdev_get() calls rescan_partitions() to remove
in-kernel partition structures and raise KOBJ_CHANGE uevent.

However it ends up calling driver's revalidate_disk without open
and could cause oops.

In the case of SCSI:

  process A                  process B
  ----------------------------------------------
  sys_open
    __blkdev_get
      sd_open
        returns -ENOMEDIUM
                             scsi_remove_device
                               &lt;scsi_device torn down&gt;
      rescan_partitions
        sd_revalidate_disk
          &lt;oops&gt;
Oopses are reported here:
http://marc.info/?l=linux-scsi&amp;m=132388619710052

This patch separates the partition invalidation from rescan_partitions()
and use it for -ENOMEDIUM case.

Reported-by: Huajun Li &lt;huajun.li.lee@gmail.com&gt;
Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>mm: cleancache: s/flush/invalidate/</title>
<updated>2012-01-23T21:06:24Z</updated>
<author>
<name>Dan Magenheimer</name>
<email>dan.magenheimer@oracle.com</email>
</author>
<published>2011-09-21T15:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3167760f83899ccda312b9ad9306ec9e5dda06d4'/>
<id>urn:sha1:3167760f83899ccda312b9ad9306ec9e5dda06d4</id>
<content type='text'>
Per akpm suggestions alter the use of the term flush to be
invalidate. The next patch will do this across all MM.

This change is completely cosmetic.

[v9: akpm@linux-foundation.org: change "flush" to "invalidate", part 3]

Signed-off-by: Dan Magenheimer &lt;dan.magenheimer@oracle.com&gt;
Cc: Kamezawa Hiroyuki &lt;kamezawa.hiroyu@jp.fujitsu.com&gt;
Cc: Jan Beulich &lt;JBeulich@novell.com&gt;
Reviewed-by: Seth Jennings &lt;sjenning@linux.vnet.ibm.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: Matthew Wilcox &lt;matthew@wil.cx&gt;
Cc: Chris Mason &lt;chris.mason@oracle.com&gt;
Cc: Rik Riel &lt;riel@redhat.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
[v10: Fixed  fs: move code out of buffer.c conflict change]
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
</content>
</entry>
<entry>
<title>vfs: cache request_queue in struct block_device</title>
<updated>2012-01-13T04:13:12Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2012-01-13T01:20:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=87192a2a49c475cf322cb143e0fa63b0102d8567'/>
<id>urn:sha1:87192a2a49c475cf322cb143e0fa63b0102d8567</id>
<content type='text'>
This makes it possible to get from the inode to the request_queue with one
less cache miss.  Used in followon optimization.

The livetime of the pointer is the same as the gendisk.

This assumes that the queue will always stay the same in the gendisk while
it's visible to block_devices.  I think that's safe correct?

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Acked-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>block_dev: Suppress bdev_cache_init() kmemleak warninig</title>
<updated>2012-01-10T18:08:55Z</updated>
<author>
<name>Sergey Senozhatsky</name>
<email>sergey.senozhatsky@gmail.com</email>
</author>
<published>2012-01-09T23:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ace8577aeb438025ecf642f5eda3aa551d251951'/>
<id>urn:sha1:ace8577aeb438025ecf642f5eda3aa551d251951</id>
<content type='text'>
Kmemleak reports the following warning in bdev_cache_init()
[    0.003738] kmemleak: Object 0xffff880153035200 (size 256):
[    0.003823] kmemleak:   comm "swapper/0", pid 0, jiffies 4294667299
[    0.003909] kmemleak:   min_count = 1
[    0.003988] kmemleak:   count = 0
[    0.004066] kmemleak:   flags = 0x1
[    0.004144] kmemleak:   checksum = 0
[    0.004224] kmemleak:   backtrace:
[    0.004303]      [&lt;ffffffff814755ac&gt;] kmemleak_alloc+0x21/0x3e
[    0.004446]      [&lt;ffffffff811100ba&gt;] kmem_cache_alloc+0xca/0x1dc
[    0.004592]      [&lt;ffffffff811371b1&gt;] alloc_vfsmnt+0x1f/0x198
[    0.004736]      [&lt;ffffffff811375c5&gt;] vfs_kern_mount+0x36/0xd2
[    0.004879]      [&lt;ffffffff8113929a&gt;] kern_mount_data+0x18/0x32
[    0.005025]      [&lt;ffffffff81ab9075&gt;] bdev_cache_init+0x51/0x81
[    0.005169]      [&lt;ffffffff81ab8abf&gt;] vfs_caches_init+0x101/0x10d
[    0.005313]      [&lt;ffffffff81a9bae3&gt;] start_kernel+0x344/0x383
[    0.005456]      [&lt;ffffffff81a9b2a7&gt;] x86_64_start_reservations+0xae/0xb2
[    0.005602]      [&lt;ffffffff81a9b3ad&gt;] x86_64_start_kernel+0x102/0x111
[    0.005747]      [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff
[    0.008653] kmemleak: Trying to color unknown object at 0xffff880153035220 as Grey
[    0.008754] Pid: 0, comm: swapper/0 Not tainted 3.3.0-rc0-dbg-04200-g8180888-dirty #888
[    0.008856] Call Trace:
[    0.008934]  [&lt;ffffffff81118704&gt;] ? find_and_get_object+0x44/0x118
[    0.009023]  [&lt;ffffffff81118fe6&gt;] paint_ptr+0x57/0x8f
[    0.009109]  [&lt;ffffffff81475935&gt;] kmemleak_not_leak+0x23/0x42
[    0.009195]  [&lt;ffffffff81ab9096&gt;] bdev_cache_init+0x72/0x81
[    0.009282]  [&lt;ffffffff81ab8abf&gt;] vfs_caches_init+0x101/0x10d
[    0.009368]  [&lt;ffffffff81a9bae3&gt;] start_kernel+0x344/0x383
[    0.009466]  [&lt;ffffffff81a9b2a7&gt;] x86_64_start_reservations+0xae/0xb2
[    0.009555]  [&lt;ffffffff81a9b140&gt;] ? early_idt_handlers+0x140/0x140
[    0.009643]  [&lt;ffffffff81a9b3ad&gt;] x86_64_start_kernel+0x102/0x111

due to attempt to mark pointer to `struct vfsmount' as a gray object, which
is embedded into `struct mount' returned from alloc_vfsmnt().

Make `bd_mnt' static, avoiding need to tell kmemleak to mark it gray, as
suggested by Al Viro.

Signed-off-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs: move code out of buffer.c</title>
<updated>2012-01-04T03:54:07Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-09-16T06:31:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff01bb4832651c6d25ac509a06a10fcbd75c461c'/>
<id>urn:sha1:ff01bb4832651c6d25ac509a06a10fcbd75c461c</id>
<content type='text'>
Move invalidate_bdev, block_sync_page into fs/block_dev.c.  Export
kill_bdev as well, so brd doesn't have to open code it.  Reduce
buffer_head.h requirement accordingly.

Removed a rather large comment from invalidate_bdev, as it looked a bit
obsolete to bother moving.  The small comment replacing it says enough.

Signed-off-by: Nick Piggin &lt;npiggin@suse.de&gt;
Cc: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>vfs: fix the stupidity with i_dentry in inode destructors</title>
<updated>2012-01-04T03:52:40Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-12-12T20:51:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6b520e0565422966cdf1c3759bd73df77b0f248c'/>
<id>urn:sha1:6b520e0565422966cdf1c3759bd73df77b0f248c</id>
<content type='text'>
Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
the cost of taking it into inode_init_always() will be negligible for pipes
and sockets and negative for everything else.  Not to mention the removal of
boilerplate code from -&gt;destroy_inode() instances...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>trim fs/internal.h</title>
<updated>2012-01-04T03:52:35Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-11-22T02:15:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f47ec3f28354795f000c14bf18ed967ec81a3ec3'/>
<id>urn:sha1:f47ec3f28354795f000c14bf18ed967ec81a3ec3</id>
<content type='text'>
some stuff in there can actually become static; some belongs to pnode.h
as it's a private interface between namespace.c and pnode.c...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
