mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikita Danilov <nikita@clusterfs.com>
To: Linux Kernel Mailing List <Linux-Kernel@Vger.Kernel.ORG>
Subject: Re: [PATCH] fs:lock_rename()/unlock_rename() can lead to deadlock in distributed fs.
Date: Mon, 27 Jun 2005 20:15:13 +0400	[thread overview]
Message-ID: <17088.9784.776332.225807@gargle.gargle.HOWL> (raw)

Zuzana Petrova writes:
 > The problem with lock_rename() is that it compares parent directory dentries  
 > when trying to decide how many inode i_sem semaphores to acquire.  That works  
 > fine on a single node system, but not in a distributed environment, on a  
 > distributed filesystem.  
 >   
 > The problem with rename(2) in a cluster, is that there is no guarantee that  
 > path_lookup()s will return a coherent path structure while at the same time  
 > renames, on another node, are executing on that same path hierarchy.  In our  
 > case, in do_rename(), the parent directory path_lookup()s find/create unique  
 > dentries for the old_dir and new_dir, however, because a rename(2) on another  
 > node was executing, both dentries end up pointing to the same inode.  
 >   
 > When lock_rename(new_dir, old_dir) is called, the dentries don't match, so we  
 > end up in a code path that tries to acquire the inode i_sem of both the  
 > old_dir and new_dir, but since they point to the same inode, the second  
 > attempt to acquire the same i_sem results in a deadlock.  
 >   
 > A fix would be to compare the dentries ->d_inode field instead.  Patch for  
 > kernel 2.6.12.1 attached.

reiser4 had identical patch before pseudo files were disabled. It even
went into -mm:

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.9-rc1/2.6.9-rc1-mm1/broken-out/reiser4-aliased-dir.patch

Nikita.

 > 
 > Author of the patch is Michael Gaughen <mgaughen@polyserve.com>
 > 
 > --
 > Zuzana Petrova

Nikita.

             reply	other threads:[~2005-06-27 16:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-27 16:15 Nikita Danilov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-06-27  9:24 Zuzana Petrova
2005-06-27  9:39 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17088.9784.776332.225807@gargle.gargle.HOWL \
    --to=nikita@clusterfs.com \
    --cc=Linux-Kernel@Vger.Kernel.ORG \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®