Bug 205574
Summary: | [PATCH]usermount tool fails to format floppy as ext2 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Sandeep K. Shandilya <sandeep_k_shandilya> | ||||||
Component: | usermode | Assignee: | Martin Bacovsky <mbacovsk> | ||||||
Status: | CLOSED ERRATA | QA Contact: | David Lawrence <dkl> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 4.4 | CC: | jfeeney, rhentosh, wwlinuxengineering | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | RHBA-2007-0296 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2007-05-01 17:19:04 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Sandeep K. Shandilya
2006-09-07 12:37:56 UTC
Created attachment 135742 [details]
patch to usermount to fix mount and format issues with ext2/3
Comment on attachment 135742 [details] patch to usermount to fix mount and format issues with ext2/3 >--- usermode-1.74.orig/usermount.c 2004-09-24 06:50:22.000000000 -0400 >+++ usermode-1.74/usermount.c 2006-09-06 11:48:10.000000000 -0400 >@@ -435,12 +435,15 @@ > if (fstype == NULL) { > fstype = info->fstype; > } >- command[0] = PATH_MKFS; >- command[1] = "-t"; >- command[2] = fstype; >- command[3] = "-I"; >- command[4] = info->dev; >- command[5] = NULL; >+ int index=0; That should be declared at the top of the function. >+ command[index++] = PATH_MKFS; >+ command[index++] = "-t"; >+ command[index++] = fstype; >+ if (0==strncmp(fstype,"vfat",4)) { >+ command[index++]="-I"; >+ } Please try to follow the coding style. That should read: + if (strncmp (fstype, "vfat", 4) == 0) { + command[index++] = "-I"; + } >@@ -452,7 +455,7 @@ > } > if (WIFEXITED(status)) { > if (WEXITSTATUS(status) == 0) { >- info->mounted = !info->mounted; >+ info->mounted = 0; > } > } > } What's this change for? The first comment will be taken care of I will resubmit the patch. (In reply to comment #2) > (From update of attachment 135742 [details] [edit]) > >--- usermode-1.74.orig/usermount.c 2004-09-24 06:50:22.000000000 -0400 > >+++ usermode-1.74/usermount.c 2006-09-06 11:48:10.000000000 -0400 > >@@ -435,12 +435,15 @@ > > if (fstype == NULL) { > > fstype = info->fstype; > > } > >- command[0] = PATH_MKFS; > >- command[1] = "-t"; > >- command[2] = fstype; > >- command[3] = "-I"; > >- command[4] = info->dev; > >- command[5] = NULL; > >+ int index=0; > > That should be declared at the top of the function. I will resubmit the patch with index declared at the top. > > >+ command[index++] = PATH_MKFS; > >+ command[index++] = "-t"; > >+ command[index++] = fstype; > >+ if (0==strncmp(fstype,"vfat",4)) { > >+ command[index++]="-I"; > >+ } > > Please try to follow the coding style. That should read: > + if (strncmp (fstype, "vfat", 4) == 0) { > + command[index++] = "-I"; > + } I think it is safer to have 0==(expr) than (expr)==0. If we miss out the second '=' then, (expr)=0 which could lead to logical errors but 0=(expr) will give you a compiler error and will not allow you to miss out the second '='. > > >@@ -452,7 +455,7 @@ > > } > > if (WIFEXITED(status)) { > > if (WEXITSTATUS(status) == 0) { > >- info->mounted = !info->mounted; > >+ info->mounted = 0; > > } > > } > > } > > What's this change for? > After formatting media if you try to mount immediately then it fails with the message '...... not mounted' you run usermount without anything mounted then info->mounted=0. You run format on that media then this will line will inncorrectly set the flag(!info->mounted) . Created attachment 138404 [details]
A new patch with the review comments taken care off.
Please review I have attached a new patch with the previous review comments incorporated? This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release. All ACKS received, Patch provided by Dell. RH engineering please review and add to 4.5. Bug report changed to RELEASE_PENDING status by Errata System. Advisory RHBA-2007:9069-02 has been changed to HOLD status. http://errata.devel.redhat.com/errata/showrequest.cgi?advisory=4722 Fixed in usermode-1.74-2. Please remove RELEASE_PENDING and get into 4.5 mainstream release. This will wait till official release of RHEL 4.5.0. This is completely in hands of rel-eng. A fix for this issue has been included in RHEL4.5. Please test the Release Candidate of RHEL4.5, which was released today to Partners, and let us know if the problem is resolved. The Release Candidate can be downloaded from here: ftp://partners.redhat.com/af38ac4316ba20df2dec5f990913396d Internal Status set to 'Waiting on Customer' Status set to: Waiting on Client Resolution set to: 'RHEL 4.5' This event sent from IssueTracker by gcase issue 101684 An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2007-0296.html |