Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343341 > unrolled thread

Re: [PATCH] hpfs: don't truncate the file when delete fails

Started byAl Viro <viro@ZenIV.linux.org.uk>
First post2016-02-25 18:30 +0100
Last post2016-02-25 18:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] hpfs: don't truncate the file when delete fails Al Viro <viro@ZenIV.linux.org.uk> - 2016-02-25 18:30 +0100
    Re: [PATCH] hpfs: don't truncate the file when delete fails Mikulas Patocka <mikulas@twibright.com> - 2016-02-25 18:40 +0100

#1343341 — Re: [PATCH] hpfs: don't truncate the file when delete fails

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2016-02-25 18:30 +0100
SubjectRe: [PATCH] hpfs: don't truncate the file when delete fails
Message-ID<r67TJ-74I-23@gated-at.bofh.it>
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 <viro@ZenIV.linux.org.uk>
> Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
> Cc: stable@vger.kernel.org	# 2.6.39+

Picked, but I don't understand that Cc: stable...

[toc] | [next] | [standalone]


#1343359

FromMikulas Patocka <mikulas@twibright.com>
Date2016-02-25 18:40 +0100
Message-ID<r683p-78A-45@gated-at.bofh.it>
In reply to#1343341

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 <viro@ZenIV.linux.org.uk>
> > Signed-off-by: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
> > 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web