LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* udf regression: broken directory handling
@ 2008-02-10 10:48 Marcin Slusarz
  2008-02-11 11:09 ` Jan Kara
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Slusarz @ 2008-02-10 10:48 UTC (permalink / raw)
  To: Jan Kara; +Cc: LKML

Hi
Current mainline has a problem with reading file list.
Simple ls prints only 2 out of 8 files on my testing DVD.
Reverting your patch "udf: cleanup directory offset handling"
(af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.

Marcin

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

* Re: udf regression: broken directory handling
  2008-02-10 10:48 udf regression: broken directory handling Marcin Slusarz
@ 2008-02-11 11:09 ` Jan Kara
  2008-02-11 19:13   ` Marcin Slusarz
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2008-02-11 11:09 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: LKML

  Hi,

On Sun 10-02-08 11:48:17, Marcin Slusarz wrote:
> Current mainline has a problem with reading file list.
> Simple ls prints only 2 out of 8 files on my testing DVD.
> Reverting your patch "udf: cleanup directory offset handling"
> (af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.
  Thanks for testing! Do you have a way to create such UDF filesystem? For
the filesystems I've created it seems to work just fine...

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

* Re: udf regression: broken directory handling
  2008-02-11 11:09 ` Jan Kara
@ 2008-02-11 19:13   ` Marcin Slusarz
  2008-02-12 11:39     ` Jan Kara
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Slusarz @ 2008-02-11 19:13 UTC (permalink / raw)
  To: Jan Kara; +Cc: LKML

On Mon, Feb 11, 2008 at 12:09:10PM +0100, Jan Kara wrote:
>   Hi,
> 
> On Sun 10-02-08 11:48:17, Marcin Slusarz wrote:
> > Current mainline has a problem with reading file list.
> > Simple ls prints only 2 out of 8 files on my testing DVD.
> > Reverting your patch "udf: cleanup directory offset handling"
> > (af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.
>   Thanks for testing! Do you have a way to create such UDF filesystem? For
> the filesystems I've created it seems to work just fine...

with patch applied:
joi tmp # dd if=/dev/zero of=./test.udf count=102400
102400+0 records in
102400+0 records out
52428800 bytes (52 MB) copied, 1.08618 s, 48.3 MB/s
joi tmp # mkudffs ./test.udf
start=0, blocks=16, type=RESERVED
start=16, blocks=3, type=VRS
start=19, blocks=237, type=USPACE
start=256, blocks=1, type=ANCHOR
start=257, blocks=16, type=PVDS
start=273, blocks=1, type=LVID
start=274, blocks=25069, type=PSPACE
start=25343, blocks=1, type=ANCHOR
start=25344, blocks=239, type=USPACE
start=25583, blocks=16, type=RVDS
start=25599, blocks=1, type=ANCHOR
joi tmp # mount -t udf -o loop ./test.udf ./udf/
joi tmp # cd udf/
joi udf # ls -l
total 0
joi udf # touch q w e r t y u i o p
joi udf # ls -l
total 0
drwxr-xr-x 2 root root 40 Feb 11 19:03 lost+found
-rw-r--r-- 1 root root  0 Feb 11 20:03 q
joi udf # cd ../
joi tmp # umount udf/
joi tmp # #(reverting patch)
joi tmp # rmmod udf
joi tmp # rm test.udf
joi tmp # dd if=/dev/zero of=./test.udf count=102400
102400+0 records in
102400+0 records out
52428800 bytes (52 MB) copied, 1.0559 s, 49.7 MB/s
joi tmp # mkudffs ./test.udf
start=0, blocks=16, type=RESERVED
start=16, blocks=3, type=VRS
start=19, blocks=237, type=USPACE
start=256, blocks=1, type=ANCHOR
start=257, blocks=16, type=PVDS
start=273, blocks=1, type=LVID
start=274, blocks=25069, type=PSPACE
start=25343, blocks=1, type=ANCHOR
start=25344, blocks=239, type=USPACE
start=25583, blocks=16, type=RVDS
start=25599, blocks=1, type=ANCHOR
joi tmp # mount -t udf -o loop ./test.udf ./udf/
joi tmp # cd udf/
joi udf # touch q w e r t y u i o p
joi udf # ls -l
total 0
-rw-r--r-- 1 root root  0 Feb 11 20:06 e
-rw-r--r-- 1 root root  0 Feb 11 20:06 i
drwxr-xr-x 2 root root 40 Feb 11 19:05 lost+found
-rw-r--r-- 1 root root  0 Feb 11 20:06 o
-rw-r--r-- 1 root root  0 Feb 11 20:06 p
-rw-r--r-- 1 root root  0 Feb 11 20:06 q
-rw-r--r-- 1 root root  0 Feb 11 20:06 r
-rw-r--r-- 1 root root  0 Feb 11 20:06 t
-rw-r--r-- 1 root root  0 Feb 11 20:06 u
-rw-r--r-- 1 root root  0 Feb 11 20:06 w
-rw-r--r-- 1 root root  0 Feb 11 20:06 y
joi udf # cd ../
joi tmp # umount udf/
joi tmp # #(applying patch again)
joi tmp # rmmod udf
joi tmp # mount -t udf -o loop ./test.udf ./udf/
joi tmp # ls -l udf/
total 0
drwxr-xr-x 2 root root 40 Feb 11 19:05 lost+found
-rw-r--r-- 1 root root  0 Feb 11 20:06 q
joi tmp #

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

* Re: udf regression: broken directory handling
  2008-02-11 19:13   ` Marcin Slusarz
@ 2008-02-12 11:39     ` Jan Kara
  2008-02-12 18:26       ` Marcin Slusarz
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kara @ 2008-02-12 11:39 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: LKML

On Mon 11-02-08 20:13:20, Marcin Slusarz wrote:
> On Mon, Feb 11, 2008 at 12:09:10PM +0100, Jan Kara wrote:
> >   Hi,
> > 
> > On Sun 10-02-08 11:48:17, Marcin Slusarz wrote:
> > > Current mainline has a problem with reading file list.
> > > Simple ls prints only 2 out of 8 files on my testing DVD.
> > > Reverting your patch "udf: cleanup directory offset handling"
> > > (af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.
> >   Thanks for testing! Do you have a way to create such UDF filesystem? For
> > the filesystems I've created it seems to work just fine...
> 
> with patch applied:
  <snip testing>

  Argh, I've submitted an old version of the patch missing changes in
dir.c. Below is the missing hunk. Does UDF work for you with it?

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR
---

Patch cleaning up UDF directory offset handling missed modifications in dir.c
(because I've submitted an old version :(). Fix it.

Signed-off-by: Jan Kara <jack@suse.cz>

diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 4b44e23..8d8643a 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -43,13 +43,13 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
 	struct fileIdentDesc *fi = NULL;
 	struct fileIdentDesc cfi;
 	int block, iblock;
-	loff_t nf_pos = filp->f_pos - 1;
+	loff_t nf_pos = (filp->f_pos - 1) << 2;
 	int flen;
 	char fname[UDF_NAME_LEN];
 	char *nameptr;
 	uint16_t liu;
 	uint8_t lfi;
-	loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
+	loff_t size = udf_ext0_offset(dir) + dir->i_size;
 	struct buffer_head *tmp, *bha[16];
 	kernel_lb_addr eloc;
 	uint32_t elen;
@@ -63,13 +63,13 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
 		return 0;
 
 	if (nf_pos == 0)
-		nf_pos = (udf_ext0_offset(dir) >> 2);
+		nf_pos = udf_ext0_offset(dir);
 
-	fibh.soffset = fibh.eoffset = (nf_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
+	fibh.soffset = fibh.eoffset = nf_pos & (dir->i_sb->s_blocksize - 1);
 	iinfo = UDF_I(dir);
 	if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
 		fibh.sbh = fibh.ebh = NULL;
-	} else if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2),
+	} else if (inode_bmap(dir, nf_pos >> dir->i_sb->s_blocksize_bits,
 			      &epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) {
 		block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
 		if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
@@ -111,7 +111,7 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
 	}
 
 	while (nf_pos < size) {
-		filp->f_pos = nf_pos + 1;
+		filp->f_pos = (nf_pos >> 2) + 1;
 
 		fi = udf_fileident_read(dir, &nf_pos, &fibh, &cfi, &epos, &eloc,
 					&elen, &offset);
@@ -178,7 +178,7 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
 		}
 	} /* end while */
 
-	filp->f_pos = nf_pos + 1;
+	filp->f_pos = (nf_pos >> 2) + 1;
 
 	if (fibh.sbh != fibh.ebh)
 		brelse(fibh.ebh);

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

* Re: udf regression: broken directory handling
  2008-02-12 11:39     ` Jan Kara
@ 2008-02-12 18:26       ` Marcin Slusarz
  2008-02-13 22:36         ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Slusarz @ 2008-02-12 18:26 UTC (permalink / raw)
  To: Jan Kara; +Cc: LKML

On Tue, Feb 12, 2008 at 12:39:17PM +0100, Jan Kara wrote:
> On Mon 11-02-08 20:13:20, Marcin Slusarz wrote:
> > On Mon, Feb 11, 2008 at 12:09:10PM +0100, Jan Kara wrote:
> > >   Hi,
> > > 
> > > On Sun 10-02-08 11:48:17, Marcin Slusarz wrote:
> > > > Current mainline has a problem with reading file list.
> > > > Simple ls prints only 2 out of 8 files on my testing DVD.
> > > > Reverting your patch "udf: cleanup directory offset handling"
> > > > (af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.
> > >   Thanks for testing! Do you have a way to create such UDF filesystem? For
> > > the filesystems I've created it seems to work just fine...
> > 
> > with patch applied:
>   <snip testing>
> 
>   Argh, I've submitted an old version of the patch missing changes in
> dir.c. Below is the missing hunk. Does UDF work for you with it?
Yes.

Marcin

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

* Re: udf regression: broken directory handling
  2008-02-12 18:26       ` Marcin Slusarz
@ 2008-02-13 22:36         ` Rafael J. Wysocki
  2008-02-14  9:49           ` Jan Kara
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2008-02-13 22:36 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: Jan Kara, LKML

On Tuesday, 12 of February 2008, Marcin Slusarz wrote:
> On Tue, Feb 12, 2008 at 12:39:17PM +0100, Jan Kara wrote:
> > On Mon 11-02-08 20:13:20, Marcin Slusarz wrote:
> > > On Mon, Feb 11, 2008 at 12:09:10PM +0100, Jan Kara wrote:
> > > >   Hi,
> > > > 
> > > > On Sun 10-02-08 11:48:17, Marcin Slusarz wrote:
> > > > > Current mainline has a problem with reading file list.
> > > > > Simple ls prints only 2 out of 8 files on my testing DVD.
> > > > > Reverting your patch "udf: cleanup directory offset handling"
> > > > > (af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.
> > > >   Thanks for testing! Do you have a way to create such UDF filesystem? For
> > > > the filesystems I've created it seems to work just fine...
> > > 
> > > with patch applied:
> >   <snip testing>
> > 
> >   Argh, I've submitted an old version of the patch missing changes in
> > dir.c. Below is the missing hunk. Does UDF work for you with it?
> Yes.

Has the issue been fixed in the mainline?

Rafael

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

* Re: udf regression: broken directory handling
  2008-02-13 22:36         ` Rafael J. Wysocki
@ 2008-02-14  9:49           ` Jan Kara
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kara @ 2008-02-14  9:49 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Marcin Slusarz, LKML

On Wed 13-02-08 23:36:05, Rafael J. Wysocki wrote:
> On Tuesday, 12 of February 2008, Marcin Slusarz wrote:
> > On Tue, Feb 12, 2008 at 12:39:17PM +0100, Jan Kara wrote:
> > > On Mon 11-02-08 20:13:20, Marcin Slusarz wrote:
> > > > On Mon, Feb 11, 2008 at 12:09:10PM +0100, Jan Kara wrote:
> > > > >   Hi,
> > > > > 
> > > > > On Sun 10-02-08 11:48:17, Marcin Slusarz wrote:
> > > > > > Current mainline has a problem with reading file list.
> > > > > > Simple ls prints only 2 out of 8 files on my testing DVD.
> > > > > > Reverting your patch "udf: cleanup directory offset handling"
> > > > > > (af793295bf9ee92660f5e77d337b0493cea3f9b9) fixes the problem.
> > > > >   Thanks for testing! Do you have a way to create such UDF filesystem? For
> > > > > the filesystems I've created it seems to work just fine...
> > > > 
> > > > with patch applied:
> > >   <snip testing>
> > > 
> > >   Argh, I've submitted an old version of the patch missing changes in
> > > dir.c. Below is the missing hunk. Does UDF work for you with it?
> > Yes.
> 
> Has the issue been fixed in the mainline?
  Andrew has the fix in his queue so it'll get to mainline soon.

										Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

end of thread, other threads:[~2008-02-14  9:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-10 10:48 udf regression: broken directory handling Marcin Slusarz
2008-02-11 11:09 ` Jan Kara
2008-02-11 19:13   ` Marcin Slusarz
2008-02-12 11:39     ` Jan Kara
2008-02-12 18:26       ` Marcin Slusarz
2008-02-13 22:36         ` Rafael J. Wysocki
2008-02-14  9:49           ` Jan Kara

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).