From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752038AbbCTOql (ORCPT ); Fri, 20 Mar 2015 10:46:41 -0400 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 Date: Fri, 20 Mar 2015 14:46:34 +0000 From: Al Viro To: Vitaly Chernooky 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 Subject: Re: [PATCH] [RFC] Fix deadlock on regular nonseekable files 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...