Opened 5 years ago

Last modified 2 years ago

#10399 assigned bug

KDL Copying on ext4: sparse write attempt: vnode 0xe0056b60

Reported by: humdinger Owned by: axeld
Priority: normal Milestone: R1
Component: File Systems/ext2 Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This is hrev46645.

When I try copying 2 small files and 2 big (600mb) files onto a ext4 formatted USB drive, the small files are copied, but while about halfway into the first big file, I'm thrown in KDL: "PANIC: sparse write attempt: vnode 0xe0056b60" (see attached photo.)

I can continue, but am immediately back in KDL.

Attachments (1)

ext4_crash.jpg (138.4 KB) - added by humdinger 5 years ago.
KDL when writing to ext2 USB harddisk

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by humdinger

Attachment: ext4_crash.jpg added

KDL when writing to ext2 USB harddisk

comment:1 Changed 5 years ago by korli

The panic exists since hrev28648. Does the big files already exist on the target drive?

Otherwise a bad file map returned by the fs addon could eventually explain the panic.

comment:2 Changed 2 years ago by korli

Owner: changed from korli to axeld
Status: newassigned

axeld added the panic. Axel, any idea why happening?

comment:3 Changed 2 years ago by axeld

AFAIR, it works like this:

  • On read, the file system marks extents of the file with the special on disk location -1 as being non existent. The file cache will then fill those with zeros.
  • On write, the file system must make sure that all portions of the file being written to are non sparse, first. Otherwise, the file cache simply doesn't know where to put the data. That's what this panic means.

So ext2 must check if the write will "unsparse" a sparse file first, allocate space for it, update the file cache mappings, and only then actually perform the write by handing off the data to the file cache.

comment:4 Changed 2 years ago by axeld

IOW you have to allocate the stream before writing to it just like if you added data at its end.

Note: See TracTickets for help on using tickets.