From: "Jan Beulich" Subject: Re: [PATCH] Fix blkback/blktap sysfs read bug. Date: Tue, 19 Jan 2010 16:20:39 +0000 Message-ID: <4B55E9E7020000780002AC17@vpn.id2.novell.com> References: <20100119095250.GB20691@joejin-pc.cn.oracle.com> <4B5596B2020000780002AAF1@vpn.id2.novell.com> <20100119113224.GA21348@joejin-pc.cn.oracle.com> <4B55AE58020000780002AB39@vpn.id2.novell.com> <20100119141338.GA22249@joejin-pc.cn.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20100119141338.GA22249@joejin-pc.cn.oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Joe Jin Cc: Keir Fraser , xen-devel@lists.xensource.com, deepak.patel@oracle.com, greg.marsden@oracle.com List-Id: xen-devel@lists.xenproject.org >>> "Joe Jin" 19.01.10 15:13 >>> >When tested continous reboot VM testcase kernel panic. then I write=20 >a program as blow: >while (1) { > open("/sys/devices/xen-backend/vbd-x-xxxx/statistics/rd_sect"); > usleep(100); > read(fd, buff, BUFF_LEN); >} > >running it, then reboot the vm, will hit the panic. > >As I have menthioned, when open the file, kernel have initialized=20 >file handler, when call file operation, call the function. >At here, even blkback_remove() have delete sysfs entry, but did not >released sysfs->fops, that caused the panic. That would seem like a general sysfs problem then - I can't imagine other modules do much to prevent this, though I'm sure there are other modules which add/remove entries on the fly. Would require some looking through the sources to see whether there is any generally usable (and simple) solution to this. But irrespective of that, I think the race remains even after your patch - only the window gets smaller. Jan