All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: Cornelia Huck <cornelia.huck-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
Cc: Tejun Heo <htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Greg KH <greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>,
	Greg KH <gregkh-l3A5Bk7waGM@public.gmane.org>,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org,
	satyam-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	Linux Containers
	<containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>,
	Dave Hansen <hansendc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 06/14] sysfs: Rewrite sysfs_get_dentry
Date: Fri, 03 Aug 2007 13:29:19 -0600	[thread overview]
Message-ID: <m1tzrgl8mo.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070802102819.183720a4-XQvu0L+U/CiXI4yAdoq52KN5r0PSdgG1zG2AekJRRhI@public.gmane.org> (Cornelia Huck's message of "Thu, 2 Aug 2007 10:28:19 +0200")

Cornelia Huck <cornelia.huck-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org> writes:

> On Thu, 02 Aug 2007 02:51:19 +0900,
> Tejun Heo <htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> Eric W. Biederman wrote:
>> > My practical problem is that I need to hold a lock for the sysfs
>> > dirents and while that lock is held I need to call sysfs_get_dentry
>> > for the destination directory once for each superblock.
>> > 
>> > It might be that some kind of reader-writer lock strategy is what
>> > I need to untangle this mess.  Rather then making changing to i_mutex.
>> > All I know is at the moment it is taking a lot of code reading and
>> > brain storm to come of with something that is easy to maintain.
>> 
>> Just in case, sysfs used to have sysfs_rename_rwsem to protect
>> move/rename against tree walking, which became unnecessary after i_mutex
>> -> sysfs_mutex conversion.  Move/rename can use stupid big fat locks if
>> that helps.
>
> I second that. Reintroduction of sysfs_rename_rwsem or something
> similar may be the best way to avoid headaches.

I guess I haven't looked at that because we already have a big fact
lock we just have an ordering problem in taking that lock.  Introducing
another lock just because of that doesn't quite feel right.

I currently have two practical solutions on the table.

- Make the s_sibling list walk RCU safe so it does not require us to
  grab the sysfs_mutex.  This works but is a bit complicated.

- Just kill all of the dentries in sysfs_move_dir and sysfs_rename_dir.
  The semantics are that no one can be using the device at the time
  of a rename or a move (as I read the callers) so dropping the dentries
  and making it look like a delete/add pair to the users should be
  acceptable and a whole lot simpler.

Eric

  parent reply	other threads:[~2007-08-03 19:29 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4676C798.2090404@bull.net>
     [not found] ` <1182446577.8138.29.camel@localhost>
     [not found]   ` <m1odj9dofp.fsf@ebiederm.dsl.xmission.com>
     [not found]     ` <20070621211637.GB10583@suse.de>
     [not found]       ` <m1fy4ldldm.fsf@ebiederm.dsl.xmission.com>
     [not found]         ` <20070622001328.GA14113@suse.de>
     [not found]           ` <m1tzt0cujt.fsf_-_@ebiederm.dsl.xmission.com>
     [not found]             ` <20070625212339.GA13398@kroah.com>
     [not found]               ` <20070625212339.GA13398-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2007-07-19  4:43                 ` [PATCH 1/4] sysfs: Remove first pass at shadow directory support Eric W. Biederman
     [not found]                   ` <m14pk13svx.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-19  4:45                     ` [PATCH 2/4] sysfs: Implement sysfs manged " Eric W. Biederman
     [not found]                       ` <m1zm1t2e92.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-19  4:46                         ` [PATCH 3/4] sysfs: Implement sysfs_delete_link and sysfs_rename_link Eric W. Biederman
     [not found]                           ` <m1vech2e6o.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-19  4:47                             ` [PATCH 4/4] driver core: Implement shadow directory support for device classes Eric W. Biederman
     [not found]                               ` <m1r6n52e5c.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-21  6:36                                 ` patch driver-core-implement-shadow-directory-support-for-device-classes.patch added to gregkh-2.6 tree gregkh-l3A5Bk7waGM
     [not found]                                   ` <20070721063634.9337314458DB-j1pC+zEt+uWoYr4blSSd5g@public.gmane.org>
2007-07-21 10:00                                     ` Eric W. Biederman
2007-07-21  6:36                             ` patch sysfs-implement-sysfs_delete_link-and-sysfs_rename_link.patch " gregkh-l3A5Bk7waGM
2007-07-21  6:36                         ` patch sysfs-implement-sysfs-manged-shadow-directory-support.patch " gregkh-l3A5Bk7waGM
2007-07-22 19:47                         ` [PATCH 2/4] sysfs: Implement sysfs manged shadow directory support Tejun Heo
     [not found]                           ` <46A3B449.3090409-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-07-22 20:25                             ` Greg KH
     [not found]                               ` <20070722202508.GA18018-l3A5Bk7waGM@public.gmane.org>
2007-07-22 22:19                                 ` Eric W. Biederman
     [not found]                                   ` <m17iosw075.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-23  3:52                                     ` Tejun Heo
     [not found]                                       ` <46A425F9.1030008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-07-24  7:26                                         ` Greg KH
2007-07-30  7:09                                         ` Tejun Heo
     [not found]                                           ` <46AD8E92.7080002-l3A5Bk7waGM@public.gmane.org>
2007-07-30 12:41                                             ` Kirill Korotaev
     [not found]                                               ` <46ADDC7F.1090306-3ImXcnM4P+0@public.gmane.org>
2007-07-30 13:06                                                 ` Tejun Heo
     [not found]                                                   ` <46ADE24E.8020502-l3A5Bk7waGM@public.gmane.org>
2007-07-30 13:57                                                     ` Kirill Korotaev
     [not found]                                                       ` <46ADEE35.8000109-3ImXcnM4P+0@public.gmane.org>
2007-07-30 14:04                                                         ` Tejun Heo
     [not found]                                                           ` <46ADF003.3010100-l3A5Bk7waGM@public.gmane.org>
2007-07-30 15:51                                                             ` Eric W. Biederman
     [not found]                                                               ` <m1ps29vqin.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31  3:24                                                                 ` Eric W. Biederman
     [not found]                                                                   ` <m1k5shuugc.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31  3:41                                                                     ` Tejun Heo
     [not found]                                                                       ` <46AEAF79.6080404-l3A5Bk7waGM@public.gmane.org>
2007-07-31  4:02                                                                         ` Eric W. Biederman
     [not found]                                                                           ` <m1fy35uso4.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31  4:28                                                                             ` Tejun Heo
     [not found]                                                                               ` <46AEBA87.6000400-l3A5Bk7waGM@public.gmane.org>
2007-07-31  7:59                                                                                 ` Eric W. Biederman
     [not found]                                                                                   ` <m1bqdtt34l.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31  8:14                                                                                     ` Tejun Heo
     [not found]                                                                                       ` <46AEEF75.2030101-l3A5Bk7waGM@public.gmane.org>
2007-07-31  8:15                                                                                         ` Tejun Heo
     [not found]                                                                                           ` <46AEEFA6.4000901-l3A5Bk7waGM@public.gmane.org>
2007-07-31 10:16                                                                                             ` [PATCH 0/14] sysfs cleanups Eric W. Biederman
     [not found]                                                                                               ` <m14pjkubd2.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:18                                                                                                 ` [PATCH 01/14] sysfs: Remove first pass at shadow directory support Eric W. Biederman
     [not found]                                                                                                   ` <m1zm1cswp0.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:20                                                                                                     ` [PATCH 02/14] sysfs: In sysfs_lookup protect s_parent with sysfs_mutex Eric W. Biederman
     [not found]                                                                                                       ` <m1vec0swmi.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:22                                                                                                         ` [PATCH 03/14] sysfs: Move all of inode initialization into sysfs_init_inode Eric W. Biederman
     [not found]                                                                                                           ` <m1r6moswhr.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:24                                                                                                             ` [PATCH 04/14] sysfs: Remove unnecessary variable found from sysfs_lookup Eric W. Biederman
     [not found]                                                                                                               ` <m1myxcswfr.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:25                                                                                                                 ` [PATCH 05/14] sysfs: Remove sysfs_instantiate Eric W. Biederman
     [not found]                                                                                                                   ` <m1ir80swdl.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:27                                                                                                                     ` [PATCH 06/14] sysfs: Rewrite sysfs_get_dentry Eric W. Biederman
     [not found]                                                                                                                       ` <m1ejioswai.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:28                                                                                                                         ` [PATCH 07/14] vfs: Remove lookup_one_len_kern Eric W. Biederman
     [not found]                                                                                                                           ` <m1abtcsw8w.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:29                                                                                                                             ` [PATCH 08/14] sysfs: Perform renames under sysfs_mutex Eric W. Biederman
     [not found]                                                                                                                               ` <m16440sw6d.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:33                                                                                                                                 ` [PATCH 09/14] sysfs: Move all of sysfs_move_dir " Eric W. Biederman
     [not found]                                                                                                                                   ` <m11weosvzz.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:37                                                                                                                                     ` [PATCH 10/14] sysfs: Rework sysfs_drop_dentry Eric W. Biederman
     [not found]                                                                                                                                       ` <m1wswgrh8x.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:39                                                                                                                                         ` [PATCH 11/14] sysfs: Remove s_dentry form sysfs_dirent Eric W. Biederman
     [not found]                                                                                                                                           ` <m1sl74rh6e.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:40                                                                                                                                             ` [PATCH 12/14] sysfs: Make sysfs_mount static Eric W. Biederman
     [not found]                                                                                                                                               ` <m1odhsrh46.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:42                                                                                                                                                 ` [PATCH 13/14] sysfs: Simplify readdir Eric W. Biederman
     [not found]                                                                                                                                                   ` <m1k5sgrh1h.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:42                                                                                                                                                     ` [PATCH 14/14] sysfs: In sysfs_lookup don't open code sysfs_find_dirent Eric W. Biederman
     [not found]                                                                                                                                                       ` <m1fy34rh08.fsf_-_-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 11:38                                                                                                                                                         ` Tejun Heo
     [not found]                                                                                                                                                           ` <46AF1F28.3000101-l3A5Bk7waGM@public.gmane.org>
2007-07-31 16:01                                                                                                                                                             ` Eric W. Biederman
2007-07-31 11:36                                                                                                                                                     ` [PATCH 13/14] sysfs: Simplify readdir Tejun Heo
2007-07-31 11:19                                                                                                                                                 ` [PATCH 12/14] sysfs: Make sysfs_mount static Tejun Heo
2007-07-31 11:18                                                                                                                                             ` [PATCH 11/14] sysfs: Remove s_dentry form sysfs_dirent Tejun Heo
2007-07-31 11:17                                                                                                                                         ` [PATCH 10/14] sysfs: Rework sysfs_drop_dentry Tejun Heo
2007-07-31 11:09                                                                                                                                     ` [PATCH 09/14] sysfs: Move all of sysfs_move_dir under sysfs_mutex Tejun Heo
2007-07-31 11:06                                                                                                                                 ` [PATCH 08/14] sysfs: Perform renames " Tejun Heo
     [not found]                                                                                                                                   ` <46AF17A1.2010203-l3A5Bk7waGM@public.gmane.org>
2007-07-31 11:10                                                                                                                                     ` Tejun Heo
2007-07-31 10:59                                                                                                                         ` [PATCH 06/14] sysfs: Rewrite sysfs_get_dentry Tejun Heo
     [not found]                                                                                                                           ` <46AF15F6.6010202-l3A5Bk7waGM@public.gmane.org>
2007-07-31 11:23                                                                                                                             ` Eric W. Biederman
     [not found]                                                                                                                               ` <m11weorf3l.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 11:34                                                                                                                                 ` Tejun Heo
     [not found]                                                                                                                                   ` <46AF1E57.3030209-l3A5Bk7waGM@public.gmane.org>
2007-07-31 14:16                                                                                                                                     ` Tejun Heo
     [not found]                                                                                                                                       ` <20070731141613.GC13674-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2007-07-31 19:24                                                                                                                                         ` Eric W. Biederman
2007-08-01  9:22                                                                                                                                         ` Eric W. Biederman
     [not found]                                                                                                                                           ` <m1fy33pq1r.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-08-01 10:02                                                                                                                                             ` Tejun Heo
     [not found]                                                                                                                                               ` <46B05A1D.5000703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-08-01 17:07                                                                                                                                                 ` Eric W. Biederman
     [not found]                                                                                                                                                   ` <m1vebznpyc.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-08-01 17:20                                                                                                                                                     ` Tejun Heo
     [not found]                                                                                                                                                       ` <46B0C0E6.5030008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-08-01 17:40                                                                                                                                                         ` Eric W. Biederman
     [not found]                                                                                                                                                           ` <m1ir7znog9.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-08-01 17:51                                                                                                                                                             ` Tejun Heo
     [not found]                                                                                                                                                               ` <46B0C817.7060106-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-08-02  8:28                                                                                                                                                                 ` Cornelia Huck
     [not found]                                                                                                                                                                   ` <20070802102819.183720a4-XQvu0L+U/CiXI4yAdoq52KN5r0PSdgG1zG2AekJRRhI@public.gmane.org>
2007-08-03 19:29                                                                                                                                                                     ` Eric W. Biederman [this message]
     [not found]                                                                                                                                                                       ` <m1tzrgl8mo.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-08-06 15:06                                                                                                                                                                         ` Cornelia Huck
2007-07-31 10:44                                                                                                                     ` [PATCH 05/14] sysfs: Remove sysfs_instantiate Tejun Heo
2007-07-31 10:45                                                                                                                 ` [PATCH 04/14] sysfs: Remove unnecessary variable found from sysfs_lookup Tejun Heo
2007-07-31 10:43                                                                                                             ` [PATCH 03/14] sysfs: Move all of inode initialization into sysfs_init_inode Tejun Heo
2007-07-31 10:36                                                                                                         ` [PATCH 02/14] sysfs: In sysfs_lookup protect s_parent with sysfs_mutex Tejun Heo
     [not found]                                                                                                           ` <46AF10B7.3070600-l3A5Bk7waGM@public.gmane.org>
2007-07-31 10:45                                                                                                             ` Eric W. Biederman
     [not found]                                                                                                               ` <m1bqdsrgvy.fsf-T1Yj925okcoyDheHMi7gv2pdwda3JcWeAL8bYrjMMd8@public.gmane.org>
2007-07-31 10:47                                                                                                                 ` Tejun Heo
2007-07-31  3:51                                                                 ` [PATCH 2/4] sysfs: Implement sysfs manged shadow directory support Tejun Heo
2007-07-26  8:00                                     ` Tejun Heo
     [not found]                                       ` <46A85485.40502-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-07-27 10:58                                         ` [Devel] " Kirill Korotaev
2007-07-27 20:59                                         ` Carl-Daniel Hailfinger
2007-07-30 15:36                                         ` Eric W. Biederman
2007-07-22 22:07                             ` Eric W. Biederman
2007-07-21  6:36                     ` patch sysfs-remove-first-pass-at-shadow-directory-support.patch added to gregkh-2.6 tree gregkh-l3A5Bk7waGM
2007-07-22 18:35                     ` [PATCH 1/4] sysfs: Remove first pass at shadow directory support Tejun Heo
     [not found]                       ` <46A3A36F.9070904-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2007-07-22 19:17                         ` Eric W. Biederman

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=m1tzrgl8mo.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=cornelia.huck-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
    --cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-l3A5Bk7waGM@public.gmane.org \
    --cc=hansendc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=satyam-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.