Whamcloud - gitweb
LU-4185 llite: Revise create with no open optimization 57/8257/10
authorBobi Jam <bobijam.xu@intel.com>
Wed, 13 Nov 2013 07:56:25 +0000 (15:56 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 5 Oct 2016 03:51:18 +0000 (03:51 +0000)
commita2d5b2e83c0a512a3ea59698e8481621ab5856c2
tree79c071007ed6cb0001b481afbd3b63813d601e06
parent1a92e40bd05c05820c902ce4ee738212a308d9e2
LU-4185 llite: Revise create with no open optimization

Currently ll_lookup_nd just returns a negative when we are trying
to create something with no open (read mkdir). This is all fine most
of the cases, except if the directory where we are trying to do is
not writeable by us. In that case vfs_create would return EPERM
seeing as how a negative dentry means the create cannot proceed.
But in reality if there is an existing name there that we just did
not have cached, the proper return is EEXIST that could only happen
if we did do the lookup.

So amend the optimization to only take place if the directory is
writeable by us, otherwise do the full lookup.

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I1480320bd56431a2e47ae686450678324ca17633
Reviewed-on: http://review.whamcloud.com/8257
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
lustre/llite/namei.c
lustre/tests/sanity.sh