From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 2/5] xfs: add flush flag to xfs_eofblocks
Date: Tue, 1 Apr 2014 09:48:12 -0400 [thread overview]
Message-ID: <20140401134810.GB21540@bfoster.bfoster> (raw)
In-Reply-To: <20140331214754.GE17603@dastard>
On Tue, Apr 01, 2014 at 08:47:54AM +1100, Dave Chinner wrote:
> On Fri, Mar 28, 2014 at 09:16:00AM -0400, Brian Foster wrote:
> > The flush flag allows the caller to issue a flush for scanned inodes. In
> > ENOSPC conditions caused by project quotas, a flush is required to free
> > up reserved metadata allocations.
> >
> > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > ---
> > fs/xfs/xfs_fs.h | 4 +++-
> > fs/xfs/xfs_icache.c | 3 +++
> > 2 files changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/xfs/xfs_fs.h b/fs/xfs/xfs_fs.h
> > index c5fc116..fa3a58e 100644
> > --- a/fs/xfs/xfs_fs.h
> > +++ b/fs/xfs/xfs_fs.h
> > @@ -374,12 +374,14 @@ struct xfs_fs_eofblocks {
> > #define XFS_EOF_FLAGS_GID (1 << 2) /* filter by gid */
> > #define XFS_EOF_FLAGS_PRID (1 << 3) /* filter by project id */
> > #define XFS_EOF_FLAGS_MINFILESIZE (1 << 4) /* filter by min file size */
> > +#define XFS_EOF_FLAGS_FLUSH (1 << 5) /* issue a flush */
> > #define XFS_EOF_FLAGS_VALID \
> > (XFS_EOF_FLAGS_SYNC | \
> > XFS_EOF_FLAGS_UID | \
> > XFS_EOF_FLAGS_GID | \
> > XFS_EOF_FLAGS_PRID | \
> > - XFS_EOF_FLAGS_MINFILESIZE)
> > + XFS_EOF_FLAGS_MINFILESIZE | \
> > + XFS_EOF_FLAGS_FLUSH)
> >
> >
> > /*
> > diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
> > index 7ff59c9..d4e15db 100644
> > --- a/fs/xfs/xfs_icache.c
> > +++ b/fs/xfs/xfs_icache.c
> > @@ -1231,6 +1231,9 @@ xfs_inode_free_eofblocks(
> > if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&
> > XFS_ISIZE(ip) < eofb->eof_min_file_size)
> > return 0;
> > +
> > + if (eofb->eof_flags & XFS_EOF_FLAGS_FLUSH)
> > + filemap_flush(VFS_I(ip)->i_mapping);
>
> So this does WB_SYNC_NONE writeback, which means the filesystem is
> free to ignore it when we get to .writepage. Given that we are are
> ENOSPC here, wouldn't it be better to guarantee that writeback will
> occur (i.e. use filemap_fdatawrite())?
>
Yeah, I didn't catch that. That makes sense, thanks.
Brian
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-04-01 13:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 13:15 [PATCH 0/5] xfs: run eofblocks scan on ENOSPC Brian Foster
2014-03-28 13:15 ` [PATCH 1/5] xfs: do eofb filtering before dirty check Brian Foster
2014-03-28 13:16 ` [PATCH 2/5] xfs: add flush flag to xfs_eofblocks Brian Foster
2014-03-31 21:47 ` Dave Chinner
2014-04-01 13:48 ` Brian Foster [this message]
2014-03-28 13:16 ` [PATCH 3/5] xfs: add scan owner field " Brian Foster
2014-03-28 13:16 ` [PATCH 4/5] xfs: run an eofblocks scan on ENOSPC/EDQUOT Brian Foster
2014-03-31 22:22 ` Dave Chinner
2014-04-01 13:55 ` Brian Foster
2014-04-01 21:19 ` Dave Chinner
2014-04-01 23:20 ` Brian Foster
2014-04-02 5:11 ` Dave Chinner
2014-04-02 20:11 ` Brian Foster
2014-04-03 22:18 ` Dave Chinner
2014-03-28 13:16 ` [PATCH 5/5] xfs: squash prealloc while over quota free space as well Brian Foster
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=20140401134810.GB21540@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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.