From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: Deadlock in /proc/xen/xenbus watch+read on 3.17+ (maybe earlier) Date: Thu, 19 Mar 2015 13:00:51 +0000 Message-ID: <550AC883.40008@citrix.com> References: <20150319011911.GA29029@mail-itl> <1426761512.610.18.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Iurii Konovalenko , Ian Campbell Cc: Embedded-pv-devel@lists.xenproject.org, Boris Ostrovsky , xen-devel , David Vrabel , =?windows-1252?Q?Marek_Marczyk?= =?windows-1252?Q?owski-G=F3recki?= List-Id: xen-devel@lists.xenproject.org On 19/03/15 12:10, Iurii Konovalenko wrote: > Hi, guys! > > When I read, that I am not alone and that issue depends on kernel > version, I decided to continue investigation. > And I found why our threads locks on read/write operations. > On Linux kernel 3.14+ syscalls of file read and write changed a bit: > fdget() function was replaced by fdget_pos() - it is fdget() function > plus additional position mutex lock for files with FMODE_ATOMIC_POS > (files for inodes with S_IFREG flag set - regular nodes). As I thought > our xen files are not regular and nonseekable, I hoped this flag is > not set. But it is set. It is because our file system is created by > function simple_fill_super(), and inside it this flag is hardly set: > inode->i_mode = S_IFREG | files->mode; > So, as a fast hack I made a patch: just made copy of this function for > xen, which does not set this flag. It works for me. Could you please > check if it works for you. I still can't get this to deadlock, but why not clear FMODE_ATOMIC_POS in xenbus_file_open() ? David