Re: [PATCH 2/4] chardev: Increment cdev reference count when i_cdev references it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 04-11-14 15:40:30, Al Viro wrote:
> On Tue, Nov 04, 2014 at 04:37:52PM +0100, Jan Kara wrote:
> > On Tue 04-11-14 14:46:11, Al Viro wrote:
> > > On Wed, Oct 22, 2014 at 10:14:11PM +0200, Jan Kara wrote:
> > > > Currently i_cdev reference to a character device isn't accounted in the
> > > > reference count of the character device. This then requires us to track
> > > > all references through a list of all inodes referencing a character
> > > > device which is somewhat clumsy and requires list_head in each inode in
> > > > the system.
> > > > 
> > > > So make i_cdev a reference like any other.
> > > 
> > > So no rmmod for you until an inode of character device node you had
> > > closed a while ago finally gets evicted from icache?  Or am I misreading
> > > you?
> >   Yes, this is a consequence of the change. I should have noted in the
> > changelog I guess.
> 
> That consequence looks broken, IMO.
  Hum, it already behaves for block devices that way (and noone complained
- but admittedly block devices tied to strange modules are less common than
character devices). Also rmmod isn't that common IMO, but I see your point
that it's unintuitive behavior.

Alternatively we could clear i_cdev when the inode isn't open anymore (and
thus doesn't hold any references to cdev). The downside is we have to
re-lookup the character device on the first inode open. Would such a
solution look acceptable to you?

								Honza
-- 
Jan Kara <jack@xxxxxxx>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux