Paulo Alcantara
2013-Jan-06 22:11 UTC
[syslinux] [PATCH] extlinux: Make sure ldlinux.sys file is installed
Due to delayed allocation feature on XFS filesystems, a write is not guaranteed to flushed out to the underlying file system after crash or something else - so we need to make sure that ldlinux.sys is installed correctly in the mounted filesystem. Signed-off-by: Paulo Alcantara <pcacjr at zytor.com> --- extlinux/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extlinux/main.c b/extlinux/main.c index 0204caa..f7eeeb7 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -687,6 +687,8 @@ static int xfs_install_file(const char *path, int devfd, struct stat *rst) } close(dirfd); + + syncfs(fd); close(fd); return 0; -- 1.8.1
H. Peter Anvin
2013-Jan-07 04:36 UTC
[syslinux] [PATCH] extlinux: Make sure ldlinux.sys file is installed
On 01/06/2013 02:11 PM, Paulo Alcantara wrote:> Due to delayed allocation feature on XFS filesystems, a write is not > guaranteed to flushed out to the underlying file system after crash or > something else - so we need to make sure that ldlinux.sys is installed > correctly in the mounted filesystem. > > Signed-off-by: Paulo Alcantara <pcacjr at zytor.com> > --- > extlinux/main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/extlinux/main.c b/extlinux/main.c > index 0204caa..f7eeeb7 100644 > --- a/extlinux/main.c > +++ b/extlinux/main.c > @@ -687,6 +687,8 @@ static int xfs_install_file(const char *path, int devfd, struct stat *rst) > } > > close(dirfd); > + > + syncfs(fd); > close(fd); > > return 0; >Wouldn't fsync() make more sense? -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
Paulo Alcantara
2013-Jan-07 08:14 UTC
[syslinux] [PATCH v2] extlinux: Make sure ldlinux.sys file is installed
Due to delayed allocation feature on XFS filesystems, a write is not guaranteed to flushed out to the underlying file system after crash or something else - so we need to make sure that ldlinux.sys is installed correctly in the mounted filesystem. Signed-off-by: Paulo Alcantara <pcacjr at zytor.com> --- extlinux/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extlinux/main.c b/extlinux/main.c index 0204caa..f90ca11 100644 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -687,6 +687,8 @@ static int xfs_install_file(const char *path, int devfd, struct stat *rst) } close(dirfd); + + fsync(fd); close(fd); return 0; -- 1.8.1
Matt Fleming
2013-Jan-09 19:17 UTC
[syslinux] [PATCH v2] extlinux: Make sure ldlinux.sys file is installed
On Mon, 2013-01-07 at 06:14 -0200, Paulo Alcantara wrote:> Due to delayed allocation feature on XFS filesystems, a write is not > guaranteed to flushed out to the underlying file system after crash or > something else - so we need to make sure that ldlinux.sys is installed > correctly in the mounted filesystem. > > Signed-off-by: Paulo Alcantara <pcacjr at zytor.com> > --- > extlinux/main.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/extlinux/main.c b/extlinux/main.c > index 0204caa..f90ca11 100644 > --- a/extlinux/main.c > +++ b/extlinux/main.c > @@ -687,6 +687,8 @@ static int xfs_install_file(const char *path, int devfd, struct stat *rst) > } > > close(dirfd); > + > + fsync(fd); > close(fd); > > return 0;Looks good. Applied, thanks! -- Matt Fleming, Intel Open Source Technology Center