[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/4] Conditionally forward some fsys_* RPCs to the mountee.
From: |
Carl Fredrik Hammar |
Subject: |
Re: [PATCH 3/4] Conditionally forward some fsys_* RPCs to the mountee. |
Date: |
Mon, 27 Jul 2009 09:12:46 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hi,
This is just a thought that suddenly struck me, I figure I'll get it
out so I don't forget it.
On Fri, Jul 17, 2009 at 01:58:01PM +0300, Sergiu Ivanov wrote:
> +/* Shutdown the filesystem; flags are as for fsys_goaway. */
> +error_t
> +netfs_shutdown (int flags)
> +{
> + int nports;
> + int err;
> +
> + if ((flags & FSYS_GOAWAY_UNLINK)
> + && S_ISDIR (netfs_root_node->nn_stat.st_mode))
> + return EBUSY;
> +
> + /* Permit all current RPC's to finish, and then suspend any new ones. */
> + err = ports_inhibit_class_rpcs (netfs_protid_class);
> + if (err)
> + return err;
> +
> + nports = ports_count_class (netfs_protid_class);
> + if (((flags & FSYS_GOAWAY_FORCE) == 0) && nports)
> + /* There are outstanding user ports; resume operations. */
> + {
> + ports_enable_class (netfs_protid_class);
> + ports_resume_class_rpcs (netfs_protid_class);
> +
> + return EBUSY;
> + }
> +
> + if (!(flags & FSYS_GOAWAY_NOSYNC))
> + {
> + err = netfs_attempt_syncfs (0, flags);
> + if (err)
> + return err;
> + }
> +
> + /* If `shutting_down` is set, unionfs is going away because the
> + mounee has just died, so we don't need to attempt to shut it
> + down. */
> + if (!shutting_down)
> + {
> + shutting_down = 1;
> + err = fsys_goaway (mountee_control, flags);
> + if (err)
> + return err;
> + }
> +
> return 0;
> }
Shouldn't you resume operations if fsys_goaway returns EBUSY?
Regards,
Fredrik
- [PATCH 0/4] Transparent Unionmount, Sergiu Ivanov, 2009/07/17
- [PATCH 1/4] Add the ``--no-mount'' option., Sergiu Ivanov, 2009/07/17
- [PATCH 2/4] Go away when the mountee has been shut down., Sergiu Ivanov, 2009/07/17
- [PATCH 3/4] Conditionally forward some fsys_* RPCs to the mountee., Sergiu Ivanov, 2009/07/17
- Re: [PATCH 3/4] Conditionally forward some fsys_* RPCs to the mountee.,
Carl Fredrik Hammar <=
- [PATCH 4/4] Supply the port to the real underlying node to the mountee., Sergiu Ivanov, 2009/07/17
- Re: [PATCH 0/4] Transparent Unionmount, olafBuddenhagen, 2009/07/30