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>] [day] [month] [year] [list]
Date:	Wed, 5 Sep 2012 14:28:09 +0200
From:	Jan Kara <jack@...e.cz>
To:	Dmitry Monakhov <dmonakhov@...nvz.org>
Cc:	linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	jack@...e.cz
Subject: Re: Why page w/o buffers can not be released?

On Wed 05-09-12 15:30:29, Dmitry Monakhov wrote:
> 
> ext3, ext4 and ocfs2 do not allow to release page w/o buffers.
> Can some one please explain me why?
> 
> ext4_releasepage(struct page *page, gfp_t wait)
> {
>         if (!page_has_buffers(page))
>                 return 0;
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^( zero means fail to release)
>         if (journal)
>            return jbd2_journal_try_to_free_buffers(journal, page, wait);
>         else
>                 return try_to_free_buffers(page);
> }
> 
> This is looks very strange because if page has not buffers then
> it has no fs-specific data associated with it. Am I right?
> IMHO code should looks like follows:
> xxx_releasepage() {
> 
>      if(PageWriteback(page))
>         return 0;
>      if (!page_has_buffers(page))
>         return 1;
>  
>     return do_fs_specific_stuff()
> }
  Yeah, I agree. Although this is mostly a harmless thing because all call
sites test for page_has_private(page) before calling try_to_release_page(page)
so !page_has_buffers(page) is impossible. But a cleanup (remove the test) would
be nice.

  Also PageWriteback() is checked in try_to_release_page() so filesystems
don't have to care...

								Honza

-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ