HomeFreeBSD

Fix removal of SA in sa_modify_attrs()

Description

Fix removal of SA in sa_modify_attrs()

The sa_modify_attrs() function can add, remove or replace an SA.
The main loop in the function uses the index "i" to iterate over the
existing SAs and uses the index "j" for writing them into a new buffer
via SA_ADD_BULK_ATTR(). The write index, "j" is incremented on remove
(SA_REMOVE) operations which leads to a corruption in the new SA buffer.
This patch remove the increment for SA_REMOVE operations.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #3028

Details

Provenance
Tim Chase <tim@chase2k.com>Authored on Oct 19 2014, 3:50 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jan 22 2015, 12:35 AM
Parents
rG841c9d43c725: Use kmem_vasprintf() in log_internal()
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGb0cf0676c0be: Fix removal of SA in sa_modify_attrs() (authored by Tim Chase <tim@chase2k.com>).Jan 22 2015, 12:35 AM