]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e4defrag: open the file to be defragged in read/write mode
authorDarrick J. Wong <djwong@us.ibm.com>
Mon, 13 Dec 2010 14:23:45 +0000 (09:23 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Dec 2010 14:23:45 +0000 (09:23 -0500)
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 <djwong@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/e4defrag.c

index 82e38689377d7210542cae6930a0484a8c283dce..424e0cae13a05ef1b6fc3bc13bea48b51412ac34 100644 (file)
@@ -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);