Message ID | 20190607110502.31175-1-ross.burton@intel.com |
---|---|
State | Accepted |
Commit | 3757073726a00c5250556aae3d0daac76b88085e |
Headers | show |
Series | wic/filemap: handle FIGETBSZ failing | expand |
On Fri, Jun 07, 2019 at 12:05:02PM +0100, Ross Burton wrote: > Some file systems don't support fetching the block size (notably the file system > Docker uses for containers), so handle the iotctl() failing and raise the > expected error. > > Signed-off-by: Ross Burton <ross.burton@intel.com> Reviewed-by: Tom Rini <trini@konsulko.com> -- Tom -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
On Fri, Jun 7, 2019 at 7:49 AM Tom Rini <trini@konsulko.com> wrote: > On Fri, Jun 07, 2019 at 12:05:02PM +0100, Ross Burton wrote: > > > Some file systems don't support fetching the block size (notably the > file system > > Docker uses for containers), so handle the iotctl() failing and raise the > > expected error. > > > > Signed-off-by: Ross Burton <ross.burton@intel.com> > > Reviewed-by: Tom Rini <trini@konsulko.com> > Thank you for finding the fix! Reviewed-by: Tim Orling <timothy.t.orling@linux.intel.com> —Tim > > -- > Tom > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > <div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 7, 2019 at 7:49 AM Tom Rini <<a href="mailto:trini@konsulko.com">trini@konsulko.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jun 07, 2019 at 12:05:02PM +0100, Ross Burton wrote:<br> <br> > Some file systems don't support fetching the block size (notably the file system<br> > Docker uses for containers), so handle the iotctl() failing and raise the<br> > expected error.<br> > <br> > Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>><br> <br> Reviewed-by: Tom Rini <<a href="mailto:trini@konsulko.com" target="_blank">trini@konsulko.com</a>><br> </blockquote><div dir="auto"><br></div><div dir="auto">Thank you for finding the fix!</div><div dir="auto"><br></div><div dir="auto">Reviewed-by: Tim Orling <<a href="mailto:timothy.t.orling@linux.intel.com">timothy.t.orling@linux.intel.com</a>></div><div dir="auto"><br></div><div dir="auto">—Tim</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> -- <br> Tom<br> -- <br> _______________________________________________<br> Openembedded-core mailing list<br> <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br> <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br> </blockquote></div></div> -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py index 244c07a71cf..a3919fbcad8 100644 --- a/scripts/lib/wic/filemap.py +++ b/scripts/lib/wic/filemap.py @@ -32,7 +32,10 @@ def get_block_size(file_obj): """ # Get the block size of the host file-system for the image file by calling # the FIGETBSZ ioctl (number 2). - binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0)) + try: + binary_data = fcntl.ioctl(file_obj, 2, struct.pack('I', 0)) + except OSError: + raise IOError("Unable to determine block size") bsize = struct.unpack('I', binary_data)[0] if not bsize: import os
Some file systems don't support fetching the block size (notably the file system Docker uses for containers), so handle the iotctl() failing and raise the expected error. Signed-off-by: Ross Burton <ross.burton@intel.com> --- scripts/lib/wic/filemap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core