commit | 16780cabb877dbd0c8c5e9ff9bdebd6c5bdd1a7b | [log] [tgz] |
---|---|---|
author | Chris Mason <chris.mason@oracle.com> | Mon Feb 20 22:14:55 2012 -0500 |
committer | Chris Mason <chris.mason@oracle.com> | Thu Feb 23 10:43:45 2012 -0500 |
tree | d244896098a1e8dfd23403a335315a4b822c95d3 | |
parent | a6b0d5c8dbfd428717fc4db4c36757783f391c7b [diff] |
Btrfs: add extra sanity checks on the path names in btrfs_mksubvol Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e9bdb8b..05446f7 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c
@@ -1333,6 +1333,12 @@ goto out; } + if (name[0] == '.' && + (namelen == 1 || (name[1] == '.' && namelen == 2))) { + ret = -EEXIST; + goto out; + } + if (subvol) { ret = btrfs_mksubvol(&file->f_path, name, namelen, NULL, transid, readonly);