mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-04 17:15:50 +00:00
Don't call vn_finished_write() if vn_start_write() failed.
This commit is contained in:
parent
e44270a781
commit
d50ef66d03
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=156893
@ -1069,10 +1069,11 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap)
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
if (error == 0) {
|
||||
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
error = vn_setlabel(nd.ni_vp, intlabel,
|
||||
td->td_ucred);
|
||||
vn_finished_write(mp);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
}
|
||||
|
||||
NDFREE(&nd, 0);
|
||||
@ -1122,10 +1123,11 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap)
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
if (error == 0) {
|
||||
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
error = vn_setlabel(nd.ni_vp, intlabel,
|
||||
td->td_ucred);
|
||||
vn_finished_write(mp);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
}
|
||||
|
||||
NDFREE(&nd, 0);
|
||||
|
@ -1069,10 +1069,11 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap)
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
if (error == 0) {
|
||||
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
error = vn_setlabel(nd.ni_vp, intlabel,
|
||||
td->td_ucred);
|
||||
vn_finished_write(mp);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
}
|
||||
|
||||
NDFREE(&nd, 0);
|
||||
@ -1122,10 +1123,11 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap)
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
if (error == 0) {
|
||||
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
error = vn_setlabel(nd.ni_vp, intlabel,
|
||||
td->td_ucred);
|
||||
vn_finished_write(mp);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
}
|
||||
|
||||
NDFREE(&nd, 0);
|
||||
|
@ -1069,10 +1069,11 @@ __mac_set_file(struct thread *td, struct __mac_set_file_args *uap)
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
if (error == 0) {
|
||||
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
error = vn_setlabel(nd.ni_vp, intlabel,
|
||||
td->td_ucred);
|
||||
vn_finished_write(mp);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
}
|
||||
|
||||
NDFREE(&nd, 0);
|
||||
@ -1122,10 +1123,11 @@ __mac_set_link(struct thread *td, struct __mac_set_link_args *uap)
|
||||
vfslocked = NDHASGIANT(&nd);
|
||||
if (error == 0) {
|
||||
error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH);
|
||||
if (error == 0)
|
||||
if (error == 0) {
|
||||
error = vn_setlabel(nd.ni_vp, intlabel,
|
||||
td->td_ucred);
|
||||
vn_finished_write(mp);
|
||||
vn_finished_write(mp);
|
||||
}
|
||||
}
|
||||
|
||||
NDFREE(&nd, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user