Loop devices under NTFS
Quoted 5 lines · Andre Bonin
"mount -o loop -r -t iso9660 /mnt/win_d/Source/Iso/Red\ Hat\
7.3/valhalla-i386-disc1.iso/mnt/rh7.3/cd1"It gives me an error
"ioctl:LOOP_SET_FD: Invalid argument"
I believe that NTFS does not provide
address_space_operations->{prepare,commit}_write for plain files, so the version of loop.c in stock 2.5.31 will not work.
I posted an update for loop.c that I posted on August 15th:
( http://marc.theaimsgroup.com/?l=linux-kernel&m=102941520919910&w=2 ). That update included a hack (originally conceived by Andrew Morton and originally implemented Jari Ruusu) to use file_operations->{read,write} for mounting files on file systems that do not provide {prepare,commit}_write, although this involves an extra data copy if a transformation (such as encryption) is selected.
I submitted the loop.c update to Linus at least a week ago, but
I have not seen it appear in ftp://ftp.kernel.org/pub/linux/kernel/people/dwmw2/bk-2.5.
Side note:
There are only a few file systems that provide writable files
without aops->{prepare,commit}_write. I think they are just tmpfs, ntfs and intermezzo. If all file systems that provided writable files could be expected to provide {prepare,commit}_write, I could eliminate the file_ops->{read,write} code from loop.c. I wish I understood if there really is a need for a file system to be able to provide a writable random access file (as opposed to /dev/tty) that does not have aops->{prepare,commit}_write. I would be interesting in knowing if there is anything preventing implementation of {prepare,commit}_wriet in ntfs.
Adam J. Richter __ ______________ 575 Oroville Road [email protected] \ / Milpitas, California 95035 +1 408 309-6081 | g g d r a s i l United States of America
"Free Software For The Rest Of Us."
Quoted 10 lines · Adam J. Richter
Quoted 5 lines · Andre Bonin
"mount -o loop -r -t iso9660 /mnt/win_d/Source/Iso/Red\ Hat\
7.3/valhalla-i386-disc1.iso/mnt/rh7.3/cd1"It gives me an error
"ioctl:LOOP_SET_FD: Invalid argument"I believe that NTFS does not provide
address_space_operations->{prepare,commit}_write for plain files, so the version ofloop.cin stock 2.5.31 will not work.
He is mounting read-only which does not require prepare,commit_write and it works fine. I have done it myself. Both in 2.4 and 2.5.
Further the NTFS updates I posted a few days ago actually implement prepare,commit write so they make loop work completely.
Quoted 12 lines
I posted an update for
loop.cthat I posted on August 15th:
( http://marc.theaimsgroup.com/?l=linux-kernel&m=102941520919910&w=2 ). That update included a hack (originally conceived by Andrew Morton and originally implemented Jari Ruusu) to use file_operations->{read,write} for mounting files on file systems that do not provide {prepare,commit}_write, although this involves an extra data copy if a transformation (such as encryption) is selected.I submitted the
loop.cupdate to Linus at least a week ago, but
I have not seen it appear in ftp://ftp.kernel.org/pub/linux/kernel/people/dwmw2/bk-2.5.
Quoted 5 lines
Side note:
There are only a few file systems that provide writable files
without aops->{prepare,commit}_write. I think they are just tmpfs, ntfs and intermezzo. If all file systems that provided writable files
NTFS doesn't provide write access at all. My posted updates implement write in the new driver and they do it using prepare,commit write.
Quoted 7 lines
could be expected to provide {prepare,commit}_write, I could eliminate the file_ops->{read,write} code from
loop.c. I wish I understood if there really is a need for a file system to be able to provide a writable random access file (as opposed to/dev/tty) that does not have aops->{prepare,commit}_write. I would be interesting in knowing if there is anything preventing implementation of {prepare,commit}_wriet in ntfs.
No, and it is in fact implemented already. As soon as Linus pulls from my bk repository (http://linux-ntfs.bkbits.net/ntfs-2.5) the stock kernel will have prepare,commit write in ntfs.
For the old ntfs driver still present in 2.4.x, there are no address space operations at all, the page cache is in fact not used at all, so that prevents the loop driver from working at all...
Best regards,
Anton
Signature · 3 lines
Anton Altaparmakov <aia21 at cantab.net> (replace at with @) Linux NTFS maintainer / IRC: #ntfs on irc.openprojects.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
Quoted 5 lines · Adam J. Richter
There are only a few file systems that provide writable files
without aops->{prepare,commit}_write. I think they are just tmpfs, ntfs and intermezzo. If all file systems that provided writable files could be expected to provide {prepare,commit}_write, I could eliminate the file_ops->{read,write} code fromloop.c.
This is the wrong level of abstraction. There is no reason why a filesystem has to use the pagecache at all.
Note that there is a more severe bug in loop.c: it's abuse of do_generic_file_read.