[LU-4849] double closedir() on error from cb_mv_init() Created: 01/Apr/14  Updated: 16/Jan/15  Resolved: 12/May/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.6.0
Fix Version/s: Lustre 2.6.0

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: Cliff White (Inactive)
Resolution: Fixed Votes: 0
Labels: lfs, patch

Severity: 3
Rank (Obsolete): 13360

 Description   

In liblustreapi.c:cb_mv_inti() if the parent cannot be opened then we will have closed *dirp but not set it to NULL. This causes a double free when closedir() is called a second time on the way out of llapi_semantic_traverse().

        if (dirp != NULL)
                closedir(*dirp);

        if (parent == NULL) {
                dir = opendir_parent(path);
                if (dir == NULL) {
                        ret = -errno;
                        fprintf(stderr, "can not open %s ret %d\n",
				path, ret);
                        return ret;
                }
        }

Also the fprintf() call should be llapi_error(..., "cannot open '%s'").



 Comments   
Comment by Swapnil Pimpale (Inactive) [ 07/Apr/14 ]

Patch: http://review.whamcloud.com/#/c/9905/

Comment by Cliff White (Inactive) [ 21/Apr/14 ]

Thanks, the patch passed testing

Comment by Cliff White (Inactive) [ 12/May/14 ]

Patch has been merged

Comment by Gerrit Updater [ 16/Jan/15 ]

frank zago (fzago@cray.com) uploaded a new patch: http://review.whamcloud.com/13441
Subject: LU-4849 user: tests for some swap layout operations
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 0bfba81a653cd1068e52e471959ad79098886ca0

Comment by Frank Zago (Inactive) [ 16/Jan/15 ]

Sorry. Wrong LU number.

Generated at Sat Feb 10 01:46:23 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.