lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJfpegsukLF=cgdZcB0+9F6Asrt1S0pQeziGu6Z_ROkQEKr38g@mail.gmail.com>
Date:	Mon, 19 Dec 2011 17:03:23 +0100
From:	Miklos Szeredi <miklos@...redi.hu>
To:	Steven Whitehouse <swhiteho@...hat.com>
Cc:	Al Viro <viro@...iv.linux.org.uk>, hch@...radead.org,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	jack@...e.cz, akpm@...ux-foundation.org,
	toshi.okajima@...fujitsu.com, mszeredi@...e.cz
Subject: Re: [PATCH 3/4] vfs: count unlinked inodes

On Mon, Dec 19, 2011 at 3:38 PM, Steven Whitehouse <swhiteho@...hat.com> wrote:
> Hi,
>
> On Sat, 2011-12-17 at 07:36 +0000, Al Viro wrote:
>> On Mon, Nov 21, 2011 at 12:11:32PM +0100, Miklos Szeredi wrote:
>> > @@ -241,6 +242,11 @@ void __destroy_inode(struct inode *inode)
>> >     BUG_ON(inode_has_buffers(inode));
>> >     security_inode_free(inode);
>> >     fsnotify_inode_delete(inode);
>> > +   if (!inode->i_nlink) {
>> > +           WARN_ON(atomic_long_read(&inode->i_sb->s_remove_count) == 0);
>> > +           atomic_long_dec(&inode->i_sb->s_remove_count);
>> > +   }
>>
>> Umm...  That relies on ->destroy_inode() doing nothing stupid; granted,
>> all work on actual file removal should've been done in ->evice_inode()
>> leaving only (RCU'd) freeing of in-core, but there are odd ones that
>> do strange things in ->destroy_inode() and I'm not sure that it's not
>> a Yet Another Remount Race(tm).  OTOH, it's clearly not worse than what
>> we used to have; just something to keep in mind for future work.
>>
> GFS2 is one of those cases. The issue is that when we enter
> ->evict_inode() with i_nlink 0, we do not know whether any other node
> still has the inode open. If it does, then we do not deallocate it in
> ->evict_inode() but instead just forget about it, just as if i_nlink was
>> 0 leaving the remaining opener(s) to do the deallocation later,

And does GFS2 care about read-only remount races because of that?
I.e. if an unlinked file is still open on another node, should we
prevent remounting read-only until it the file is released and
actually gone?

If that's not a requirement (and I don't see why it should be) then all is fine.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ