linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jan Kara <jack@suse.cz>
Cc: akpm@linux-foundation.org, fabf@skynet.be,
	mm-commits@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: Elevated i_writecount doesn't guarantee ->release to be called
Date: Thu, 29 Jan 2015 17:35:33 +0000	[thread overview]
Message-ID: <20150129173532.GF29656@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20150129124630.GB11635@quack.suse.cz>

On Thu, Jan 29, 2015 at 01:46:30PM +0100, Jan Kara wrote:
>   Thanks for pointing this out. You made me at look where exactly is
> get_write_access() called and there are even places where we call it
> without having file descriptor at all (e.g.  truncate path). So ext3, ext4,
> udf, and gfs2 are racy. If we race, results aren't that bad (we just keep
> preallocated blocks in the inode) but still it would be nice to fix.
> 
> Obviously we could maintain a private writecount in ->open() method but it
> would seem a bit sad to do that for this mostly theoretical issue. Maybe we
> just verify whether preallocation is truncated when evicting inode from
> memory and if not, do it there. It's not perfect but even with current racy
> solution noone noticed in practice.

The trouble with doing that on inode eviction is that we might have done
r/o remount by then, so any metadata writes are unexpected at that point...

  parent reply	other threads:[~2015-01-29 17:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54c95874.1pbbCloLAl3wWsPR%akpm@linux-foundation.org>
     [not found] ` <20150128224534.GB29656@ZenIV.linux.org.uk>
2015-01-29 12:46   ` Elevated i_writecount doesn't guarantee ->release to be called Jan Kara
2015-01-29 16:47     ` Fabian Frederick
2015-01-29 16:57       ` Jan Kara
2015-01-29 17:35     ` Al Viro [this message]
2015-01-30  5:33       ` Fabian Frederick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150129173532.GF29656@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).