Date: Fri, 2 Feb 2018 22:06:15 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328813 - head/lib/libufs Message-ID: <201802022206.w12M6FHg035274@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Fri Feb 2 22:06:15 2018 New Revision: 328813 URL: https://svnweb.freebsd.org/changeset/base/328813 Log: In the sbwrite(3) function, ensure that the file descriptor has been upgraded to writable. Reported by: Kyle Evans <kevans@freebsd.org> Modified: head/lib/libufs/sblock.c Modified: head/lib/libufs/sblock.c ============================================================================== --- head/lib/libufs/sblock.c Fri Feb 2 22:05:36 2018 (r328812) +++ head/lib/libufs/sblock.c Fri Feb 2 22:06:15 2018 (r328813) @@ -96,8 +96,15 @@ int sbwrite(struct uufsd *disk, int all) { struct fs *fs; + int rv; ERROR(disk, NULL); + + rv = ufs_disk_write(disk); + if (rv == -1) { + ERROR(disk, "failed to open disk for writing"); + return (-1); + } fs = &disk->d_fs; if ((errno = sbput(disk->d_fd, fs, all ? fs->fs_ncg : 0)) != 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802022206.w12M6FHg035274>