From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933519AbcBYRid (ORCPT ); Thu, 25 Feb 2016 12:38:33 -0500 Received: from 78-80-28-91.tmcz.cz ([78.80.28.91]:43774 "EHLO leontynka.twibright.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S933451AbcBYRhl (ORCPT ); Thu, 25 Feb 2016 12:37:41 -0500 X-Greylist: delayed 1193 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Feb 2016 12:37:41 EST Date: Thu, 25 Feb 2016 18:37:37 +0100 (CET) From: Mikulas Patocka X-X-Sender: mikulas@leontynka To: Al Viro cc: Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hpfs: don't truncate the file when delete fails In-Reply-To: <20160225172001.GX17997@ZenIV.linux.org.uk> Message-ID: References: <20160225172001.GX17997@ZenIV.linux.org.uk> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Feb 2016, Al Viro wrote: > On Thu, Feb 25, 2016 at 06:17:38PM +0100, Mikulas Patocka wrote: > > The delete opration can allocate additional space on the HPFS filesystem > > due to btree split. The HPFS driver checks in advance if there is > > available space, so that it won't corrupt the btree if we run out of space > > during splitting. > > > > If there is not enough available space, the HPFS driver attempted to > > truncate the file, but this results in a deadlock since the commit > > 7dd29d8d865efdb00c0542a5d2c87af8c52ea6c7 ("HPFS: Introduce a global mutex > > and lock it on every callback from VFS"). > > > > This patch removes the code that tries to truncate the file and -ENOSPC is > > returned instead. If the user hits -ENOSPC on delete, he should try to > > delete other files (that are stored in a leaf btree node), so that the > > delete operation will make some space for deleting the file stored in > > non-leaf btree node. > > > > Reported-by: Al Viro > > Signed-off-by: Mikulas Patocka > > Cc: stable@vger.kernel.org # 2.6.39+ > > Picked, but I don't understand that Cc: stable... This bug is in all kernels since 2.6.39, so I marked it that way so that it will be picked by stable kernel maintainers. Mikulas