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: <20230112092905.chrxh6dlnxfakxz6@quack3>
Date:   Thu, 12 Jan 2023 10:29:05 +0100
From:   Jan Kara <jack@...e.cz>
To:     Ted Tso <tytso@....edu>
Cc:     linux-ext4@...r.kernel.org, Jan Kara <jack@...e.cz>
Subject: Re: [PATCH 3/7] ext4: Mark page for delayed dirtying only if it is
 pinned

On Wed 11-01-23 16:43:27, Jan Kara wrote:
> In data=journal mode, page should be dirtied only when it has buffers
> for checkpoint or it is writeably mapped. In the first case, we don't
> need to do anything special. In the second case, page was already added
> to the journal by ext4_page_mkwrite() and since transaction commit
> writeprotects mapped pages again, page should be writeable (and thus
> dirtied) only while it is part of the running transaction. So nothing
> needs to be done either. The only special case is when someone pins the
> page and uses this pin for modifying page data. So recognize this
> special case and only then mark the page as having data that needs
> adding to the journal.
> 
> Signed-off-by: Jan Kara <jack@...e.cz>
...
>  static bool ext4_journalled_dirty_folio(struct address_space *mapping,
>  		struct folio *folio)
>  {
>  	WARN_ON_ONCE(!folio_buffers(folio));
> -	folio_set_checked(folio);
> +	if (folio_may_be_dma_pinned(folio))

Bah, this should be folio_maybe_dma_pinned(). I had it there and that's
what I've tested with but before submission I was laboring whether I should
really keep this change or not, had it deleted for a while and then
restored the change, and while doing that I've introduced this bug. :-|

I'll resend with this bug fixed but before doing that I'll wait a few days
whether someone has more comments.

								Honza

> +		folio_set_checked(folio);
>  	return filemap_dirty_folio(mapping, folio);
>  }
>  
> -- 
> 2.35.3
> 
-- 
Jan Kara <jack@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ