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:	Tue, 3 Dec 2013 19:11:25 -0800
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	Zheng Liu <gnehzuil.liu@...il.com>
Cc:	linux-ext4@...r.kernel.org, "Theodore Ts'o" <tytso@....edu>,
	Zheng Liu <wenqing.lz@...bao.com>
Subject: Re: [PATCH v2 15/28] debugfs: handle inline_data feature in bmap
 command

On Tue, Dec 03, 2013 at 08:11:42PM +0800, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@...bao.com>
> 
> No physical block mapping if an inode has inline data.
> 
> Signed-off-by: Theodore Ts'o <tytso@....edu>
> Signed-off-by: Zheng Liu <wenqing.lz@...bao.com>
> ---
>  lib/ext2fs/bmap.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/lib/ext2fs/bmap.c b/lib/ext2fs/bmap.c
> index 5074587..0d043bd 100644
> --- a/lib/ext2fs/bmap.c
> +++ b/lib/ext2fs/bmap.c
> @@ -273,6 +273,13 @@ errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
>  		block_buf = buf;
>  	}
>  
> +	/*
> +	 * If an inode has inline data, that means that it doesn't have
> +	 * any blocks and we shouldn't map any blocks for it.
> +	 */
> +	if (inode->i_flags & EXT4_INLINE_DATA_FL)
> +		goto done;

If you move this to before the ext2fs_get_array() chunk above it, you could
return straight out of the function.

This should return an error code of some kind, because otherwise the client
will think that something happened when the function returns 0, especially if
BMAP_{ALLOC,SET,UNINIT} are passed in.

--D

> +
>  	if (inode->i_flags & EXT4_EXTENTS_FL) {
>  		retval = ext2fs_extent_open2(fs, ino, inode, &handle);
>  		if (retval)
> -- 
> 1.7.9.7
> 
> --
> 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
--
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