xfs
[Top] [All Lists]

Re: [PATCH 15/15] mkfs: don't treat files as though they are block devic

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 15/15] mkfs: don't treat files as though they are block devices
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 3 Dec 2013 10:21:43 +1100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20131202172441.GF28630@xxxxxxxxxxxxx>
References: <1385689430-10103-1-git-send-email-david@xxxxxxxxxxxxx> <1385689430-10103-16-git-send-email-david@xxxxxxxxxxxxx> <20131202172441.GF28630@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Dec 02, 2013 at 09:24:41AM -0800, Christoph Hellwig wrote:
> >  void
> >  platform_flush_device(int fd, dev_t device)
> >  {
> > -   if (major(device) != RAMDISK_MAJOR)
> > +   struct stat64   st;
> > +   if (major(device) == RAMDISK_MAJOR)
> > +           return;
> > +
> > +   if (fstat64(fd, &st) < 0)
> > +           return;
> > +
> > +   if (S_ISREG(st.st_mode))
> > +           fsync(fd);
> > +   else
> >             ioctl(fd, BLKFLSBUF, 0);
> >  }
> 
> Given that fsync does the right thing for device on Linux aswell
> I'd suggest we make this function call it all the time and get rid
> of all the ramdisk magic.
> 
> Should probabbly be a a separate patch.

Yeah, I just shovelled all the fixes to problems I found into this
patch, so it needs to be split up a bit more....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>