[LU-16821] Increase directory st_blksize for glibc Created: 11/May/23  Updated: 31/Aug/23  Resolved: 31/Aug/23

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

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Andreas Dilger
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

It appears that glibc is using st_blksize returned by the client to allocate the buffer used by readdir() internally when it calls getdents():

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/opendir.c

 110   /* Increase allocation if requested, but not if the value appears to
 111      be bogus.  It will be between 32Kb and 1Mb.  */
 112   size_t allocation = MIN (MAX ((size_t) statp->st_blksize, (size_t)
 113                                 allocation_size), (size_t) max_buffer_size);

Since the client is already doing RPCs of up to 1MB to the MDS to fetch the directory data to the client, we may as well return all of these entries to userspace at the same time.



 Comments   
Comment by Gerrit Updater [ 11/May/23 ]

"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50960
Subject: LU-16821 llite: report 1MiB directory blocksize
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 444bfe09097ba94dd9fe2c68fa6cf95e7d800c65

Comment by Gerrit Updater [ 31/Aug/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/50960/
Subject: LU-16821 llite: report 1MiB directory blocksize
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: d6673e545612fce31201eefdc8065fecf7fa3efd

Comment by Peter Jones [ 31/Aug/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:30:17 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.