[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kihwal Lee updated HDFS-12614: -- Fix Version/s: 2.8.4 2.9.1 2.10.0 > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy >Priority: Major > Fix For: 3.0.0, 2.10.0, 2.9.1, 2.8.4 > > Attachments: HDFS-12614.01.patch, HDFS-12614.02.patch, > HDFS-12614.03.patch, HDFS-12614.04.patch, HDFS-12614.branch-2.patch, > HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kihwal Lee updated HDFS-12614: -- Attachment: HDFS-12614.branch-2.patch > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy >Priority: Major > Fix For: 3.0.0 > > Attachments: HDFS-12614.01.patch, HDFS-12614.02.patch, > HDFS-12614.03.patch, HDFS-12614.04.patch, HDFS-12614.branch-2.patch, > HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Resolution: Fixed Fix Version/s: 3.0.0 Status: Resolved (was: Patch Available) > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Fix For: 3.0.0 > > Attachments: HDFS-12614.01.patch, HDFS-12614.02.patch, > HDFS-12614.03.patch, HDFS-12614.04.patch, HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Attachment: HDFS-12614.04.patch Thanks for the review [~daryn]. Thats right, string literals and constant string expressions are already interned. Attached 04 patch, removing the explicit string intern. Please take a look at the latest revision. > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Attachments: HDFS-12614.01.patch, HDFS-12614.02.patch, > HDFS-12614.03.patch, HDFS-12614.04.patch, HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Attachment: HDFS-12614.03.patch Attached v03 patch with more comments. [~yzhangal], [~daryn], can you please take a look at the latest patch revision? Thanks. > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Attachments: HDFS-12614.01.patch, HDFS-12614.02.patch, > HDFS-12614.03.patch, HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Attachment: HDFS-12614.02.patch Thanks for the review [~daryn]. I had the same dilemma on whether to change the semantics for the root path component. I didn't see any functionalities failing because of this change though. But, I do concur that semantic change was riskier. Attached v02 patch to workaround the issue in {{FSPermissionChecker#getINodeAttrs()}} for the null root path component. Please take a look. I will track the other enhancement you talked about in a new jira. > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Attachments: HDFS-12614.01.patch, HDFS-12614.02.patch, > HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Affects Version/s: 3.0.0-beta1 Target Version/s: 3.0.0 Status: Patch Available (was: Open) > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Affects Versions: 3.0.0-beta1 >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Attachments: HDFS-12614.01.patch, HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Attachment: HDFS-12614.01.patch Attached v01 patch to address the issue in {{FSDirecotry#resolvePath()}} when {{INodeAttributesProvider}} is enabled. [~eddyxu], [~kihwal], [~daryn] can you please take a look? > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Attachments: HDFS-12614.01.patch, HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org
[jira] [Updated] (HDFS-12614) FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
[ https://issues.apache.org/jira/browse/HDFS-12614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Manoj Govindassamy updated HDFS-12614: -- Attachment: HDFS-12614.test.01.patch Attached a test case to show the problem with INodeAttributesProvider and path resolving. > FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider > configured > -- > > Key: HDFS-12614 > URL: https://issues.apache.org/jira/browse/HDFS-12614 > Project: Hadoop HDFS > Issue Type: Bug >Reporter: Manoj Govindassamy >Assignee: Manoj Govindassamy > Attachments: HDFS-12614.test.01.patch > > > When INodeAttributesProvider is configured, and when resolving path (like > "/") and checking for permission, the following code when working on > {{pathByNameArr}} throws NullPointerException. > {noformat} > private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx, > INode inode, int snapshotId) { > INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId); > if (getAttributesProvider() != null) { > String[] elements = new String[pathIdx + 1]; > for (int i = 0; i < elements.length; i++) { > elements[i] = DFSUtil.bytes2String(pathByNameArr[i]); <=== > } > inodeAttrs = getAttributesProvider().getAttributes(elements, > inodeAttrs); > } > return inodeAttrs; > } > {noformat} > Looks like for paths like "/" where the split components based on delimiter > "/" can be null, the pathByNameArr array can have null elements and can throw > NPE. -- This message was sent by Atlassian JIRA (v6.4.14#64029) - To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org