[gpfsug-discuss] File placement rule for new files in directory - PATH_NAME

Marc A Kaplan makaplan at us.ibm.com
Thu Jul 12 15:47:00 BST 2018


Why no path name in SET POOL rule?
Maybe more than one reason, but consider, that in Unix, the API has the 
concept of "current directory" and "create a file in the current 
directory"
AND another process or thread may at any time rename (mv!) any 
directory...

So even it you "think" you know the name of the directory  in which you 
are creating a file, you really don't know for sure!

So, you may ask, how does the command /bin/pwd work?  It follows the 
parent inode field of each inode, searches the parent for a matching 
inode, stashes the name in a buffer...
When it reaches the root, it prints out the apparent path it found to the 
root...  Which could be wrong by the time it reaches the root!

For example:

[root@~/gpfs-git]$mkdir -p /tmp/a/b/c/d
[root@~/gpfs-git]$cd /tmp/a/b/c/d
[root at .../c/d]$/bin/pwd
/tmp/a/b/c/d
[root at .../c/d]$pwd
/tmp/a/b/c/d

[root at .../c/d]$mv /tmp/a/b /tmp/a/b2
[root at .../c/d]$pwd
/tmp/a/b/c/d
# Bash still "thinks" it is in /tmp/a/b/c/d
[root at .../c/d]$/bin/pwd
/tmp/a/b2/c/d
# But /bin/pwd knows better


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gpfsug.org/pipermail/gpfsug-discuss_gpfsug.org/attachments/20180712/43c6b367/attachment.htm>


More information about the gpfsug-discuss mailing list