patch-2.3.99-pre4 linux/drivers/block/rd.c

Next file: linux/drivers/block/xd.c
Previous file: linux/drivers/block/paride/pf.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre3/linux/drivers/block/rd.c linux/drivers/block/rd.c
@@ -333,7 +333,8 @@
 	 * Immunize device against invalidate_buffers() and prune_icache().
 	 */
 	if (rd_inode[DEVICE_NR(inode->i_rdev)] == NULL) {
-		if((rd_inode[DEVICE_NR(inode->i_rdev)] = igrab(inode)) != NULL)
+		if (!inode->i_bdev) return -ENXIO;
+		if ((rd_inode[DEVICE_NR(inode->i_rdev)] = igrab(inode)) != NULL)
 			atomic_inc(&rd_inode[DEVICE_NR(inode->i_rdev)]->i_bdev->bd_openers);
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)