Linux NILFS development
 help / color / mirror / Atom feed
* [RFC] simplifying the "is it mounted" checks for nilfs2
@ 2013-07-05 22:03 Al Viro
       [not found] ` <20130705220309.GU4165-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2013-07-05 22:03 UTC (permalink / raw)
  To: Ryusuke Konishi
  Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA

Do you see any problems with just giving nilfs ->drop_inode() instance
like this:
int nilfs2_drop_inode(struct inode *inode)
{
	if (unlikely(inode->i_ino == NILFS_ROOT_INO))
		return true;
	return generic_drop_inode(inode);
}
Then nilfs_root will live exactly until we unmount the damn thing, giving us
int nilfs_checkpoint_is_mounted(struct super_block *sb, __u64 cno)
{
        struct the_nilfs *nilfs = sb->s_fs_info;

        if (cno < 0 || cno > nilfs->ns_cno)
                return false;

        if (cno >= nilfs_last_cno(nilfs))
                return true;    /* protect recent checkpoints */

        return nilfs_lookup_root(nilfs, cno) != NULL;
}
while the logics in nilfs_mount becoming simply
	busy = d_count(s->s_root) > 1;
and we don't need to bother with nilfs_try_to_shrink_tree() at all.

I might be missing something, but it looks like that would work...
Comments?
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] simplifying the "is it mounted" checks for nilfs2
       [not found] ` <20130705220309.GU4165-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
@ 2013-07-05 23:33   ` Al Viro
  2013-07-06  8:56     ` Ryusuke Konishi
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2013-07-05 23:33 UTC (permalink / raw)
  To: Ryusuke Konishi
  Cc: linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA

On Fri, Jul 05, 2013 at 11:03:09PM +0100, Al Viro wrote:
> Do you see any problems with just giving nilfs ->drop_inode() instance
> like this:
> int nilfs2_drop_inode(struct inode *inode)
> {
> 	if (unlikely(inode->i_ino == NILFS_ROOT_INO))
> 		return true;
> 	return generic_drop_inode(inode);
> }
> Then nilfs_root will live exactly until we unmount the damn thing, giving us

... except that it won't be enough ;-/  Nothing to kick dentries out
on such ummount of a secondary.  Oh, well...  I still doubt that
have_submounts() makes any sense there, but...
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] simplifying the "is it mounted" checks for nilfs2
  2013-07-05 23:33   ` Al Viro
@ 2013-07-06  8:56     ` Ryusuke Konishi
  0 siblings, 0 replies; 3+ messages in thread
From: Ryusuke Konishi @ 2013-07-06  8:56 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-nilfs, linux-fsdevel

On Sat, 6 Jul 2013 00:33:35 +0100, Al Viro wrote:
> On Fri, Jul 05, 2013 at 11:03:09PM +0100, Al Viro wrote:
>> Do you see any problems with just giving nilfs ->drop_inode() instance
>> like this:
>> int nilfs2_drop_inode(struct inode *inode)
>> {
>> 	if (unlikely(inode->i_ino == NILFS_ROOT_INO))
>> 		return true;
>> 	return generic_drop_inode(inode);
>> }
>> Then nilfs_root will live exactly until we unmount the damn thing, giving us
> 
> ... except that it won't be enough ;-/  Nothing to kick dentries out
> on such ummount of a secondary.  Oh, well...  I still doubt that
> have_submounts() makes any sense there, but...

Yes, the test with nilfs_lookup_root() is not enough because the root
dentry of a secondary mount is not shrunk when its mountpoint is
unmounted.

Thus the current nilfs_checkpoint_is_mounted() implementation needs to
test whether the root dentry of the specified checkpoint is busy
(mounted) or not.

Is there any good way to shrink dentries of such subvolumes at the
time of their unmount ?


Regards,
Ryusuke Konishi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-06  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-05 22:03 [RFC] simplifying the "is it mounted" checks for nilfs2 Al Viro
     [not found] ` <20130705220309.GU4165-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2013-07-05 23:33   ` Al Viro
2013-07-06  8:56     ` Ryusuke Konishi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox