[LU-8724] several llapi functions use opendir() when open() would suffice Created: 18/Oct/16 Updated: 23/Dec/16 Resolved: 23/Dec/16 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.9.0 |
| Fix Version/s: | Lustre 2.10.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | Steve Guminski (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | easy, llapi | ||
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
llapi_get_obd_count(), llapi_ostlist(), llapi_quotactl(), llapi_get_connect_flags(), and possibly other llapi functions are using opendir(), dirfd(), and closedir() when open() and close() would suffice. |
| Comments |
| Comment by Steve Guminski (Inactive) [ 28/Nov/16 ] |
|
I don't think llapi_ostlist() should be changed, because it uses the opened directory as a parameter to setup_obd_uuid(), which takes a DIR pointer. |
| Comment by Gerrit Updater [ 28/Nov/16 ] |
|
Steve Guminski (stephenx.guminski@intel.com) uploaded a new patch: http://review.whamcloud.com/23981 |
| Comment by James A Simmons [ 28/Nov/16 ] |
|
While you are at it another issue exist as well with newer platforms. On my Ubuntu 16 system I get the following build issues: gcc -DHAVE_CONFIG_H -I. -I../.. -include /usr/src/lustre-2.8.60/undef.h -include /usr/src/lustre-2.8.60/config.h -I/usr/src/lustre-2.8.60/libcfs/include -I/usr/src/lustre-2.8.60/lnet/include -I/usr/src/lustre-2.8.60/lustre/include -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 -g -O2 -Wall -Werror -MT liblustreapi.o -MD -MP -MF .deps/liblustreapi.Tpo -c -o liblustreapi.o liblustreapi.c readdir() is the replacement for this function, |
| Comment by John Hammond [ 28/Nov/16 ] |
|
> I don't think llapi_ostlist() should be changed, because it uses the opened directory as a parameter to setup_obd_uuid(), which takes a DIR pointer. setup_obd_uuid() only uses the dir parameter as an argument to dirfd(). So its DIR *dir parameter should be replaced with int fd. |
| Comment by John Hammond [ 28/Nov/16 ] |
|
James, please open a new issue. |
| Comment by Steve Guminski (Inactive) [ 28/Nov/16 ] |
|
OK. setup_obd_uuid() is called elsewhere, so I'll have to update the other code that will be impacted. I'll upload a new patch when those changes are made. |
| Comment by Gerrit Updater [ 23/Dec/16 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/23981/ |
| Comment by Peter Jones [ 23/Dec/16 ] |
|
Landed for 2.10 |