Skip to contentSkip to conversation

ext4:fix unexpected error from ext4_reserve_global

PATCH In review Dmitriy Monakhov 3 participants 3 messages Jun 14, 2007 – Jun 19, 2007 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4:fix unexpected error from ext4_reserve_global

I just cant belive my eyes then i saw this at the first time... simple test: strace dd if=/dev/zero of=/mnt/file

open("/dev/zero", O_RDONLY) = 0
close(1) = 0
open("/mnt/test/file", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 1 read(0, "\0\0\0\0\0\0\0\0\0"..., 512) = 512 write(1, "\0\0\0\0\0\0\0\0"..., 512) = 512
read(0, "\0\0\0\0\0\0\0\0\0"..., 512) = 512 write(1, "\0\0\0\0\0\0\0\0"..., 512) = -1 ENOENT (No such fil e or directory)

This strange error returned from ext4_reserve_global(). It's just typo because:
a) In fact this is 100% ENOSPC situation
b) simular function ext4_reserve_local() returns -ENOSPC

---
 fs/ext4/balloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/balloc.c +1 -1
index 4d7bfd2..43ae8f8 100644
@@ -1920,7 +1920,7 @@ int ext4_reserve_global(struct super_block *sb, int blocks)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct ext4_reservation_slot *rs;
-	int i, rc = -ENOENT;
+	int i, rc = -ENOSPC;
 	__u64 free = 0;
 
 	rs = sbi->s_reservation_slots;
Signature · 1 line
1.5.2
#1 lore raw
Quoted 3 lines · Dmitriy Monakhov

I just cant belive my eyes then i saw this at the first time... simple test: strace dd if=/dev/zero of=/mnt/file

Thanks for reporting it.

Quoted 9 lines

open("/dev/zero", O_RDONLY) = 0
close(1) = 0
open("/mnt/test/file", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 1 read(0, "\0\0\0\0\0\0\0\0\0"..., 512) = 512 write(1, "\0\0\0\0\0\0\0\0"..., 512) = 512
read(0, "\0\0\0\0\0\0\0\0\0"..., 512) = 512 write(1, "\0\0\0\0\0\0\0\0"..., 512) = -1 ENOENT (No such fil e or directory)

Quoted 5 lines

This strange error returned from ext4_reserve_global(). It's just typo because:
a) In fact this is 100% ENOSPC situation
b) simular function ext4_reserve_local() returns -ENOSPC

I agree.

Patch is put in ext4 patch queue. Alex if you can Ack, that would be great.

Thanks,

Mingming

Quoted 18 lines
---
 fs/ext4/balloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/balloc.c +1 -1
index 4d7bfd2..43ae8f8 100644
@@ -1920,7 +1920,7 @@ int ext4_reserve_global(struct super_block *sb, int blocks)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct ext4_reservation_slot *rs;
-	int i, rc = -ENOENT;
+	int i, rc = -ENOSPC;
 	__u64 free = 0;
 
 	rs = sbi->s_reservation_slots;
#2 lore raw

ACK, of course.

thanks, Alex

Quoted 52 lines · Mingming Cao
Quoted 3 lines · Dmitriy Monakhov

I just cant belive my eyes then i saw this at the first time... simple test: strace dd if=/dev/zero of=/mnt/file

Thanks for reporting it.

Quoted 9 lines

open("/dev/zero", O_RDONLY) = 0
close(1) = 0
open("/mnt/test/file", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 1 read(0, "\0\0\0\0\0\0\0\0\0"..., 512) = 512 write(1, "\0\0\0\0\0\0\0\0"..., 512) = 512
read(0, "\0\0\0\0\0\0\0\0\0"..., 512) = 512 write(1, "\0\0\0\0\0\0\0\0"..., 512) = -1 ENOENT (No such fil e or directory)

Quoted 5 lines

This strange error returned from ext4_reserve_global(). It's just typo because:
a) In fact this is 100% ENOSPC situation
b) simular function ext4_reserve_local() returns -ENOSPC

I agree.

Patch is put in ext4 patch queue. Alex if you can Ack, that would be great.

Thanks,

Mingming

Quoted 10 lines
---
 fs/ext4/balloc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ext4/balloc.c +0 -0
index 4d7bfd2..43ae8f8 100644

fs/ext4/balloc.c int ext4_reserve_global(struct super_block *sb, int blocks) · line 1926

Quoted 8 lines
fs/ext4/balloc.c +1 -1
@@ -1920,7 +1920,7 @@ int ext4_reserve_global(struct super_block *sb, int blocks)
 {
 	struct ext4_sb_info *sbi = EXT4_SB(sb);
 	struct ext4_reservation_slot *rs;
-	int i, rc = -ENOENT;
+	int i, rc = -ENOSPC;
 	__u64 free = 0;
 
 	rs = sbi->s_reservation_slots;

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html