mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-02 04:22:02 +03:00
sanlock: fix struct copy to avoid aliasing issues
Replace direct structure assignment with explicit copying to prevent
potential undefined behavior from structure aliasing. This ensures
proper memory handling when working with sanlock structures.
This possibly fixes regression introduced with commit: e9640e5178
as unintended side effect.
This commit is contained in:
@ -2447,8 +2447,8 @@ static int release_rename(struct lockspace *ls, struct resource *r)
|
||||
if (!res_args)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(&rd1, &rds->rs, sizeof(struct rd_sanlock));
|
||||
memcpy(&rd2, &rds->rs, sizeof(struct rd_sanlock));
|
||||
rd1.rs = rds->rs;
|
||||
rd2.rs = rds->rs;
|
||||
|
||||
res1 = &rd1.rs;
|
||||
res2 = &rd2.rs;
|
||||
|
Reference in New Issue
Block a user