1. 21 12月, 2012 2 次提交
    • J
      vfs: remove unneeded permission check from path_init · 582aa64a
      Jeff Layton 提交于
      When path_init is called with a valid dfd, that code checks permissions
      on the open directory fd and returns an error if the check fails. This
      permission check is redundant, however.
      
      Both callers of path_init immediately call link_path_walk afterward. The
      first thing that link_path_walk does for pathnames that do not consist
      only of slashes is to check for exec permissions at the starting point of
      the path walk.  And this check in path_init() is on the path taken only
      when *name != '/' && *name != '\0'.
      
      In most cases, these checks are very quick, but when the dfd is for a
      file on a NFS mount with the actimeo=0, each permission check goes
      out onto the wire. The result is 2 identical ACCESS calls.
      
      Given that these codepaths are fairly "hot", I think it makes sense to
      eliminate the permission check in path_init and simply assume that the
      caller will eventually check the permissions before proceeding.
      Reported-by: NDave Wysochanski <dwysocha@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      582aa64a
    • M
      vfs, freeze: use ACCESS_ONCE() to guard access to ->mnt_flags · 1e75529e
      Miao Xie 提交于
      The compiler may optimize the while loop and make the check just be done once,
      so we should use ACCESS_ONCE() to guard access to ->mnt_flags
      Signed-off-by: NMiao Xie <miaox@cn.fujitsu.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1e75529e
  2. 20 12月, 2012 38 次提交