]> git.baikalelectronics.ru Git - kernel.git/commit
ext[34]: avoid i_nlink warnings triggered by drop_nlink/inc_nlink kludge in symlink()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Jan 2012 00:50:23 +0000 (19:50 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Jan 2012 01:19:30 +0000 (20:19 -0500)
commitc15ea1cdb02f4ae06c9ca89ef02384c148039022
treec82c28de75da5b73c224cce18602d1a5680d27d7
parent588c9cf3f47b6b87db63aaf6be10c3c81cd2471b
ext[34]: avoid i_nlink warnings triggered by drop_nlink/inc_nlink kludge in symlink()

Both ext3 and ext4 put the half-created symlink inode into the orphan list
for a while (see the comment in ext[34]_symlink() for gory details).  Then,
if everything went fine, they pull it out of the orphan list and bump the
link count back to 1.  The thing is, inc_nlink() is going to complain about
seeing somebody changing i_nlink from 0 to 1.  With a good reason, since
normally something like that is a bug.  Explicit set_nlink(inode, 1) does
the same thing as inc_nlink() here, but it does *not* complain - exactly
because it should be usable in strange situations like this one.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ext3/namei.c
fs/ext4/namei.c