From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Sage Weil <sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] vfs: introduce FS_IOC_SYNCFS to sync a single super
Date: Thu, 26 Aug 2010 17:01:42 -0700 [thread overview]
Message-ID: <20100826170142.e029cff5.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.1008090711040.17515-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
On Mon, 9 Aug 2010 07:33:57 -0700 (PDT)
Sage Weil <sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org> wrote:
> Currently the only way to sync a single super_block (and not all of them
> via sync(2)) is via the BLKFLSBUF ioctl on the block device. That also
> invalidates the bdev mapping, which isn't usually desireable
Actually you can do
mount -o remount /dev/whatever
and it will sync the fs and retain caches.
> and it
> doesn't work for non-block file systems.
And I guess remount will do that also.
> The ability to sync a single
> mount can be useful for both applications and administrators (e.g., when
> other mounts on the system are hung).
>
> Introduce a simple ioctl to sync the super associated with an open file.
> Pass any error returned by sync_filesystem() back to the user.
>
The changelog forgot to tell us why this is a useful thing to add.
What is the use-case?
> ---
> fs/ioctl.c | 9 +++++++++
> include/linux/fs.h | 1 +
> 2 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ioctl.c b/fs/ioctl.c
> index 2d140a7..2aabb19 100644
> --- a/fs/ioctl.c
> +++ b/fs/ioctl.c
> @@ -593,6 +593,15 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
> case FS_IOC_FIEMAP:
> return ioctl_fiemap(filp, arg);
>
> + case FS_IOC_SYNCFS:
> + {
> + struct super_block *sb = filp->f_dentry->d_sb;
> + down_read(&sb->s_umount);
> + error = sync_filesystem(sb);
> + up_read(&sb->s_umount);
> + break;
> + }
> +
`mount -o remount' is surely a Linux-specific side-effect and there's
really no guarantee that Linux will always retain that side-effect.
OTOH FS_IOC_SYNCFS is linux-specific.
If we're going to add something like this then it will need to be
documented in manpages. Supposedly, a cc to linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
will help make all that happen, but I'm not sure who if anyone is
answering the phone over there?
next parent reply other threads:[~2010-08-27 0:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.1008090711040.17515@cobra.newdream.net>
[not found] ` <Pine.LNX.4.64.1008090711040.17515-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
2010-08-27 0:01 ` Andrew Morton [this message]
[not found] ` <20100826170142.e029cff5.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2010-09-08 21:44 ` [PATCH] vfs: introduce FS_IOC_SYNCFS to sync a single super Sage Weil
2010-11-27 22:32 ` Jonathan Nieder
2010-11-28 5:04 ` Jonathan Nieder
[not found] ` <201008092055.07248.arnd@arndb.de>
[not found] ` <201008092055.07248.arnd-r2nGTMty4D4@public.gmane.org>
2010-11-27 22:57 ` Jonathan Nieder
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=20100826170142.e029cff5.akpm@linux-foundation.org \
--to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sage-BnTBU8nroG7k1uMJSBkQmQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).