[PATCH 7/8] xfs: factor common write setup code

Christoph Hellwig hch at infradead.org
Fri Jan 7 02:53:57 CST 2011


On Tue, Jan 04, 2011 at 03:48:37PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner at redhat.com>
> 
> The buffered IO and direct Io write paths share a common set of
> checks and limiting code prior to issuing the write. Factor that
> into a common helper function.

Wouldn't it be better to create the helper before duplicating the code,
aka move it before the buffer/direct splits in the series?

> +	/*
> +	 * If we're writing the file then make sure to clear the setuid and
> +	 * setgid bits if the process is not being run by root.  This keeps
> +	 * people from modifying setuid and setgid binaries.
> +	 */
> +	error = file_remove_suid(file);
> +	return error;

just

	return file_remove_suid(file);
?




More information about the xfs mailing list