<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/block_dev.c, branch v3.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2011-06-13T10:45:48Z</updated>
<entry>
<title>block: use the passed in @bdev when claiming if partno is zero</title>
<updated>2011-06-13T10:45:48Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-06-13T10:45:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4c208b86b8be4254eba0e74071496e599f94639'/>
<id>urn:sha1:d4c208b86b8be4254eba0e74071496e599f94639</id>
<content type='text'>
6b4517a791 (block: implement bd_claiming and claiming block)
introduced claiming block to support O_EXCL blkdev opens properly.

bd_start_claiming() looks up the part 0 bdev and starts claiming
block.  The function assumed that there is only one part 0 bdev and
always used bdget_disk(disk, 0) to look it up; unfortunately, this
isn't true for some drivers (floppy) which use multiple block devices
to denote different operating parameters for the same physical device.
There can be multiple part 0 bdev's for the same device number.

This incorrect assumption caused the wrong bdev to be used during
claiming leading to unbalanced bd_holders as reported in the following
bug.

  https://bugzilla.kernel.org/show_bug.cgi?id=28522

This patch updates bd_start_claiming() such that it uses the bdev
specified as argument if its partno is zero.

Note that this means that different bdev's can be used for the same
device and O_EXCL check can be effectively bypassed.  It has always
been broken that way and floppy is fortunately on its way out.  Leave
that breakage alone.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Alex Villacis Lasso &lt;avillaci@ceibo.fiec.espol.edu.ec&gt;
Tested-by: Alex Villacis Lasso &lt;avillaci@ceibo.fiec.espol.edu.ec&gt;
Cc: stable@kernel.org	# &gt;= v2.6.36
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: blkdev_get() should access -&gt;bd_disk only after success</title>
<updated>2011-06-01T06:28:47Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-06-01T06:27:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4c49ff3fe128ca68dabd07537415c419ad7f82f9'/>
<id>urn:sha1:4c49ff3fe128ca68dabd07537415c419ad7f82f9</id>
<content type='text'>
d4dc210f69 (block: don't block events on excl write for non-optical
devices) added dereferencing of bdev-&gt;bd_disk to test
GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE; however, bdev-&gt;bd_disk can be
%NULL if open failed which can lead to an oops.

Test the flag after testing open was successful, not before.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: David Miller &lt;davem@davemloft.net&gt;
Tested-by: David Miller &lt;davem@davemloft.net&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: move bd_set_size() above rescan_partitions() in __blkdev_get()</title>
<updated>2011-05-23T11:26:07Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-05-23T11:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7e69723fef8771a9d57bd27d36281d756130b4b5'/>
<id>urn:sha1:7e69723fef8771a9d57bd27d36281d756130b4b5</id>
<content type='text'>
02e352287a4 (block: rescan partitions on invalidated devices on
-ENOMEDIA too) relocated partition rescan above explicit bd_set_size()
to simplify condition check.  As rescan_partitions() does its own bdev
size setting, this doesn't break anything; however,
rescan_partitions() prints out the following messages when adjusting
bdev size, which can be confusing.

  sda: detected capacity change from 0 to 146815737856
  sdb: detected capacity change from 0 to 146815737856

This patch restores the original order and remove the warning
messages.

stable: Please apply together with 02e352287a4 (block: rescan
        partitions on invalidated devices on -ENOMEDIA too).

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Tony Luck &lt;tony.luck@gmail.com&gt;
Tested-by: Tony Luck &lt;tony.luck@gmail.com&gt;
Cc: stable@kernel.org

Stable note: 2.6.39 only.
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: don't block events on excl write for non-optical devices</title>
<updated>2011-04-21T18:54:46Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-04-21T18:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d4dc210f69bcb0b4bef5a83b1c323817be89bad1'/>
<id>urn:sha1:d4dc210f69bcb0b4bef5a83b1c323817be89bad1</id>
<content type='text'>
Disk event code automatically blocks events on excl write.  This is
primarily to avoid issuing polling commands while burning is in
progress.  This behavior doesn't fit other types of devices with
removeable media where polling commands don't have adverse side
effects and door locking usually doesn't exist.

This patch introduces new genhd flag which controls the auto-blocking
behavior and uses it to enable auto-blocking only on optical devices.

Note for stable: 2.6.38 and later only

Cc: stable@kernel.org
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: rescan partitions on invalidated devices on -ENOMEDIA too</title>
<updated>2011-04-21T18:54:45Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-04-21T18:54:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1196f8b814f32cd04df334abf47648c2a9fd8324'/>
<id>urn:sha1:1196f8b814f32cd04df334abf47648c2a9fd8324</id>
<content type='text'>
__blkdev_get() doesn't rescan partitions if disk-&gt;fops-&gt;open() fails,
which leads to ghost partition devices lingering after medimum removal
is known to both the kernel and userland.  The behavior also creates a
subtle inconsistency where O_NONBLOCK open, which doesn't fail even if
there's no medium, clears the ghots partitions, which is exploited to
work around the problem from userland.

Fix it by updating __blkdev_get() to issue partition rescan after
-ENOMEDIA too.

This was reported in the following bz.

 https://bugzilla.kernel.org/show_bug.cgi?id=13029

Note for stable: 2.6.38 and later only

Cc: stable@kernel.org
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: David Zeuthen &lt;zeuthen@gmail.com&gt;
Reported-by: Martin Pitt &lt;martin.pitt@ubuntu.com&gt;
Reported-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Tested-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6</title>
<updated>2011-03-25T02:01:30Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-03-25T02:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d39dd11c3e6a7af5c20bfac40594db36cf270f42'/>
<id>urn:sha1:d39dd11c3e6a7af5c20bfac40594db36cf270f42</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  fs: simplify iget &amp; friends
  fs: pull inode-&gt;i_lock up out of writeback_single_inode
  fs: rename inode_lock to inode_hash_lock
  fs: move i_wb_list out from under inode_lock
  fs: move i_sb_list out from under inode_lock
  fs: remove inode_lock from iput_final and prune_icache
  fs: Lock the inode LRU list separately
  fs: factor inode disposal
  fs: protect inode-&gt;i_state with inode-&gt;i_lock
  autofs4: Do not potentially dereference NULL pointer returned by fget() in autofs_dev_ioctl_setpipefd()
  autofs4 - remove autofs4_lock
  autofs4 - fix d_manage() return on rcu-walk
  autofs4 - fix autofs4_expire_indirect() traversal
  autofs4 - fix dentry leak in autofs4_expire_direct()
  autofs4 - reinstate last used update on access
  vfs - check non-mountpoint dentry might block in __follow_mount_rcu()
</content>
</entry>
<entry>
<title>fs: move i_wb_list out from under inode_lock</title>
<updated>2011-03-25T01:17:51Z</updated>
<author>
<name>Dave Chinner</name>
<email>dchinner@redhat.com</email>
</author>
<published>2011-03-22T11:23:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a66979abad090b2765a6c6790c9fdeab996833f2'/>
<id>urn:sha1:a66979abad090b2765a6c6790c9fdeab996833f2</id>
<content type='text'>
Protect the inode writeback list with a new global lock
inode_wb_list_lock and use it to protect the list manipulations and
traversals. This lock replaces the inode_lock as the inodes on the
list can be validity checked while holding the inode-&gt;i_lock and
hence the inode_lock is no longer needed to protect the list.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs: protect inode-&gt;i_state with inode-&gt;i_lock</title>
<updated>2011-03-25T01:16:31Z</updated>
<author>
<name>Dave Chinner</name>
<email>dchinner@redhat.com</email>
</author>
<published>2011-03-22T11:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=250df6ed274d767da844a5d9f05720b804240197'/>
<id>urn:sha1:250df6ed274d767da844a5d9f05720b804240197</id>
<content type='text'>
Protect inode state transitions and validity checks with the
inode-&gt;i_lock. This enables us to make inode state transitions
independently of the inode_lock and is the first step to peeling
away the inode_lock from the code.

This requires that __iget() is done atomically with i_state checks
during list traversals so that we don't race with another thread
marking the inode I_FREEING between the state check and grabbing the
reference.

Also remove the unlock_new_inode() memory barrier optimisation
required to avoid taking the inode_lock when clearing I_NEW.
Simplify the code by simply taking the inode-&gt;i_lock around the
state change and wakeup. Because the wakeup is no longer tricky,
remove the wake_up_inode() function and open code the wakeup where
necessary.

Signed-off-by: Dave Chinner &lt;dchinner@redhat.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>block: NULL dereference on error path in __blkdev_get()</title>
<updated>2011-03-19T12:53:31Z</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2011-03-19T12:53:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4345caba340f051e10847924fc078ae18ed6695c'/>
<id>urn:sha1:4345caba340f051e10847924fc078ae18ed6695c</id>
<content type='text'>
"disk" is always NULL when we goto out.  There was a check for this
before, but it was removed in 69e02c59a7d9 "block: Don't check events
while open is in progress".

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@carl&gt;
</content>
</entry>
</feed>
