Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kobj_read_file: Return -1 on vn_rdwr() error #4104

Closed
wants to merge 1 commit into from
Closed

Conversation

ryao
Copy link
Contributor

@ryao ryao commented Dec 15, 2015

LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao [email protected]

@ryao ryao force-pushed the kobj branch 3 times, most recently from eb34f12 to 85d6ad1 Compare December 15, 2015 16:42
@ryao ryao changed the title kobj_read_file: Fix uninitialized value on vn_rdwr() error kobj_read_file: Return -1 on vn_rdwr() error Dec 15, 2015
ryao added a commit to ryao/spl that referenced this pull request Dec 15, 2015
I noticed that the SPL implementation of kobj_read_file is not correct
after comparing it with the userland implementation of kobj_read_file()
in openzfs/zfs#4104.

The function is tiny enough that my patch could qualify to be called a
"rewrite", so I am just copying the function on the basis that a rewrite
allows me to license the code under both the CDDL and GPL.

Signed-off-by: Richard Yao <[email protected]>
ryao added a commit to ryao/spl that referenced this pull request Dec 15, 2015
I noticed that the SPL implementation of kobj_read_file is not correct
after comparing it with the userland implementation of kobj_read_file()
in openzfs/zfs#4104.

The function is tiny enough that my patch could qualify to be called a
"rewrite", so I am just copying the function on the basis that a rewrite
allows me to license the code under both the CDDL and GPL.

Signed-off-by: Richard Yao <[email protected]>
ryao added a commit to ryao/spl that referenced this pull request Dec 15, 2015
I noticed that the SPL implementation of kobj_read_file is not correct
after comparing it with the userland implementation of kobj_read_file()
in openzfs/zfs#4104.

The function is tiny enough that my patch could qualify to be called a
"rewrite", so I am just copying the function on the basis that a rewrite
allows me to license the code under both the CDDL and GPL.

Signed-off-by: Richard Yao <[email protected]>
LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao <[email protected]>
ryao added a commit to ryao/spl that referenced this pull request Dec 15, 2015
I noticed that the SPL implementation of kobj_read_file is not correct
after comparing it with the userland implementation of kobj_read_file()
in openzfs/zfs#4104.

The function is tiny enough that my patch could qualify to be called a
"rewrite", so I am just copying the function on the basis that a rewrite
allows me to license the code under both the CDDL and GPL.

Note that we no longer pass RLIM64_INFINITY with this, but our vn_rdwr
implementation did not support it anyway, so there is no difference.

Signed-off-by: Richard Yao <[email protected]>
behlendorf pushed a commit to openzfs/spl that referenced this pull request Jan 23, 2016
I noticed that the SPL implementation of kobj_read_file is not correct
after comparing it with the userland implementation of kobj_read_file()
in openzfs/zfs#4104.

Note that we no longer pass RLIM64_INFINITY with this, but our vn_rdwr
implementation did not support it anyway, so there is no difference.

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #513
@behlendorf
Copy link
Contributor

Merged as:

957dc93 kobj_read_file: Return -1 on vn_rdwr() error

goulvenriou pushed a commit to Alyseo/zfs that referenced this pull request Feb 3, 2016
LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4104
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4104
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4104
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
LLVM's static analyzer showed that we could subtract using an
uninitialized value on an error from vn_rdwr().

The correct behavior is to return -1 on an error, so lets do that
instead.

Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#4104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants