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]
Date:	Wed, 18 May 2011 14:12:06 -0400
From:	Christoph Hellwig <hch@...radead.org>
To:	Jan Kara <jack@...e.cz>
Cc:	linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org,
	Al Viro <viro@...IV.linux.org.uk>, tytso@....edu,
	Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH 2/3] vfs: Block mmapped writes while the fs is frozen

>  
>  	if (unlikely(ret < 0))
>  		unlock_page(page);
> +	else {
> +		/*
> +		 * Freezing in progress? We check after the page is marked
> +		 * dirty and with page lock held so if the test here fails, we
> +		 * are sure freezing code will wait during syncing until the
> +		 * page fault is done - at that point page will be dirty and
> +		 * unlocked so freezing code will write it and writeprotect it
> +		 * again.
> +		 */
> +		set_page_dirty(page);
> +		if (inode->i_sb->s_frozen != SB_UNFROZEN) {
> +			unlock_page(page);
> +			ret = -EAGAIN;
> +			goto out;
> +		}
> +	}
>  out:
>  	return ret;

The code structure looks a bit odd, why not:

	if (ret < 0)
		goto out_unlock;

	set_page_dirty(page);
	if (inode->i_sb->s_frozen != SB_UNFROZEN) {
		ret = -EAGAIN;
		goto out_unlock;
	}

	return 0;

out_unlock:
	unlock_page(page);
	return ret;
}

Otherwise looks good,

Reviewed-by: Christoph Hellwig <hch@....de>
--
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