[PATCH] vfs_streams_xattr: Do not attempt to write empty attributetwice
Christof Schmitt
christof.schmitt at us.ibm.com
Thu Jun 13 12:26:35 MDT 2013
On Thu, Jun 13, 2013 at 05:11:07AM +0000, Jim Brown wrote:
> You are missing a set of parentheses here:
>
> - if (!NT_STATUS_IS_OK(status)) {
> + if (!NT_STATUS_IS_OK(status) && (flags & O_CREAT) ||
> + (flags & O_TRUNC)) {
>
> It should be:
>
> - if (!NT_STATUS_IS_OK(status)) {
> + if (!NT_STATUS_IS_OK(status) && ((flags & O_CREAT) ||
> + (flags & O_TRUNC))) {
The logic before that patch is:
if (!NT_STATUS_IS_OK(status)) {
if (flags & O_CREAT) {
// create empty attributes
}
}
if (flags & O_TRUNC) {
// create empty attributes
}
Your proposal would change that logic to move the O_TRUNC case inside
the !NT_STATUS_IS_OK case. Since !NT_STATUS_IS_OK indicates that the
attribute does not exist, this would only allow truncate for
non-existing attributes.
I looked at my change again, and it should be correct. Reviews are
always welcome, though :)
--
Christof Schmitt || IBM || SONAS System Development || Tucson, AZ
christof.schmitt at us.ibm.com || +1-520-799-2469 (T/L: 321-2469)
More information about the samba-technical
mailing list