All of lore.kernel.org
 help / color / mirror / Atom feed
* + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch added to -mm tree
@ 2009-02-10 22:59 akpm
  2009-02-11 15:03 ` + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesys tems.patch " Theodore Tso
  0 siblings, 1 reply; 3+ messages in thread
From: akpm @ 2009-02-10 22:59 UTC (permalink / raw)
  To: mm-commits; +Cc: yjwei, linux-ext4


The patch titled
     ext3: fix support for empty directory blocks in 64k blocksize filesystems
has been added to the -mm tree.  Its filename is
     ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: ext3: fix support for empty directory blocks in 64k blocksize filesystems
From: Wei Yongjun <yjwei@cn.fujitsu.com>

The rec_len field in the directory entry is 16 bits, so if the filesystem
is completely empty, rec_len of 0 is used to designate 65536 in e2fsprogs,
for the case where the directory entry takes the entire 64k block.

But if an empty directory is read, an error message will be output by
current kernels.  You can use the following commands to reproduce it.

  - mkfs.ext3 -b $(( 64 * 1024 )) /dev/sdc1
  - mount /dev/sda1 /mnt
  - cd /mnt/lost+found
  - ll
  - tail /var/log/messages
  EXT3-fs error (device sdc1): ext3_readdir: bad entry in \
  directory #11: rec_len is smaller than minimal - offset=0, \
  inode=0, rec_len=0, name_len=0

Treat a rec_len of 0 as 65536, as e2fsprogs does.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/ext3_fs.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN include/linux/ext3_fs.h~ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems include/linux/ext3_fs.h
--- a/include/linux/ext3_fs.h~ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems
+++ a/include/linux/ext3_fs.h
@@ -711,7 +711,7 @@ static inline unsigned ext3_rec_len_from
 {
 	unsigned len = le16_to_cpu(dlen);
 
-	if (len == EXT3_MAX_REC_LEN)
+	if (len == EXT3_MAX_REC_LEN || len == 0)
 		return 1 << 16;
 	return len;
 }
@@ -719,7 +719,7 @@ static inline unsigned ext3_rec_len_from
 static inline __le16 ext3_rec_len_to_disk(unsigned len)
 {
 	if (len == (1 << 16))
-		return cpu_to_le16(EXT3_MAX_REC_LEN);
+		return cpu_to_le16(0);
 	else if (len > (1 << 16))
 		BUG();
 	return cpu_to_le16(len);
_

Patches currently in -mm which might be from yjwei@cn.fujitsu.com are

linux-next.patch
fs-jffs2-mallocc-kmem_cache_alloc-memset-kmem_cache_zalloc.patch
scsi-used-kmem_cache_zalloc-instead-of-kmem_cache_alloc-memset.patch
ext2-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch
ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch


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

* Re: + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesys tems.patch added to -mm tree
  2009-02-10 22:59 + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch added to -mm tree akpm
@ 2009-02-11 15:03 ` Theodore Tso
  0 siblings, 0 replies; 3+ messages in thread
From: Theodore Tso @ 2009-02-11 15:03 UTC (permalink / raw)
  To: akpm; +Cc: yjwei, linux-ext4

On Tue, Feb 10, 2009 at 02:59:22PM -0800, akpm@linux-foundation.org wrote:
> 
> The patch titled
>      ext3: fix support for empty directory blocks in 64k blocksize filesystems
> has been added to the -mm tree.  Its filename is
>      ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch

NACK; I think we need to discuss this some more.  See the discussion
around the similar patch for ext4.

							- Ted

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

* + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch added to -mm tree
@ 2009-02-10 22:59 akpm
  0 siblings, 0 replies; 3+ messages in thread
From: akpm @ 2009-02-10 22:59 UTC (permalink / raw)
  To: mm-commits; +Cc: yjwei, linux-ext4


The patch titled
     ext3: fix support for empty directory blocks in 64k blocksize filesystems
has been added to the -mm tree.  Its filename is
     ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: ext3: fix support for empty directory blocks in 64k blocksize filesystems
From: Wei Yongjun <yjwei@cn.fujitsu.com>

The rec_len field in the directory entry is 16 bits, so if the filesystem
is completely empty, rec_len of 0 is used to designate 65536 in e2fsprogs,
for the case where the directory entry takes the entire 64k block.

But if an empty directory is read, an error message will be output by
current kernels.  You can use the following commands to reproduce it.

  - mkfs.ext3 -b $(( 64 * 1024 )) /dev/sdc1
  - mount /dev/sda1 /mnt
  - cd /mnt/lost+found
  - ll
  - tail /var/log/messages
  EXT3-fs error (device sdc1): ext3_readdir: bad entry in \
  directory #11: rec_len is smaller than minimal - offset=0, \
  inode=0, rec_len=0, name_len=0

Treat a rec_len of 0 as 65536, as e2fsprogs does.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/ext3_fs.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN include/linux/ext3_fs.h~ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems include/linux/ext3_fs.h
--- a/include/linux/ext3_fs.h~ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems
+++ a/include/linux/ext3_fs.h
@@ -711,7 +711,7 @@ static inline unsigned ext3_rec_len_from
 {
 	unsigned len = le16_to_cpu(dlen);
 
-	if (len == EXT3_MAX_REC_LEN)
+	if (len == EXT3_MAX_REC_LEN || len == 0)
 		return 1 << 16;
 	return len;
 }
@@ -719,7 +719,7 @@ static inline unsigned ext3_rec_len_from
 static inline __le16 ext3_rec_len_to_disk(unsigned len)
 {
 	if (len == (1 << 16))
-		return cpu_to_le16(EXT3_MAX_REC_LEN);
+		return cpu_to_le16(0);
 	else if (len > (1 << 16))
 		BUG();
 	return cpu_to_le16(len);
_

Patches currently in -mm which might be from yjwei@cn.fujitsu.com are

linux-next.patch
fs-jffs2-mallocc-kmem_cache_alloc-memset-kmem_cache_zalloc.patch
scsi-used-kmem_cache_zalloc-instead-of-kmem_cache_alloc-memset.patch
ext2-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch
ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch


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

end of thread, other threads:[~2009-02-11 15:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-10 22:59 + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch added to -mm tree akpm
2009-02-11 15:03 ` + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesys tems.patch " Theodore Tso
2009-02-10 22:59 + ext3-fix-support-for-empty-directory-blocks-in-64k-blocksize-filesystems.patch " akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.