Skip to contentSkip to conversation

2.4.9-pre3 s390 patch for partition code

PATCH Pete Zaitcev 1 participant 1 message Mar 15, 2002 VFS

lore
Share & tools
lore
#0 lore raw

This is a patch that I extracted from a tarball received last week. It is said to be failed by Marcelo for 2.4.18, but something is need to fix this.

To that end, I considered pulling ioctls and replacing them with reads, but it is too much work. So, I talked to Al Viro and secured his help to have ioctl_by_bdev working at check_part() time with a proper fix. Before it is available, I suggest we push the fs/block_dev.c change into 2.4.19-preX as a stop-gap.

The fs/partitions/ibm.c change from the tarball was useful, but I *STRONGLY* disagree with putting so much crap on the stack. It may explain why we have so much trouble with stacks on s390:
they are simply overused. I changed the code to allocate structures properly. This should go in regartless of Al's work on ioctl.

-- Pete

fs/block_dev.c +9 -2
diff -ur -X dontdiff linux-2.4.19-pre3/fs/block_dev.c linux-2.4.19-pre3-390/fs/block_dev.c
@@ -530,11 +530,18 @@
 {
 	int res;
 	mm_segment_t old_fs = get_fs();
+	const struct block_device_operations *bd_op;
 
-	if (!bdev->bd_op->ioctl)
+	bd_op = bdev->bd_op;
+	if (bd_op == NULL) {
+		bd_op = blkdevs[MAJOR(to_kdev_t(bdev->bd_dev))].bdops;
+		if (bd_op == NULL)
+			return -EINVAL;
+	}
+	if (!bd_op->ioctl)
 		return -EINVAL;
 	set_fs(KERNEL_DS);
-	res = bdev->bd_op->ioctl(bdev->bd_inode, NULL, cmd, arg);
+	res = bd_op->ioctl(bdev->bd_inode, NULL, cmd, arg);
 	set_fs(old_fs);
 	return res;
 }
fs/partitions/Makefile +1 -1
diff -ur -X dontdiff linux-2.4.19-pre3/fs/partitions/Makefile linux-2.4.19-pre3-390/fs/partitions/Makefile
@@ -9,7 +9,7 @@
 
 O_TARGET := partitions.o
 
-export-objs := check.o ibm.o
+export-objs := check.o
 
 obj-y := check.o
 
fs/partitions/ibm.c +125 -132

295 lines not on this page · raw message