From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] [RFC] Fix deadlock on regular nonseekable files Date: Fri, 20 Mar 2015 14:46:34 +0000 Message-ID: <20150320144634.GY29656@ZenIV.linux.org.uk> References: <20150320134232.GX29656@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , David Vrabel , Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= , Iurii Konovalenko , Ian Campbell , Boris Ostrovsky , Andrii Anisov , Artem Mygaiev To: Vitaly Chernooky Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:59256 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbbCTOqi (ORCPT ); Fri, 20 Mar 2015 10:46:38 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Mar 20, 2015 at 04:22:11PM +0200, Vitaly Chernooky wrote: > > AFAICS, any threads blocked on f_pos_lock are not holding anything else and > > cannot impede the rest. What am I missing here? > > As far as I understand it is true only for files on regular filesystem > like ext4. Let's to see how XEN guys run into trouble with that > f_pos_lock: What does it have to do with filesystem type involved? The only place that takes f_pos_lock is __fdget_pos(), with only one caller in the entire tree - fdget_pos(). Which is static in fs/read_write.c and all its callers are in right in the beginning of sys_. Is it just that they have read() on procfs file blocked waiting for something and a bunch of other read/write on the same descriptor blocked on ->f_pos_mutex waiting for that sucker to finish? Then basically they are asking to waive XSI 2.9.7 for that file - behaviour *is* required by POSIX. What file it is and what is the first read() (or write(), whatever) blocked on? Stack traces would be useful for the latter...