From: Darrick J. Wong Date: Mon, 13 Dec 2010 14:23:45 +0000 (-0500) Subject: e4defrag: open the file to be defragged in read/write mode X-Git-Tag: v1.42-WIP-0702~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90b9dce3e566613d509554e278c01126c83f8612;p=thirdparty%2Fe2fsprogs.git e4defrag: open the file to be defragged in read/write mode Akira Fujita merged a patch into 2.6.33 that adds a requirement that a file being defragged must be opened with read and write access, so e2fsprogs needs to satisfy that. Signed-off-by: Darrick J. Wong Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/e4defrag.c b/misc/e4defrag.c index 82e386893..424e0cae1 100644 --- a/misc/e4defrag.c +++ b/misc/e4defrag.c @@ -1605,7 +1605,7 @@ static int file_defrag(const char *file, const struct stat64 *buf, return 0; } - fd = open64(file, O_RDONLY); + fd = open64(file, O_RDWR); if (fd < 0) { if (mode_flag & DETAIL) { PRINT_FILE_NAME(file);