linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Potential bug in fs/ext4/inline.c?
@ 2014-08-21 22:01 Theodore Ts'o
  2014-08-22  4:02 ` Darrick J. Wong
  2014-08-22  7:29 ` Zheng Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Theodore Ts'o @ 2014-08-21 22:01 UTC (permalink / raw)
  To: gnehzuil.liu; +Cc: linux-ext4

In ext4_find_inline_entry(), there is the following:

	if (ext4_get_inline_size(dir) == EXT4_MIN_INLINE_DATA_SIZE)
		goto out;

Am I missing something, or shouldn't this be:

	if (ext4_get_inline_size(dir) <= EXT4_MIN_INLINE_DATA_SIZE)
		goto out;

?

Thanks,

						- Ted





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potential bug in fs/ext4/inline.c?
  2014-08-21 22:01 Potential bug in fs/ext4/inline.c? Theodore Ts'o
@ 2014-08-22  4:02 ` Darrick J. Wong
  2014-08-22  7:29 ` Zheng Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2014-08-22  4:02 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: gnehzuil.liu, linux-ext4

On Thu, Aug 21, 2014 at 06:01:26PM -0400, Theodore Ts'o wrote:
> In ext4_find_inline_entry(), there is the following:
> 
> 	if (ext4_get_inline_size(dir) == EXT4_MIN_INLINE_DATA_SIZE)
> 		goto out;
> 
> Am I missing something, or shouldn't this be:
> 
> 	if (ext4_get_inline_size(dir) <= EXT4_MIN_INLINE_DATA_SIZE)
> 		goto out;
> 
> ?

I'm not sure it matters, since I see:

EXT4_I(inode)->i_inline_size = len + EXT4_MIN_INLINE_DATA_SIZE

scattered all over the code.  I'm not sure I like the idea that both ext4 and
e2fsprogs think that the inline data size is never <= 60, but afaict it doesn't
cause any problems.

--D

> 
> Thanks,
> 
> 						- Ted
> 
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potential bug in fs/ext4/inline.c?
  2014-08-21 22:01 Potential bug in fs/ext4/inline.c? Theodore Ts'o
  2014-08-22  4:02 ` Darrick J. Wong
@ 2014-08-22  7:29 ` Zheng Liu
  1 sibling, 0 replies; 3+ messages in thread
From: Zheng Liu @ 2014-08-22  7:29 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-ext4

On Thu, Aug 21, 2014 at 06:01:26PM -0400, Theodore Ts'o wrote:
> In ext4_find_inline_entry(), there is the following:
> 
> 	if (ext4_get_inline_size(dir) == EXT4_MIN_INLINE_DATA_SIZE)
> 		goto out;
> 
> Am I missing something, or shouldn't this be:
> 
> 	if (ext4_get_inline_size(dir) <= EXT4_MIN_INLINE_DATA_SIZE)
> 		goto out;

Hi Ted,

The original design idea is that the size of inline data shouldn't be
less than EXT4_MIN_INLINE_DATA_SIZE (60 bytes).  That means that the
inline data will occupy the whole i_block[] space.

If we create a new dir with inline data feature, the disk layout will
looks like below (ext4_try_create_inline_dir()):

i_block[0]: parent ino (4 bytes)
i_block+4:  dir entry (ino 0, rec_len 56 bytes)

Regards,
                                                - Zheng

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-22  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-21 22:01 Potential bug in fs/ext4/inline.c? Theodore Ts'o
2014-08-22  4:02 ` Darrick J. Wong
2014-08-22  7:29 ` Zheng Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).