diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/export.c | 8 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index ff27d7a477b2..b4ffad859adb 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c | |||
@@ -21,9 +21,13 @@ static int btrfs_encode_fh(struct dentry *dentry, u32 *fh, int *max_len, | |||
21 | int len = *max_len; | 21 | int len = *max_len; |
22 | int type; | 22 | int type; |
23 | 23 | ||
24 | if ((len < BTRFS_FID_SIZE_NON_CONNECTABLE) || | 24 | if (connectable && (len < BTRFS_FID_SIZE_CONNECTABLE)) { |
25 | (connectable && len < BTRFS_FID_SIZE_CONNECTABLE)) | 25 | *max_len = BTRFS_FID_SIZE_CONNECTABLE; |
26 | return 255; | 26 | return 255; |
27 | } else if (len < BTRFS_FID_SIZE_NON_CONNECTABLE) { | ||
28 | *max_len = BTRFS_FID_SIZE_NON_CONNECTABLE; | ||
29 | return 255; | ||
30 | } | ||
27 | 31 | ||
28 | len = BTRFS_FID_SIZE_NON_CONNECTABLE; | 32 | len = BTRFS_FID_SIZE_NON_CONNECTABLE; |
29 | type = FILEID_BTRFS_WITHOUT_PARENT; | 33 | type = FILEID_BTRFS_WITHOUT_PARENT; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 93323ac26b0a..512c3d1da083 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4807,9 +4807,6 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, | |||
4807 | int err; | 4807 | int err; |
4808 | int drop_inode = 0; | 4808 | int drop_inode = 0; |
4809 | 4809 | ||
4810 | if (inode->i_nlink == 0) | ||
4811 | return -ENOENT; | ||
4812 | |||
4813 | /* do not allow sys_link's with other subvols of the same device */ | 4810 | /* do not allow sys_link's with other subvols of the same device */ |
4814 | if (root->objectid != BTRFS_I(inode)->root->objectid) | 4811 | if (root->objectid != BTRFS_I(inode)->root->objectid) |
4815 | return -EPERM; | 4812 | return -EPERM; |