Re: simplify procfs code for seq_file instances V2
On Sun, May 06, 2018 at 06:45:31PM +0100, Al Viro wrote: > On Sun, May 06, 2018 at 08:19:49PM +0300, Alexey Dobriyan wrote: > > @@ -62,9 +62,9 @@ struct proc_dir_entry { > > umode_t mode; > > u8 namelen; > > #ifdef CONFIG_64BIT > > -#define SIZEOF_PDE_INLINE_NAME (192-139) > > +#define SIZEOF_PDE_INLINE_NAME (192-155) > > #else > > -#define SIZEOF_PDE_INLINE_NAME (128-87) > > +#define SIZEOF_PDE_INLINE_NAME (128-95) > > > #endif > > char inline_name[SIZEOF_PDE_INLINE_NAME]; > > } __randomize_layout; > > *UGH* I agree. Maintaining these numbers is a pain point. Who knew people were going to start adding fields right away. > Both to the original state and that kind of "adjustments". > Incidentally, with __bugger_layout in there these expressions > are simply wrong. Struct randomization is exempt from maintaining sizeof as they are already screwing cachelines and everything. But if patch works with lockdep and randomization -- even better. > If nothing else, I would suggest turning the last one into > char inline_name[]; > in hope that layout won't get... randomized that much and > used > > #ifdef CONFIG_64BIT > #define PDE_SIZE 192 > #else > #define PDE_SIZE 128 > #endif > > union __proc_dir_entry { > char pad[PDE_SIZE]; > struct proc_dir_entry real; > }; > > #define SIZEOF_PDE_INLINE_NAME (PDE_SIZE - offsetof(struct proc_dir_entry, > inline_name)) > > for constants, adjusted sizeof and sizeof_field when creating > proc_dir_entry_cache and turned proc_root into > > union __proc_dir_entry __proc_root = { .real = { > .low_ino= PROC_ROOT_INO, > .namelen= 5, > .mode = S_IFDIR | S_IRUGO | S_IXUGO, > .nlink = 2, > .refcnt = REFCOUNT_INIT(1), > .proc_iops = _root_inode_operations, > .proc_fops = _root_operations, > .parent = &__proc_root.real, > .subdir = RB_ROOT, > .name = __proc_root.real.inline_name, > .inline_name= "/proc", > }}; > > #define proc_root __proc_root.real > (or actually used __proc_root.real in all of a 6 places where it remains). > > > - size_t state_size = PDE(inode)->state_size; > > + unsigned int state_size = PDE(inode)->state_size; > > > You and your "size_t is evil" crusade... [nods] unsigned long flags; /* error bits */ unsigned long i_state; unsigned long s_blocksize; unsigned long s_flags; unsigned long s_iflags; /* internal SB_I_* flags */
Re: simplify procfs code for seq_file instances V2
On Wed, Apr 25, 2018 at 05:47:47PM +0200, Christoph Hellwig wrote: > Changes since V1: > - open code proc_create_data to avoid setting not fully initialized >entries live > - use unsigned int for state_size Need this to maintain sizeof(struct proc_dir_entry): Otherwise ACK fs/proc/ part. diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 6d171485c45b..a318ae5b36b4 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -48,8 +48,8 @@ struct proc_dir_entry { const struct seq_operations *seq_ops; int (*single_show)(struct seq_file *, void *); }; - unsigned int state_size; void *data; + unsigned int state_size; unsigned int low_ino; nlink_t nlink; kuid_t uid; @@ -62,9 +62,9 @@ struct proc_dir_entry { umode_t mode; u8 namelen; #ifdef CONFIG_64BIT -#define SIZEOF_PDE_INLINE_NAME (192-139) +#define SIZEOF_PDE_INLINE_NAME (192-155) #else -#define SIZEOF_PDE_INLINE_NAME (128-87) +#define SIZEOF_PDE_INLINE_NAME (128-95) #endif char inline_name[SIZEOF_PDE_INLINE_NAME]; } __randomize_layout; diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index baf1994289ce..7d94fa005b0d 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -40,7 +40,7 @@ static struct net *get_proc_net(const struct inode *inode) static int seq_open_net(struct inode *inode, struct file *file) { - size_t state_size = PDE(inode)->state_size; + unsigned int state_size = PDE(inode)->state_size; struct seq_net_private *p; struct net *net;
Re: simplify procfs code for seq_file instances
On Tue, Apr 24, 2018 at 06:06:53PM +0200, Christoph Hellwig wrote: > On Tue, Apr 24, 2018 at 08:19:16AM -0700, Andrew Morton wrote: > > > > I want to ask if it is time to start using poorman function overloading > > > > with _b_c_e(). There are millions of allocation functions for example, > > > > all slightly difference, and people will add more. Seeing /proc > > > > interfaces > > > > doubled like this is painful. > > > > > > Function overloading is totally unacceptable. > > > > > > And I very much disagree with a tradeoff that keeps 5000 lines of > > > code vs a few new helpers. > > > > OK, the curiosity and suspense are killing me. What the heck is > > "function overloading with _b_c_e()"? > > The way I understood Alexey was to use have a proc_create macro > that can take different ops types. Although the short cut for > __builtin_types_compatible_p would be _b_t_c or similar, so maybe > I misunderstood him. That's correct. I also think that several dozens kmalloc signatures are a problem. And there will be more with pmalloc* stuff and more 2D/3D array checked allocations and who knows what. And I want to add typed kmalloc!
Re: simplify procfs code for seq_file instances
> git://git.infradead.org/users/hch/misc.git proc_create I want to ask if it is time to start using poorman function overloading with _b_c_e(). There are millions of allocation functions for example, all slightly difference, and people will add more. Seeing /proc interfaces doubled like this is painful.
Re: [PATCH 03/39] proc: introduce proc_create_seq_private
On Thu, Apr 19, 2018 at 02:41:04PM +0200, Christoph Hellwig wrote: > Variant of proc_create_data that directly take a struct seq_operations > --- a/fs/proc/internal.h > +++ b/fs/proc/internal.h > @@ -45,6 +45,7 @@ struct proc_dir_entry { > const struct inode_operations *proc_iops; > const struct file_operations *proc_fops; > const struct seq_operations *seq_ops; > + size_t state_size; "unsigned int" please. Where have you seen 4GB priv states?
Re: [PATCH 14/39] proc: introduce proc_create_net_single
On Thu, Apr 19, 2018 at 02:41:15PM +0200, Christoph Hellwig wrote: > Variant of proc_create_data that directly take a seq_file show > +struct proc_dir_entry *proc_create_net_single(const char *name, umode_t mode, > + struct proc_dir_entry *parent, > + int (*show)(struct seq_file *, void *), void *data) > +{ > + struct proc_dir_entry *p; > + > + p = proc_create_data(name, mode, parent, _net_single_fops, data); > + if (p) > + p->single_show = show; > + return p; > +} Ditto, should be oopsable.
Re: [PATCH 02/39] proc: introduce proc_create_seq{,_data}
On Thu, Apr 19, 2018 at 02:41:03PM +0200, Christoph Hellwig wrote: > Variants of proc_create{,_data} that directly take a struct seq_operations > argument and drastically reduces the boilerplate code in the callers. > +static int proc_seq_open(struct inode *inode, struct file *file) > +{ > + struct proc_dir_entry *de = PDE(inode); > + > + return seq_open(file, de->seq_ops); > +} > + > +static const struct file_operations proc_seq_fops = { > + .open = proc_seq_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release= seq_release, > +}; > + > +struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode, > + struct proc_dir_entry *parent, const struct seq_operations *ops, > + void *data) > +{ > + struct proc_dir_entry *p; > + > + p = proc_create_data(name, mode, parent, _seq_fops, data); > + if (p) > + p->seq_ops = ops; > + return p; > +} Should be oopsable. Once proc_create_data() returns, entry is live, ->open can be called. > --- a/fs/proc/internal.h > +++ b/fs/proc/internal.h > @@ -44,6 +44,7 @@ struct proc_dir_entry { > struct completion *pde_unload_completion; > const struct inode_operations *proc_iops; > const struct file_operations *proc_fops; > + const struct seq_operations *seq_ops; > void *data; > unsigned int low_ino; > nlink_t nlink; "struct proc_dir_entry is 192/128 bytes now. If someone knows how to pad array to certain size without union please tell.
Re: 2.6.24-rc4-mm1 and excessive block IO errors
On Fri, Dec 07, 2007 at 03:05:37PM -0800, Andrew Morton wrote: On Fri, 07 Dec 2007 20:44:45 + Zan Lynx [EMAIL PROTECTED] wrote: I am not sure if this problem has been addressed already. I read some about the fast-fail issues and this may be related? On nearly all my USB block devices, I have been getting zillions of I/O errors. But they aren't real, they don't appear with 2.6.23 kernels. I can often read and write data to the device, but these IO errors cause error aborts in user space applications in many cases, making it a chancy thing to run backup software, for example. Here is a bit of dmesg from plugging in a perfectly good USB-2 flash drive. hub 3-0:1.0: state 7 ports 6 chg evt 0004 ehci_hcd :00:02.2: GetStatus port 2 status 001803 POWER sig=j CSC CONNECT hub 3-0:1.0: port 2, status 0501, change 0001, 480 Mb/s hub 3-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x501 ehci_hcd :00:02.2: port 2 high speed ehci_hcd :00:02.2: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT usb 3-2: new high speed USB device using ehci_hcd and address 9 ehci_hcd :00:02.2: port 2 high speed ehci_hcd :00:02.2: GetStatus port 2 status 001005 POWER sig=se0 PE CONNECT usb 3-2: default language 0x0409 usb 3-2: uevent usb 3-2: usb_probe_device usb 3-2: configuration #1 chosen from 1 choice usb 3-2: adding 3-2:1.0 (config #1, interface 0) usb 3-2:1.0: uevent libusual 3-2:1.0: usb_probe_interface libusual 3-2:1.0: usb_probe_interface - got id usb-storage 3-2:1.0: usb_probe_interface usb-storage 3-2:1.0: usb_probe_interface - got id scsi4 : SCSI emulation for USB Mass Storage devices drivers/usb/core/inode.c: creating file '009' usb 3-2: New USB device found, idVendor=05dc, idProduct=a400 usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 3-2: Product: JUMPDRIVE usb 3-2: Manufacturer: LEXAR MEDIA usb 3-2: SerialNumber: 0A4EEC05201219080904 usb-storage: device found at 9 usb-storage: waiting for device to settle before scanning usb-storage: device scan complete scsi 4:0:0:0: Direct-Access LEXARJUMPDRIVE1000 PQ: 0 ANSI: 0 CCS sd 4:0:0:0: [sdg] 2026592 512-byte hardware sectors (1038 MB) sd 4:0:0:0: [sdg] Write Protect is off sd 4:0:0:0: [sdg] Mode Sense: 43 00 00 00 sd 4:0:0:0: [sdg] Assuming drive cache: write through sd 4:0:0:0: [sdg] 2026592 512-byte hardware sectors (1038 MB) sd 4:0:0:0: [sdg] Write Protect is off sd 4:0:0:0: [sdg] Mode Sense: 43 00 00 00 sd 4:0:0:0: [sdg] Assuming drive cache: write through sdg: sdg1 sd 4:0:0:0: [sdg] Attached SCSI removable disk sd 4:0:0:0: Attached scsi generic sg7 type 0 sd 4:0:0:0: [sdg] Result: hostbyte=0x01 driverbyte=0x00 end_request: I/O error, dev sdg, sector 3984 Yes, this is breakage in the scsi tree. I believe that the offending patch has been found and I have a nasty fix somewhere in my inbox - it involves reverting a patch which doesn't revert properly. I haven't got onto looking at it yet, sorry. Zan, check this thread http://marc.info/?t=11968982411r=1w=2 for unholy details. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 2.6.24-rc4-mm1: hostbyte=0x01 driverbyte=0x00 (now bisected)
On Thu, Dec 06, 2007 at 08:52:29AM +0100, Hannes Reinecke wrote: Alexey Dobriyan wrote: git-scsi-misc.patch Apologies for not looking into the problem earlier. See http://marc.info/?t=11962802235r=1w=2 2.6.24-rc3-mm2: Result: hostbyte=0x01 driverbyte=0x00\nend_request: I/O error for previous installment. I've bisected it to the following patch in git-scsi-misc branch. Revert on top of 2.6.24-rc4-mm1 also helps. commit 8655a546c83fc43f0a73416bbd126d02de7ad6c0 Author: Hannes Reinecke [EMAIL PROTECTED] Date: Tue Nov 6 09:23:40 2007 +0100 [SCSI] Do not requeue requests if REQ_FAILFAST is set Any requests with the REQ_FAILFAST flag set should not be requeued to the requeust queue, but rather terminated directly. Otherwise the multipath failover will stall until the command timeout triggers. Signed-off-by: Hannes Reinecke [EMAIL PROTECTED] Signed-off-by: James Bottomley [EMAIL PROTECTED] diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 0f44bdb..0da0dd0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1286,6 +1286,11 @@ int scsi_prep_state_check(struct scsi_device *sdev, struct request *req) */ if (!(req-cmd_flags REQ_PREEMPT)) ret = BLKPREP_DEFER; + /* +* Return failfast requests immediately +*/ + if (req-cmd_flags REQ_FAILFAST) + ret = BLKPREP_KILL; break; default: /* @@ -1414,6 +1419,17 @@ static inline int scsi_host_queue_ready(struct request_queue *q, return 1; } +static void __scsi_kill_request(struct request *req) +{ + struct scsi_cmnd *cmd = req-special; + struct scsi_device *sdev = cmd-device; + + cmd-result = DID_NO_CONNECT 16; + atomic_inc(cmd-device-iorequest_cnt); + sdev-device_busy--; + __scsi_done(cmd); +} + /* * Kill a request for a dead device */ @@ -1527,8 +1543,16 @@ static void scsi_request_fn(struct request_queue *q) * accept it. */ req = elv_next_request(q); - if (!req || !scsi_dev_queue_ready(q, sdev)) + if (!req) + break; + + if (!scsi_dev_queue_ready(q, sdev)) { + if (req-cmd_flags REQ_FAILFAST) { + scsi_kill_request(req, q); + continue; + } break; + } if (unlikely(!scsi_device_online(sdev))) { sdev_printk(KERN_ERR, sdev, @@ -1609,8 +1633,12 @@ static void scsi_request_fn(struct request_queue *q) * later time. */ spin_lock_irq(q-queue_lock); - blk_requeue_request(q, req); - sdev-device_busy--; + if (unlikely(req-cmd_flags REQ_FAILFAST)) + __scsi_kill_request(req); + else { + blk_requeue_request(q, req); + sdev-device_busy--; + } if(sdev-device_busy == 0) blk_plug_device(q); out: Yeah, sorry. That patch was bad. Please use the attached one instead. Andrew, can you replace them? Instead? It won't apply. And it doesn't help on top of git-scsi. It helps if 3 hunks involving __scsi_kill_request() are ducked. --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1284,13 +1284,15 @@ int scsi_prep_state_check(struct scsi_device *sdev, struct request *req) /* * If the devices is blocked we defer normal commands. */ - if (!(req-cmd_flags REQ_PREEMPT)) - ret = BLKPREP_DEFER; - /* - * Return failfast requests immediately - */ - if (req-cmd_flags REQ_FAILFAST) - ret = BLKPREP_KILL; + if (!(req-cmd_flags REQ_PREEMPT)) { + /* + * Return failfast requests immediately + */ + if (req-cmd_flags REQ_FAILFAST) + ret = BLKPREP_KILL; + else + ret = BLKPREP_DEFER; + } break; default: /* - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
2.6.24-rc4-mm1: hostbyte=0x01 driverbyte=0x00 (now bisected)
git-scsi-misc.patch Apologies for not looking into the problem earlier. See http://marc.info/?t=11962802235r=1w=2 2.6.24-rc3-mm2: Result: hostbyte=0x01 driverbyte=0x00\nend_request: I/O error for previous installment. I've bisected it to the following patch in git-scsi-misc branch. Revert on top of 2.6.24-rc4-mm1 also helps. commit 8655a546c83fc43f0a73416bbd126d02de7ad6c0 Author: Hannes Reinecke [EMAIL PROTECTED] Date: Tue Nov 6 09:23:40 2007 +0100 [SCSI] Do not requeue requests if REQ_FAILFAST is set Any requests with the REQ_FAILFAST flag set should not be requeued to the requeust queue, but rather terminated directly. Otherwise the multipath failover will stall until the command timeout triggers. Signed-off-by: Hannes Reinecke [EMAIL PROTECTED] Signed-off-by: James Bottomley [EMAIL PROTECTED] diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 0f44bdb..0da0dd0 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1286,6 +1286,11 @@ int scsi_prep_state_check(struct scsi_device *sdev, struct request *req) */ if (!(req-cmd_flags REQ_PREEMPT)) ret = BLKPREP_DEFER; + /* +* Return failfast requests immediately +*/ + if (req-cmd_flags REQ_FAILFAST) + ret = BLKPREP_KILL; break; default: /* @@ -1414,6 +1419,17 @@ static inline int scsi_host_queue_ready(struct request_queue *q, return 1; } +static void __scsi_kill_request(struct request *req) +{ + struct scsi_cmnd *cmd = req-special; + struct scsi_device *sdev = cmd-device; + + cmd-result = DID_NO_CONNECT 16; + atomic_inc(cmd-device-iorequest_cnt); + sdev-device_busy--; + __scsi_done(cmd); +} + /* * Kill a request for a dead device */ @@ -1527,8 +1543,16 @@ static void scsi_request_fn(struct request_queue *q) * accept it. */ req = elv_next_request(q); - if (!req || !scsi_dev_queue_ready(q, sdev)) + if (!req) + break; + + if (!scsi_dev_queue_ready(q, sdev)) { + if (req-cmd_flags REQ_FAILFAST) { + scsi_kill_request(req, q); + continue; + } break; + } if (unlikely(!scsi_device_online(sdev))) { sdev_printk(KERN_ERR, sdev, @@ -1609,8 +1633,12 @@ static void scsi_request_fn(struct request_queue *q) * later time. */ spin_lock_irq(q-queue_lock); - blk_requeue_request(q, req); - sdev-device_busy--; + if (unlikely(req-cmd_flags REQ_FAILFAST)) + __scsi_kill_request(req); + else { + blk_requeue_request(q, req); + sdev-device_busy--; + } if(sdev-device_busy == 0) blk_plug_device(q); out: - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: sr_mod oops (elv_next_request involved)
On Mon, Oct 22, 2007 at 04:12:06PM +0400, Alexey Dobriyan wrote: Steps to reproduce: modprobe sr_mod To clarify: this is done during boot sequence. rmmod sr_mod modprobe sr_mod This -- by hand. BUG: unable to handle kernel paging request at virtual address f881b9f3 printing eip: f881b9f3 *pdpt = 3001 1*pde = 0480a067 *pte = Oops: 0010 [#1] PREEMPT SMP DEBUG_PAGEALLOC Modules linked in: sr_mod af_packet ipv6 nf_conntrack_netbios_ns nf_conntrack_ipv4 xt_state nf_conntrack xt_tcpudp ipt_REJECT iptable_filter ip_tables x_tables cpufreq_ondemand loop serio_raw k8temp hwmon amd_rng cdrom Pid: 1981, comm: modprobe Not tainted (2.6.23-55b70a0300b873c0ec7ea6e33752af56f41250ce #4) EIP: 0060:[f881b9f3] EFLAGS: 00010086 CPU: 1 EIP is at 0xf881b9f3 EAX: c570b380 EBX: c56b6700 ECX: f881b9f3 EDX: c56b6700 ESI: c570b380 EDI: c5767920 EBP: c570b380 ESP: c4b5ec0c DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process modprobe (pid: 1981, ti=c4b5e000 task=c4b6 task.ti=c4b5e000) Stack: c10ab9ea c570b380 c4b5ecec c528c5c8 c56b6700 c570b380 c528c430 c11251fd c570b380 c56b6700 c10ae49a 0001 c570b380 c56b6700 c570b380 c4b5ecec c10ae4c3 0001 c10ae540 0001 c4b5ecf0 c56b6700 c4b5ed18 Call Trace: [c10ab9ea] elv_next_request+0x83/0xfe CONFIG_HWMON=m CONFIG_SENSORS_K8TEMP=m Strange... If I make CONFIG_HWMON=y, oops goes away. If I load hwmon.ko after sr_mod.ko, oops goes away. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
sr_mod oops (elv_next_request involved)
Steps to reproduce: modprobe sr_mod rmmod sr_mod modprobe sr_mod BUG: unable to handle kernel paging request at virtual address f881b9f3 printing eip: f881b9f3 *pdpt = 3001 1*pde = 0480a067 *pte = Oops: 0010 [#1] PREEMPT SMP DEBUG_PAGEALLOC Modules linked in: sr_mod af_packet ipv6 nf_conntrack_netbios_ns nf_conntrack_ipv4 xt_state nf_conntrack xt_tcpudp ipt_REJECT iptable_filter ip_tables x_tables cpufreq_ondemand loop serio_raw k8temp hwmon amd_rng cdrom Pid: 1981, comm: modprobe Not tainted (2.6.23-55b70a0300b873c0ec7ea6e33752af56f41250ce #4) EIP: 0060:[f881b9f3] EFLAGS: 00010086 CPU: 1 EIP is at 0xf881b9f3 EAX: c570b380 EBX: c56b6700 ECX: f881b9f3 EDX: c56b6700 ESI: c570b380 EDI: c5767920 EBP: c570b380 ESP: c4b5ec0c DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process modprobe (pid: 1981, ti=c4b5e000 task=c4b6 task.ti=c4b5e000) Stack: c10ab9ea c570b380 c4b5ecec c528c5c8 c56b6700 c570b380 c528c430 c11251fd c570b380 c56b6700 c10ae49a 0001 c570b380 c56b6700 c570b380 c4b5ecec c10ae4c3 0001 c10ae540 0001 c4b5ecf0 c56b6700 c4b5ed18 Call Trace: [c10ab9ea] elv_next_request+0x83/0xfe [c11251fd] scsi_request_fn+0x59/0x2d8 [c10ae49a] blk_remove_plug+0x52/0x5e [c10ae4c3] __generic_unplug_device+0x1d/0x1f [c10ae540] blk_execute_rq_nowait+0x7b/0x8c [c10afc15] blk_execute_rq+0xa8/0xc5 [c10ad4e3] blk_end_sync_rq+0x0/0x23 [c1033e54] trace_hardirqs_on+0x11a/0x13d [c11a72c7] _spin_unlock_irqrestore+0x40/0x58 [c10b3b5f] cfq_set_request+0x29b/0x309 [c10b38c4] cfq_set_request+0x0/0x309 [c1124a48] scsi_execute+0xc3/0xd6 [c1124acb] scsi_execute_req+0x70/0xd3 [f896e54c] sr_probe+0x1ce/0x55a [sr_mod] [c108df02] sysfs_find_dirent+0x13/0x23 [c108dfc1] sysfs_add_one+0xaf/0xb8 [c108ebd5] sysfs_create_link+0xc4/0x107 [c1044033] free_hot_cold_page+0x164/0x1a6 [c110d313] driver_probe_device+0xe9/0x174 [c110d43f] __driver_attach+0x0/0xa1 [c110d4a8] __driver_attach+0x69/0xa1 [c110c854] bus_for_each_dev+0x3a/0x5c [c110d163] driver_attach+0x16/0x18 [c110d43f] __driver_attach+0x0/0xa1 [c110cb4b] bus_add_driver+0x6d/0x19a [f8969020] init_sr+0x20/0x39 [sr_mod] [c103aff3] sys_init_module+0x154d/0x1667 [c104cc58] handle_mm_fault+0x3c2/0x7c0 [c102cabb] up_read+0x14/0x29 [c1011db5] do_page_fault+0x281/0x6c8 [c1121890] scsi_set_medium_removal+0x0/0x74 [c1033e54] trace_hardirqs_on+0x11a/0x13d [c100276a] sysenter_past_esp+0x5f/0xa5 === Code: Bad EIP value. EIP: [f881b9f3] 0xf881b9f3 SS:ESP 0068:c4b5ec0c note: modprobe[1981] exited with preempt_count 1 # # Automatically generated make config: don't edit # Linux kernel version: 2.6.23 # Mon Oct 22 11:59:18 2007 # CONFIG_X86_32=y CONFIG_GENERIC_TIME=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_X86=y CONFIG_MMU=y CONFIG_ZONE_DMA=y CONFIG_QUICKLIST=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config # # General setup # CONFIG_EXPERIMENTAL=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 CONFIG_LOCALVERSION= # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set # CONFIG_TASKSTATS is not set # CONFIG_USER_NS is not set # CONFIG_AUDIT is not set CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=17 # CONFIG_CGROUPS is not set # CONFIG_FAIR_GROUP_SCHED is not set CONFIG_SYSFS_DEPRECATED=y CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE= CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y CONFIG_EMBEDDED=y # CONFIG_UID16 is not set # CONFIG_SYSCTL_SYSCALL is not set CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_ELF_CORE=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y # CONFIG_EPOLL is not set # CONFIG_SIGNALFD is not set # CONFIG_EVENTFD is not set CONFIG_SHMEM=y CONFIG_VM_EVENT_COUNTERS=y CONFIG_SLUB_DEBUG=y # CONFIG_SLAB is not set CONFIG_SLUB=y # CONFIG_SLOB is not set CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y CONFIG_STOP_MACHINE=y CONFIG_BLOCK=y # CONFIG_LBD is not set # CONFIG_BLK_DEV_IO_TRACE is not set # CONFIG_LSF is not set # CONFIG_BLK_DEV_BSG is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y # CONFIG_IOSCHED_AS is not set # CONFIG_IOSCHED_DEADLINE is not set CONFIG_IOSCHED_CFQ=y # CONFIG_DEFAULT_AS is not set # CONFIG_DEFAULT_DEADLINE is not set CONFIG_DEFAULT_CFQ=y # CONFIG_DEFAULT_NOOP is not set
[PATCH] esp_scsi.c: fix compilation
irqreturn.h for irqreturn_t and dma_addr_t being u128 warnings ;-) Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- drivers/scsi/esp_scsi.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -13,6 +13,7 @@ #include linux/module.h #include linux/moduleparam.h #include linux/init.h +#include linux/irqreturn.h #include asm/irq.h #include asm/io.h @@ -1706,17 +1707,17 @@ again: if (!dma_len) { printk(KERN_ERR PFX esp%d: DMA length is zero!\n, esp-host-unique_id); - printk(KERN_ERR PFX esp%d: cur adr[%08x] len[%08x]\n, + printk(KERN_ERR PFX esp%d: cur adr[%08llx] len[%08x]\n, esp-host-unique_id, - esp_cur_dma_addr(ent, cmd), + (unsigned long long)esp_cur_dma_addr(ent, cmd), esp_cur_dma_len(ent, cmd)); esp_schedule_reset(esp); return 0; } - esp_log_datastart(ESP: start data addr[%08x] len[%u] + esp_log_datastart(ESP: start data addr[%08llx] len[%u] write(%d)\n, - dma_addr, dma_len, write); + (unsigned long long)dma_addr, dma_len, write); esp-ops-send_dma_cmd(esp, dma_addr, dma_len, dma_len, write, ESP_CMD_DMA | ESP_CMD_TI); - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2.6.13 1/20] aic94xx: Makefile
On Fri, Sep 09, 2005 at 03:32:05PM -0400, Luben Tuikov wrote: --- linux-2.6.13-orig/drivers/scsi/aic94xx/Makefile +++ linux-2.6.13/drivers/scsi/aic94xx/Makefile +CHECK = sparse -Wbitwise make C=1 CHECK=sparse -Wbitwise or make C=1 +clean-files += *~ Don't override what other people want. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] gdth: schedule GDTIOCTL_OSVERS for removal
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- Documentation/feature-removal-schedule.txt |8 1 files changed, 8 insertions(+) --- linux-vanilla/Documentation/feature-removal-schedule.txt +++ linux-gdth/Documentation/feature-removal-schedule.txt @@ -135,3 +135,11 @@ Why: With the 16-bit PCMCIA subsystem no pcmciautils package available at http://kernel.org/pub/linux/utils/kernel/pcmcia/ Who: Dominik Brodowski [EMAIL PROTECTED] + +--- + +What: GDTIOCTL_OSVERS ioctl +When: November 2005 +Files: drivers/scsi/gdth.c, drivers/scsi/gdth.h +Why: Duplicates uname(2). +Who: Alexey Dobriyan [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH CC] gdth: remove GDTIOCTL_OSVERS
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- drivers/scsi/gdth.c | 12 drivers/scsi/gdth_ioctl.h |8 2 files changed, 20 deletions(-) diff -uprN linux-vanilla/drivers/scsi/gdth.c linux-gdth/drivers/scsi/gdth.c --- linux-vanilla/drivers/scsi/gdth.c 2005-08-08 02:16:47.0 +0400 +++ linux-gdth/drivers/scsi/gdth.c 2005-08-08 02:19:59.0 +0400 @@ -5411,18 +5411,6 @@ static int gdth_ioctl(struct inode *inod return -EFAULT; break; } - - case GDTIOCTL_OSVERS: - { -gdth_ioctl_osvers osv; - -osv.version = (unchar)(LINUX_VERSION_CODE 16); -osv.subversion = (unchar)(LINUX_VERSION_CODE 8); -osv.revision = (ushort)(LINUX_VERSION_CODE 0xff); -if (copy_to_user(argp, osv, sizeof(gdth_ioctl_osvers))) -return -EFAULT; -break; - } case GDTIOCTL_CTRTYPE: { diff -uprN linux-vanilla/drivers/scsi/gdth_ioctl.h linux-gdth/drivers/scsi/gdth_ioctl.h --- linux-vanilla/drivers/scsi/gdth_ioctl.h 2005-08-08 02:16:47.0 +0400 +++ linux-gdth/drivers/scsi/gdth_ioctl.h2005-08-08 02:20:19.0 +0400 @@ -10,7 +10,6 @@ #define GDTIOCTL_GENERAL(GDTIOCTL_MASK | 0) /* general IOCTL */ #define GDTIOCTL_DRVERS (GDTIOCTL_MASK | 1) /* get driver version */ #define GDTIOCTL_CTRTYPE(GDTIOCTL_MASK | 2) /* get controller type */ -#define GDTIOCTL_OSVERS (GDTIOCTL_MASK | 3) /* get OS version */ #define GDTIOCTL_HDRLIST(GDTIOCTL_MASK | 4) /* get host drive list */ #define GDTIOCTL_CTRCNT (GDTIOCTL_MASK | 5) /* get controller count */ #define GDTIOCTL_LOCKDRV(GDTIOCTL_MASK | 6) /* lock host drive */ @@ -296,13 +295,6 @@ typedef struct { unchar channel; /* channel */ } gdth_ioctl_lockchn; -/* GDTIOCTL_OSVERS */ -typedef struct { -unchar version; /* OS version */ -unchar subversion; /* OS subversion */ -ushort revision;/* revision */ -} gdth_ioctl_osvers; - /* GDTIOCTL_CTRTYPE */ typedef struct { ushort ionode; /* controller number */ - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Documentation/ioctl-mess.txt and ida_ioctl() review (was Re: [PATCH 2/3] cpqarray: ioctl support to configure LUNs dynamically)
On Thu, Aug 04, 2005 at 10:15:29AM +0530, Saripalli, Venkata Ramanamurthy (STSD) wrote: Patch 2 of 3 This patch adds support for IDAREGNEWDISK, IDADEREGDISK, IDAGETLOGINFO ioctls required to configure LUNs dynamically on SA4200 controller using ACU. drivers/block/cpqarray.c: 1131 static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, unsigned long arg) 1132 { 1133 drv_info_t *drv = get_drv(inode-i_bdev-bd_disk); 1134 ctlr_info_t *host = get_host(inode-i_bdev-bd_disk); 1135 int error; 1136 int diskinfo[4]; Hmm... diskinfo[3] seems to be enough. 1137 struct hd_geometry __user *geo = (struct hd_geometry __user *)arg; 1138 ida_ioctl_t __user *io = (ida_ioctl_t __user *)arg; 1139 ida_ioctl_t *my_io; 1140 1141 switch(cmd) { 1142 case HDIO_GETGEO: 1143 if (drv-cylinders) { 1144 diskinfo[0] = drv-heads; 1145 diskinfo[1] = drv-sectors; 1146 diskinfo[2] = drv-cylinders; 1147 } else { 1148 diskinfo[0] = 0xff; 1149 diskinfo[1] = 0x3f; 1150 diskinfo[2] = drv-nr_blks / (0xff*0x3f); 1151 } 1152 put_user(diskinfo[0], geo-heads); 1153 put_user(diskinfo[1], geo-sectors); 1154 put_user(diskinfo[2], geo-cylinders); 1155 put_user(get_start_sect(inode-i_bdev), geo-start); Mental note: export drv-heads, drv-sectors, drv-cylinders and inode-i_bdev-bd_part-start_sect to userspace (with possible tweaking). 1156 return 0; 1157 case IDAGETDRVINFO: 1158 if (copy_to_user(io-c.drv, drv, sizeof(drv_info_t))) What does drv_info_t contain? From drivers/block/cpqarray.h: 47 typedef struct { 48 unsigned blk_size; 49 unsigned nr_blks; 50 unsigned cylinders; 51 unsigned heads; 52 unsigned sectors; 53 int usage_count; 54 } drv_info_t; Great... Same heads, sectors, cylinders we can already export. Without magic if (!drv-cylinders). With extra crap for free: usage_count. Why should userspace know about reference count of drive? greppery-grep This is not even funny... $ grep usage_count -w -r . | grep cpq ./drivers/block/cpqarray.c: host-usage_count++; ./drivers/block/cpqarray.c: host-usage_count--; ./drivers/block/cpqarray.c: if (host-usage_count 1) { ./drivers/block/cpqarray.c: revalidation (usage=%d)\n, host-usage_count); ./drivers/block/cpqarray.c: host-usage_count++; ./drivers/block/cpqarray.c: host-usage_count--; ./drivers/block/cpqarray.h: int usage_count; ./drivers/block/cpqarray.h: int usage_count; where the type of host is struct ctlr_info, NOT drv_info_t. 1159 return -EFAULT; 1160 return 0; 1161 case IDAPASSTHRU: 1162 if (!capable(CAP_SYS_RAWIO)) 1163 return -EPERM; 1164 my_io = kmalloc(sizeof(ida_ioctl_t), GFP_KERNEL); 1165 if (!my_io) 1166 return -ENOMEM; 1167 error = -EFAULT; 1168 if (copy_from_user(my_io, io, sizeof(*my_io))) 1169 goto out_passthru; 1170 error = ida_ctlr_ioctl(host, drv - host-drv, my_io); 1171 if (error) 1172 goto out_passthru; 1173 error = -EFAULT; 1174 if (copy_to_user(io, my_io, sizeof(*my_io))) 1175 goto out_passthru; 1176 error = 0; 1177 out_passthru: 1178 kfree(my_io); 1179 return error; 1180 case IDAGETCTLRSIG: 1181 if (!arg) return -EINVAL; 1182 put_user(host-ctlr_sig, (int __user *)arg); 1183 return 0; 1184 case IDAREVALIDATEVOLS: 1185 if (iminor(inode) != 0) 1186 return -ENXIO; 1187 return revalidate_allvol(host); 1188 case IDADRIVERVERSION: 1189 if (!arg) return -EINVAL; 1190 put_user(DRIVER_VERSION, (unsigned long __user *)arg); 1191 return 0; Why should userspace know anything about module version? 1192 case IDAGETPCIINFO: 1193 { 1194 1195 ida_pci_info_struct pciinfo; 1196 1197 if (!arg) return -EINVAL; 1198 pciinfo.bus = host-pci_dev-bus-number; 1199 pciinfo.dev_fn = host-pci_dev-devfn; 1200 pciinfo.board_id = host-board_id; Why
Re: [KJ] [PATCH] scsi/a100u2w: Remove custom msecs_to_jiffies and jiffies_to_msecs macros
On Wednesday 13 April 2005 12:11, Tobias Klauser wrote: Replace the MS_TO_JIFFIES() macro with msecs_to_jiffies() from jiffies.h --- linux-2.6.12-rc2-mm3/drivers/scsi/a100u2w.c +++ linux-2.6.12-rc2-mm3-tk/drivers/scsi/a100u2w.c static void waitForPause(unsigned amount) { - ULONG the_time = jiffies + MS_TO_JIFFIES(amount); + ULONG the_time = jiffies + msecs_to_jiffies(amount); while (time_before_eq(jiffies, the_time)) cpu_relax(); } It'd be better to find out what is the equivalent generic sleeping/delaying function and, if any, remove waitForPause() altogether. However, Bas Vermeulen added these lines at the top of the file: * 01/31/99 bv - v1.02b Use mdelay instead of waitForPause * 08/08/99 bv - v1.02c Use waitForPause again. Maybe he can recall what was wrong with mdelay(). - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ANNOUNCE 3/6] Open-iSCSI High-Performance Initiator for Linux
On Monday 07 March 2005 09:15, Alex Aizman wrote: drivers/scsi/Kconfig changes. --- linux-2.6.11.orig/drivers/scsi/Kconfig +++ linux-2.6.11.dima/drivers/scsi/Kconfig +config ISCSI_IF + tristate iSCSI Open Transport Interface + depends on SCSI INET + ---help--- + To compile this driver as a module, choose M here: the + module will be called iscsi_if. + + This driver manages multiple iSCSI transports. This module is required + for normal iscsid operation. + + See more detailed information here: + + http://www.open-iscsi.org To compile this driver as a module ... boilerplate usually goes at the end of description. Help text is indented with 2 spaces wrt ---help---: ---help--- This driver manages multiple iSCSI transports. ... Alexey - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [ANNOUNCE 2/6] Open-iSCSI High-Performance Initiator for Linux
On Monday 07 March 2005 09:12, Alex Aizman wrote: Common header files: - iscsi_ifev.h (user/kernel events). - iscsi_if.h (iSCSI open interface over netlink); - iscsi_proto.h (RFC3720 #defines and types); --- linux-2.6.11.orig/include/scsi/iscsi_if.h +++ linux-2.6.11.dima/include/scsi/iscsi_if.h +/** + * struct iscsi_transport - down calls + * + * @name: transport name + * @caps: iSCSI Data-Path capabilities + * @create_snx: create new iSCSI session object + * @destroy_snx: destroy existing iSCSI session object + * @create_cnx: create new iSCSI connection + * @bind_cnx: associate this connection with existing iSCSI session and + *specified transport descriptor + * @destroy_cnx: destroy inactive iSCSI connection + * @set_param: set iSCSI Data-Path operational parameter + * @start_cnx: set connection to be operational + * @stop_cnx: suspend connection + * @send_pdu: send iSCSI PDU, Login, Logout, NOP-Out, Reject, Text. + * + * API provided by generic iSCSI Data Path module + */ +struct iscsi_transport { + char*name; + unsigned intcaps; + unsigned intmax_cnx; + iscsi_snx_h (*create_session) (iscsi_snx_h cp_snx, + uint32_t initial_cmdsn, uint32_t *sid); + void (*destroy_session) (iscsi_snx_h dp_snx); + iscsi_cnx_h (*create_cnx) (iscsi_snx_h dp_snx, iscsi_cnx_h cp_cnx, + uint32_t cid); + int (*bind_cnx) (iscsi_snx_h dp_snx, iscsi_cnx_h dp_cnx, + uint32_t transport_fd, int is_leading); + int (*start_cnx) (iscsi_cnx_h dp_cnx); + void (*stop_cnx) (iscsi_cnx_h dp_cnx); + void (*destroy_cnx) (iscsi_cnx_h dp_cnx); + int (*set_param) (iscsi_cnx_h dp_cnx, iscsi_param_e param, + uint32_t value); + int (*send_pdu) (iscsi_cnx_h dp_cnx, struct iscsi_hdr *hdr, + char *data, uint32_t data_size); +}; create_snx in comment but not in structure destroy_snx in comment but not in structure destroy_session in structure but not in comment create_session in structure but not in comment max_cnx in structure but not in comment Alexey - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html