mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* problems writing an fs image to a disk partition
@ 2018-09-11 20:33 Giorgio Dal Molin
  2018-09-12  7:12 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Giorgio Dal Molin @ 2018-09-11 20:33 UTC (permalink / raw)
  To: Barebox List


[-- Attachment #1.1.1: Type: text/plain, Size: 899 bytes --]

Hi,

today I've tried barebox v2018.09.0 on an EFI system.
It basically runs but I have problems when writing an fs image file
to a disk partition:

 > cp rootfs.img /dev/disk1.userland

barebox v2018.09.0 returns a 'no space left on device' error.

First of all I must ask if this is still the proper way to
write a content to a disk partition.

In case this should still work as expected here is a pseudo
backtrace of how the error happens on my system:

commands/cp.c:do_cp() ret = copy_file(argv[i], argv[argc - 1], verbose);
lib/libfile.c:copy_file() dstfd = open(dst, mode);
fs/fs.c:open() error = fsdrv->truncate(&fsdev->dev, f, 0);
fs/devfs.c: devfs_truncate()

in the call to devfs_truncate() I see cdev->ops->truncate == NULL
and f->fsdev->dev.num_resources == 0 and this makes the function
return -ENOSPC.

Hope the report helps identify a problem.

giorgio


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: problems writing an fs image to a disk partition
  2018-09-11 20:33 problems writing an fs image to a disk partition Giorgio Dal Molin
@ 2018-09-12  7:12 ` Sascha Hauer
  2018-09-12  7:31   ` Giorgio Dal Molin
  2018-09-12 15:06   ` Giorgio Dal Molin
  0 siblings, 2 replies; 4+ messages in thread
From: Sascha Hauer @ 2018-09-12  7:12 UTC (permalink / raw)
  To: Giorgio Dal Molin; +Cc: Barebox List

Hi Giorgio,

On Tue, Sep 11, 2018 at 10:33:52PM +0200, Giorgio Dal Molin wrote:
> Hi,
> 
> today I've tried barebox v2018.09.0 on an EFI system.
> It basically runs but I have problems when writing an fs image file
> to a disk partition:
> 
>  > cp rootfs.img /dev/disk1.userland
> 
> barebox v2018.09.0 returns a 'no space left on device' error.
> 
> First of all I must ask if this is still the proper way to
> write a content to a disk partition.

Yes, it is. You found a bug.

> 
> In case this should still work as expected here is a pseudo
> backtrace of how the error happens on my system:
> 
> commands/cp.c:do_cp() ret = copy_file(argv[i], argv[argc - 1], verbose);
> lib/libfile.c:copy_file() dstfd = open(dst, mode);
> fs/fs.c:open() error = fsdrv->truncate(&fsdev->dev, f, 0);
> fs/devfs.c: devfs_truncate()
> 
> in the call to devfs_truncate() I see cdev->ops->truncate == NULL
> and f->fsdev->dev.num_resources == 0 and this makes the function
> return -ENOSPC.
> 
> Hope the report helps identify a problem.

Yes, indeed, thanks. The problem was that with the switch to dentry
cache implementation the files in /dev/ no longer appear as character
devices but as regular files. the copy_file function then does a
truncate on the files which fails. I just sent out a patch addressing
this issue, please test. I would also recommend to take the second patch
although this fixes another issue.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: problems writing an fs image to a disk partition
  2018-09-12  7:12 ` Sascha Hauer
@ 2018-09-12  7:31   ` Giorgio Dal Molin
  2018-09-12 15:06   ` Giorgio Dal Molin
  1 sibling, 0 replies; 4+ messages in thread
From: Giorgio Dal Molin @ 2018-09-12  7:31 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List


> On September 12, 2018 at 9:12 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> 
> Hi Giorgio,
> 
> On Tue, Sep 11, 2018 at 10:33:52PM +0200, Giorgio Dal Molin wrote:
> > Hi,
> > 
> > today I've tried barebox v2018.09.0 on an EFI system.
> > It basically runs but I have problems when writing an fs image file
> > to a disk partition:
> > 
> >  > cp rootfs.img /dev/disk1.userland
> > 
> > barebox v2018.09.0 returns a 'no space left on device' error.
> > 
> > First of all I must ask if this is still the proper way to
> > write a content to a disk partition.
> 
> Yes, it is. You found a bug.
> 
> > 
> > In case this should still work as expected here is a pseudo
> > backtrace of how the error happens on my system:
> > 
> > commands/cp.c:do_cp() ret = copy_file(argv[i], argv[argc - 1], verbose);
> > lib/libfile.c:copy_file() dstfd = open(dst, mode);
> > fs/fs.c:open() error = fsdrv->truncate(&fsdev->dev, f, 0);
> > fs/devfs.c: devfs_truncate()
> > 
> > in the call to devfs_truncate() I see cdev->ops->truncate == NULL
> > and f->fsdev->dev.num_resources == 0 and this makes the function
> > return -ENOSPC.
> > 
> > Hope the report helps identify a problem.
> 
> Yes, indeed, thanks. The problem was that with the switch to dentry
> cache implementation the files in /dev/ no longer appear as character
> devices but as regular files. the copy_file function then does a
> truncate on the files which fails. I just sent out a patch addressing
> this issue, please test. I would also recommend to take the second patch
> although this fixes another issue.
> 
> Sascha
> 
Hi,

I've seen the two patches, thank you.

I've seen the dentry 'big patch' and I knew it was the problem
but it was too complex for me to understand exactly where the proper
fix should go.

I'll try them out today,

giorgio

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: problems writing an fs image to a disk partition
  2018-09-12  7:12 ` Sascha Hauer
  2018-09-12  7:31   ` Giorgio Dal Molin
@ 2018-09-12 15:06   ` Giorgio Dal Molin
  1 sibling, 0 replies; 4+ messages in thread
From: Giorgio Dal Molin @ 2018-09-12 15:06 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List


> On September 12, 2018 at 9:12 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
> 
> Hi Giorgio,
> 
> On Tue, Sep 11, 2018 at 10:33:52PM +0200, Giorgio Dal Molin wrote:
> > Hi,
> > 
> > today I've tried barebox v2018.09.0 on an EFI system.
> > It basically runs but I have problems when writing an fs image file
> > to a disk partition:
> > 
> >  > cp rootfs.img /dev/disk1.userland
> > 
> > barebox v2018.09.0 returns a 'no space left on device' error.
> > 
> > First of all I must ask if this is still the proper way to
> > write a content to a disk partition.
> 
> Yes, it is. You found a bug.
> 
> > 
> > In case this should still work as expected here is a pseudo
> > backtrace of how the error happens on my system:
> > 
> > commands/cp.c:do_cp() ret = copy_file(argv[i], argv[argc - 1], verbose);
> > lib/libfile.c:copy_file() dstfd = open(dst, mode);
> > fs/fs.c:open() error = fsdrv->truncate(&fsdev->dev, f, 0);
> > fs/devfs.c: devfs_truncate()
> > 
> > in the call to devfs_truncate() I see cdev->ops->truncate == NULL
> > and f->fsdev->dev.num_resources == 0 and this makes the function
> > return -ENOSPC.
> > 
> > Hope the report helps identify a problem.
> 
> Yes, indeed, thanks. The problem was that with the switch to dentry
> cache implementation the files in /dev/ no longer appear as character
> devices but as regular files. the copy_file function then does a
> truncate on the files which fails. I just sent out a patch addressing
> this issue, please test. I would also recommend to take the second patch
> although this fixes another issue.
> 
> Sascha
> 

Hi,

I've applied the two patches and I can confirm that they fix the problem
for me.

Thanks again.

giorgio

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-09-12 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 20:33 problems writing an fs image to a disk partition Giorgio Dal Molin
2018-09-12  7:12 ` Sascha Hauer
2018-09-12  7:31   ` Giorgio Dal Molin
2018-09-12 15:06   ` Giorgio Dal Molin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox