[LU-9137] readdir_r is deprecated now Created: 19/Feb/17  Updated: 03/Jun/17  Resolved: 03/Jun/17

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

Type: Improvement Priority: Major
Reporter: Oleg Drokin Assignee: James A Simmons
Resolution: Fixed Votes: 0
Labels: None

Rank (Obsolete): 9223372036854775807

 Description   

Trying to build Lustre on Fedora 25 I got hit by this:

lhsmtool_posix.c: In function Бct_import_recurseБ:
lhsmtool_posix.c:1499:3: error: Бreaddir_rБ is deprecated [-Werror=deprecated-de
clarations]
   rc = readdir_r(dir, &ent, &cookie);
   ^~
In file included from /usr/include/features.h:368:0,
                 from /usr/include/stdio.h:27,
                 from lhsmtool_posix.c:40:
/usr/include/dirent.h:189:12: note: declared here
 extern int __REDIRECT (readdir_r,
            ^
lhsmtool_posix.c: In function Бct_dir_level_maxБ:
lhsmtool_posix.c:1710:2: error: Бreaddir_rБ is deprecated [-Werror=deprecated-declarations]
  while ((rc = readdir_r(dir, &ent, &cookie)) == 0) {
  ^~~~~
In file included from /usr/include/features.h:368:0,
                 from /usr/include/stdio.h:27,
                 from lhsmtool_posix.c:40:
/usr/include/dirent.h:189:12: note: declared here
 extern int __REDIRECT (readdir_r,
            ^

man readdir_r on my Fedora25 system says that modern posix does not guarantee thread-safedness of readdir, bug glibc and other modern implementation versions of readdir are safe as long as you give it different input streams.



 Comments   
Comment by Bob Glossman (Inactive) [ 14/Apr/17 ]

The same problem happens in builds on Ubuntu 17.

Comment by Gerrit Updater [ 24/May/17 ]

James Simmons (uja.ornl@yahoo.com) uploaded a new patch: https://review.whamcloud.com/27276
Subject: LU-9137 utils: replace readdir_r with readdir
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: bcba6161f4eb8bdb739f363d1a6bc90d19fe649d

Comment by Gerrit Updater [ 03/Jun/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/27276/
Subject: LU-9137 utils: replace readdir_r with readdir
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 76b1fd6596e62cfb6a2543240db8d0823c1a1465

Comment by Peter Jones [ 03/Jun/17 ]

Landed for 2.10

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