aboutsummaryrefslogtreecommitdiff
path: root/mkfs/main.c
diff options
context:
space:
mode:
authorIgor Ostapenko <igoreisberg@gmail.com>2022-01-20 09:32:03 +0800
committerKelvin Zhang <zhangkelvin@google.com>2022-01-31 10:36:37 -0800
commit3d56e12f952aaf45cd649d8ca7fc9b36257e119b (patch)
tree08c292dce32000f7d771bdd29122d256356c48ba /mkfs/main.c
parent6a64bcbb676cd39eb380501a5dc10fa2bc84dcb0 (diff)
downloaderofs-utils-3d56e12f952aaf45cd649d8ca7fc9b36257e119b.tar.gz
UPSTREAM: erofs-utils: fsck: add --extract=X support to extract to path X
Add support to extract directories, regular files and symlinks. Allocation for extract_path is done only once, then the buffer is reused. Raw and compressed data chunks are handled with a unified function to avoid code duplication, compressed data is verified linearly (with EROFS_GET_BLOCKS_FIEMAP) instead of lookback, as it's problematic to extract data when looking backwards. Link: https://lore.kernel.org/r/20220120013203.25990-1-xiang@kernel.org Signed-off-by: Igor Ostapenko <igoreisberg@gmail.com> Signed-off-by: Gao Xiang <xiang@kernel.org> Change-Id: Iea39e71a3bf63a34e20b7f7445510705f5ffa00e
Diffstat (limited to 'mkfs/main.c')
-rw-r--r--mkfs/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mkfs/main.c b/mkfs/main.c
index 90cedde..1787b2c 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -589,7 +589,7 @@ int main(int argc, char **argv)
err = lstat64(cfg.c_src_path, &st);
if (err)
return 1;
- if ((st.st_mode & S_IFMT) != S_IFDIR) {
+ if (!S_ISDIR(st.st_mode)) {
erofs_err("root of the filesystem is not a directory - %s",
cfg.c_src_path);
usage();