From: Dave Chinner <david@fromorbit.com>
To: Jan Kara <jack@suse.cz>
Cc: "Namjae Jeon" <namjae.jeon@samsung.com>,
"'Theodore Ts'o'" <tytso@mit.edu>,
"'Alexander Viro'" <viro@zeniv.linux.org.uk>,
"'Brian Foster'" <bfoster@redhat.com>,
"'Dmitry Monakhov'" <dmonakhov@openvz.org>,
"'Lukáš Czerner'" <lczerner@redhat.com>,
linux-fsdevel@vger.kernel.org,
"'Ashish Sangwan'" <a.sangwan@samsung.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] fs: file freeze support
Date: Wed, 21 Jan 2015 09:22:22 +1100 [thread overview]
Message-ID: <20150120222222.GF16552@dastard> (raw)
In-Reply-To: <20150120112137.GC15756@quack.suse.cz>
On Tue, Jan 20, 2015 at 12:21:37PM +0100, Jan Kara wrote:
> On Mon 19-01-15 22:07:01, Namjae Jeon wrote:
> > > > When this state is set, any process which tries to modify the file's address
> > > > space, either by pagefault mmap writes or using write(2), will block until
> > > > the this state is cleared. I_WRITE_FREEZED is set by calling FS_IOC_FWFREEZE
> > > > ioctl and clear by FS_IOC_FWTHAW ioctl.
....
> > I checked the routines where checks for I_FROZEN would be required.
> > Most of them are Ok but do_unlinkat() confuses me a little.
> > vfs_unlink is called under parent inode's i_mutex, so we cannot sleep
> > keeping parent's i_mutex held.
> > i.e while freezing file, all file in directory are blocked by parent
> > i_mutex. Is it ok to release parnets->mutex before checking for I_FROZEN
> > or there is some idea?
> So I believe Dave thought that you'd just reuse places we currently use
> to call sb_start_write() / mnt_want_write(). You'd probably have to come up
> with a function like path_want_write() (takes struct path as an argument)
> and which will call mnt_want_write(), sb_start_write(), and do appropriate
> inode freeze handling. Then you replace all calls to mnt_want_write() with
> calls to path_want_write()... Possibly you can also provide a trivial
> wrapper for path_want_write() which takes struct file instead.
Yes, that's pretty much what I as thinking - a single function
that does all the freeze checking/blocking for a given operation,
regardless of the type of freeze we block on. That way all the
nesting semantics are located in one set of code, and it's easy to
verify correct.
> This should also deal with the locking problems you describe above as
> mnt_want_write() is always called before taking i_mutex.
*nod*
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2015-01-20 22:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 11:36 [RFC PATCH] fs: file freeze support Namjae Jeon
2015-01-15 15:19 ` Dmitry Monakhov
2015-01-16 5:54 ` Namjae Jeon
2015-01-15 16:17 ` Jan Kara
2015-01-16 6:48 ` Namjae Jeon
2015-01-16 10:57 ` Jan Kara
2015-01-19 12:34 ` Namjae Jeon
2015-01-18 23:33 ` Dave Chinner
2015-01-19 13:07 ` Namjae Jeon
2015-01-20 11:21 ` Jan Kara
2015-01-20 22:22 ` Dave Chinner [this message]
2015-01-21 0:15 ` Namjae Jeon
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=20150120222222.GF16552@dastard \
--to=david@fromorbit.com \
--cc=a.sangwan@samsung.com \
--cc=bfoster@redhat.com \
--cc=dmonakhov@openvz.org \
--cc=jack@suse.cz \
--cc=lczerner@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=namjae.jeon@samsung.com \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
/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.