Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 1 | /* |
| 2 | * fs/sdcardfs/derived_perm.c |
| 3 | * |
| 4 | * Copyright (c) 2013 Samsung Electronics Co. Ltd |
| 5 | * Authors: Daeho Jeong, Woojoong Lee, Seunghwan Hyun, |
| 6 | * Sunghwan Yun, Sungjong Seo |
| 7 | * |
| 8 | * This program has been developed as a stackable file system based on |
| 9 | * the WrapFS which written by |
| 10 | * |
| 11 | * Copyright (c) 1998-2011 Erez Zadok |
| 12 | * Copyright (c) 2009 Shrikar Archak |
| 13 | * Copyright (c) 2003-2011 Stony Brook University |
| 14 | * Copyright (c) 2003-2011 The Research Foundation of SUNY |
| 15 | * |
| 16 | * This file is dual licensed. It may be redistributed and/or modified |
| 17 | * under the terms of the Apache 2.0 License OR version 2 of the GNU |
| 18 | * General Public License. |
| 19 | */ |
| 20 | |
| 21 | #include "sdcardfs.h" |
| 22 | |
| 23 | /* copy derived state from parent inode */ |
| 24 | static void inherit_derived_state(struct inode *parent, struct inode *child) |
| 25 | { |
| 26 | struct sdcardfs_inode_info *pi = SDCARDFS_I(parent); |
| 27 | struct sdcardfs_inode_info *ci = SDCARDFS_I(child); |
| 28 | |
| 29 | ci->perm = PERM_INHERIT; |
| 30 | ci->userid = pi->userid; |
| 31 | ci->d_uid = pi->d_uid; |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 32 | ci->under_android = pi->under_android; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 33 | set_top(ci, pi->top); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | /* helper function for derived state */ |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 37 | void setup_derived_state(struct inode *inode, perm_t perm, userid_t userid, |
| 38 | uid_t uid, bool under_android, struct inode *top) |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 39 | { |
| 40 | struct sdcardfs_inode_info *info = SDCARDFS_I(inode); |
| 41 | |
| 42 | info->perm = perm; |
| 43 | info->userid = userid; |
| 44 | info->d_uid = uid; |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 45 | info->under_android = under_android; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 46 | set_top(info, top); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 47 | } |
| 48 | |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 49 | /* While renaming, there is a point where we want the path from dentry, but the name from newdentry */ |
| 50 | void get_derived_permission_new(struct dentry *parent, struct dentry *dentry, struct dentry *newdentry) |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 51 | { |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 52 | struct sdcardfs_inode_info *info = SDCARDFS_I(d_inode(dentry)); |
| 53 | struct sdcardfs_inode_info *parent_info= SDCARDFS_I(d_inode(parent)); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 54 | appid_t appid; |
| 55 | |
| 56 | /* By default, each inode inherits from its parent. |
| 57 | * the properties are maintained on its private fields |
| 58 | * because the inode attributes will be modified with that of |
| 59 | * its lower inode. |
| 60 | * The derived state will be updated on the last |
| 61 | * stage of each system call by fix_derived_permission(inode). |
| 62 | */ |
| 63 | |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 64 | inherit_derived_state(d_inode(parent), d_inode(dentry)); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 65 | |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 66 | /* Derive custom permissions based on parent and current node */ |
| 67 | switch (parent_info->perm) { |
| 68 | case PERM_INHERIT: |
| 69 | /* Already inherited above */ |
| 70 | break; |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 71 | case PERM_PRE_ROOT: |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 72 | /* Legacy internal layout places users at top level */ |
| 73 | info->perm = PERM_ROOT; |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 74 | info->userid = simple_strtoul(newdentry->d_name.name, NULL, 10); |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 75 | set_top(info, &info->vfs_inode); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 76 | break; |
| 77 | case PERM_ROOT: |
| 78 | /* Assume masked off by default. */ |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 79 | if (!strcasecmp(newdentry->d_name.name, "Android")) { |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 80 | /* App-specific directories inside; let anyone traverse */ |
| 81 | info->perm = PERM_ANDROID; |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 82 | info->under_android = true; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 83 | set_top(info, &info->vfs_inode); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 84 | } |
| 85 | break; |
| 86 | case PERM_ANDROID: |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 87 | if (!strcasecmp(newdentry->d_name.name, "data")) { |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 88 | /* App-specific directories inside; let anyone traverse */ |
| 89 | info->perm = PERM_ANDROID_DATA; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 90 | set_top(info, &info->vfs_inode); |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 91 | } else if (!strcasecmp(newdentry->d_name.name, "obb")) { |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 92 | /* App-specific directories inside; let anyone traverse */ |
| 93 | info->perm = PERM_ANDROID_OBB; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 94 | set_top(info, &info->vfs_inode); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 95 | /* Single OBB directory is always shared */ |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 96 | } else if (!strcasecmp(newdentry->d_name.name, "media")) { |
| 97 | /* App-specific directories inside; let anyone traverse */ |
| 98 | info->perm = PERM_ANDROID_MEDIA; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 99 | set_top(info, &info->vfs_inode); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 100 | } |
| 101 | break; |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 102 | case PERM_ANDROID_DATA: |
| 103 | case PERM_ANDROID_OBB: |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 104 | case PERM_ANDROID_MEDIA: |
Daniel Rosenberg | fbd34b6 | 2016-05-10 13:42:43 -0700 | [diff] [blame] | 105 | appid = get_appid(newdentry->d_name.name); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 106 | if (appid != 0) { |
| 107 | info->d_uid = multiuser_get_uid(parent_info->userid, appid); |
| 108 | } |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 109 | set_top(info, &info->vfs_inode); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 110 | break; |
| 111 | } |
| 112 | } |
| 113 | |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 114 | void get_derived_permission(struct dentry *parent, struct dentry *dentry) |
| 115 | { |
| 116 | get_derived_permission_new(parent, dentry, dentry); |
| 117 | } |
| 118 | |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 119 | static int descendant_may_need_fixup(perm_t perm) { |
| 120 | if (perm == PERM_PRE_ROOT || perm == PERM_ROOT || perm == PERM_ANDROID) |
| 121 | return 1; |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | static int needs_fixup(perm_t perm) { |
| 126 | if (perm == PERM_ANDROID_DATA || perm == PERM_ANDROID_OBB |
| 127 | || perm == PERM_ANDROID_MEDIA) |
| 128 | return 1; |
| 129 | return 0; |
| 130 | } |
| 131 | |
| 132 | void fixup_perms_recursive(struct dentry *dentry, const char* name, size_t len) { |
| 133 | struct dentry *child; |
| 134 | struct sdcardfs_inode_info *info; |
| 135 | if (!dget(dentry)) |
| 136 | return; |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 137 | if (!d_inode(dentry)) { |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 138 | dput(dentry); |
| 139 | return; |
| 140 | } |
| 141 | info = SDCARDFS_I(d_inode(dentry)); |
| 142 | |
| 143 | if (needs_fixup(info->perm)) { |
Daniel Rosenberg | 9021927 | 2016-10-26 20:27:20 -0700 | [diff] [blame] | 144 | /* We need permission to fix up these values. |
| 145 | * Since permissions are based of of the mount, and |
| 146 | * we are accessing without the mount point, we create |
| 147 | * a fake mount with the permissions we will be using. |
| 148 | */ |
| 149 | struct vfsmount fakemnt; |
| 150 | struct sdcardfs_vfsmount_options opts; |
| 151 | fakemnt.data = &opts; |
| 152 | opts.gid = AID_SDCARD_RW; |
| 153 | opts.mask = 0; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 154 | mutex_lock(&d_inode(dentry)->i_mutex); |
Daniel Rosenberg | 9021927 | 2016-10-26 20:27:20 -0700 | [diff] [blame] | 155 | child = lookup_one_len2(name, &fakemnt, dentry, len); |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 156 | mutex_unlock(&d_inode(dentry)->i_mutex); |
| 157 | if (!IS_ERR(child)) { |
Daniel Rosenberg | 9021927 | 2016-10-26 20:27:20 -0700 | [diff] [blame] | 158 | if (d_inode(child)) { |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 159 | get_derived_permission(dentry, child); |
Daniel Rosenberg | 9021927 | 2016-10-26 20:27:20 -0700 | [diff] [blame] | 160 | fixup_tmp_permissions(d_inode(child)); |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 161 | } |
| 162 | dput(child); |
| 163 | } |
| 164 | } else if (descendant_may_need_fixup(info->perm)) { |
| 165 | mutex_lock(&d_inode(dentry)->i_mutex); |
| 166 | list_for_each_entry(child, &dentry->d_subdirs, d_child) { |
| 167 | fixup_perms_recursive(child, name, len); |
| 168 | } |
| 169 | mutex_unlock(&d_inode(dentry)->i_mutex); |
| 170 | } |
| 171 | dput(dentry); |
| 172 | } |
| 173 | |
| 174 | void fixup_top_recursive(struct dentry *parent) { |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 175 | struct dentry *dentry; |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 176 | struct sdcardfs_inode_info *info; |
| 177 | if (!d_inode(parent)) |
| 178 | return; |
| 179 | info = SDCARDFS_I(d_inode(parent)); |
Daniel Rosenberg | cb1b945 | 2016-08-16 15:19:26 -0700 | [diff] [blame] | 180 | spin_lock(&parent->d_lock); |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 181 | list_for_each_entry(dentry, &parent->d_subdirs, d_child) { |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 182 | if (d_inode(dentry)) { |
| 183 | if (SDCARDFS_I(d_inode(parent))->top != SDCARDFS_I(d_inode(dentry))->top) { |
| 184 | get_derived_permission(parent, dentry); |
Daniel Rosenberg | 9021927 | 2016-10-26 20:27:20 -0700 | [diff] [blame] | 185 | fixup_tmp_permissions(d_inode(dentry)); |
Daniel Rosenberg | 5080d24 | 2016-05-18 16:57:10 -0700 | [diff] [blame] | 186 | fixup_top_recursive(dentry); |
| 187 | } |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 188 | } |
| 189 | } |
Daniel Rosenberg | cb1b945 | 2016-08-16 15:19:26 -0700 | [diff] [blame] | 190 | spin_unlock(&parent->d_lock); |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 191 | } |
| 192 | |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 193 | /* main function for updating derived permission */ |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 194 | inline void update_derived_permission_lock(struct dentry *dentry) |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 195 | { |
| 196 | struct dentry *parent; |
| 197 | |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 198 | if(!dentry || !d_inode(dentry)) { |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 199 | printk(KERN_ERR "sdcardfs: %s: invalid dentry\n", __func__); |
| 200 | return; |
| 201 | } |
| 202 | /* FIXME: |
| 203 | * 1. need to check whether the dentry is updated or not |
| 204 | * 2. remove the root dentry update |
| 205 | */ |
| 206 | if(IS_ROOT(dentry)) { |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 207 | //setup_default_pre_root_state(d_inode(dentry)); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 208 | } else { |
| 209 | parent = dget_parent(dentry); |
| 210 | if(parent) { |
| 211 | get_derived_permission(parent, dentry); |
| 212 | dput(parent); |
| 213 | } |
| 214 | } |
Daniel Rosenberg | 9021927 | 2016-10-26 20:27:20 -0700 | [diff] [blame] | 215 | fixup_tmp_permissions(d_inode(dentry)); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 216 | } |
| 217 | |
| 218 | int need_graft_path(struct dentry *dentry) |
| 219 | { |
| 220 | int ret = 0; |
| 221 | struct dentry *parent = dget_parent(dentry); |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 222 | struct sdcardfs_inode_info *parent_info= SDCARDFS_I(d_inode(parent)); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 223 | struct sdcardfs_sb_info *sbi = SDCARDFS_SB(dentry->d_sb); |
| 224 | |
| 225 | if(parent_info->perm == PERM_ANDROID && |
| 226 | !strcasecmp(dentry->d_name.name, "obb")) { |
| 227 | |
| 228 | /* /Android/obb is the base obbpath of DERIVED_UNIFIED */ |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 229 | if(!(sbi->options.multiuser == false |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 230 | && parent_info->userid == 0)) { |
| 231 | ret = 1; |
| 232 | } |
| 233 | } |
| 234 | dput(parent); |
| 235 | return ret; |
| 236 | } |
| 237 | |
| 238 | int is_obbpath_invalid(struct dentry *dent) |
| 239 | { |
| 240 | int ret = 0; |
| 241 | struct sdcardfs_dentry_info *di = SDCARDFS_D(dent); |
| 242 | struct sdcardfs_sb_info *sbi = SDCARDFS_SB(dent->d_sb); |
| 243 | char *path_buf, *obbpath_s; |
| 244 | |
| 245 | /* check the base obbpath has been changed. |
| 246 | * this routine can check an uninitialized obb dentry as well. |
| 247 | * regarding the uninitialized obb, refer to the sdcardfs_mkdir() */ |
| 248 | spin_lock(&di->lock); |
| 249 | if(di->orig_path.dentry) { |
| 250 | if(!di->lower_path.dentry) { |
| 251 | ret = 1; |
| 252 | } else { |
| 253 | path_get(&di->lower_path); |
| 254 | //lower_parent = lock_parent(lower_path->dentry); |
| 255 | |
| 256 | path_buf = kmalloc(PATH_MAX, GFP_ATOMIC); |
| 257 | if(!path_buf) { |
| 258 | ret = 1; |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 259 | printk(KERN_ERR "sdcardfs: fail to allocate path_buf in %s.\n", __func__); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 260 | } else { |
| 261 | obbpath_s = d_path(&di->lower_path, path_buf, PATH_MAX); |
| 262 | if (d_unhashed(di->lower_path.dentry) || |
| 263 | strcasecmp(sbi->obbpath_s, obbpath_s)) { |
| 264 | ret = 1; |
| 265 | } |
| 266 | kfree(path_buf); |
| 267 | } |
| 268 | |
| 269 | //unlock_dir(lower_parent); |
| 270 | path_put(&di->lower_path); |
| 271 | } |
| 272 | } |
| 273 | spin_unlock(&di->lock); |
| 274 | return ret; |
| 275 | } |
| 276 | |
| 277 | int is_base_obbpath(struct dentry *dentry) |
| 278 | { |
| 279 | int ret = 0; |
| 280 | struct dentry *parent = dget_parent(dentry); |
Daniel Rosenberg | 63d2076 | 2016-12-01 14:36:29 -0800 | [diff] [blame^] | 281 | struct sdcardfs_inode_info *parent_info= SDCARDFS_I(d_inode(parent)); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 282 | struct sdcardfs_sb_info *sbi = SDCARDFS_SB(dentry->d_sb); |
| 283 | |
| 284 | spin_lock(&SDCARDFS_D(dentry)->lock); |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 285 | if (sbi->options.multiuser) { |
| 286 | if(parent_info->perm == PERM_PRE_ROOT && |
| 287 | !strcasecmp(dentry->d_name.name, "obb")) { |
| 288 | ret = 1; |
| 289 | } |
| 290 | } else if (parent_info->perm == PERM_ANDROID && |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 291 | !strcasecmp(dentry->d_name.name, "obb")) { |
| 292 | ret = 1; |
| 293 | } |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 294 | spin_unlock(&SDCARDFS_D(dentry)->lock); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 295 | return ret; |
| 296 | } |
| 297 | |
| 298 | /* The lower_path will be stored to the dentry's orig_path |
| 299 | * and the base obbpath will be copyed to the lower_path variable. |
| 300 | * if an error returned, there's no change in the lower_path |
| 301 | * returns: -ERRNO if error (0: no error) */ |
| 302 | int setup_obb_dentry(struct dentry *dentry, struct path *lower_path) |
| 303 | { |
| 304 | int err = 0; |
| 305 | struct sdcardfs_sb_info *sbi = SDCARDFS_SB(dentry->d_sb); |
| 306 | struct path obbpath; |
| 307 | |
| 308 | /* A local obb dentry must have its own orig_path to support rmdir |
| 309 | * and mkdir of itself. Usually, we expect that the sbi->obbpath |
| 310 | * is avaiable on this stage. */ |
| 311 | sdcardfs_set_orig_path(dentry, lower_path); |
| 312 | |
| 313 | err = kern_path(sbi->obbpath_s, |
| 314 | LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &obbpath); |
| 315 | |
| 316 | if(!err) { |
| 317 | /* the obbpath base has been found */ |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 318 | printk(KERN_INFO "sdcardfs: the sbi->obbpath is found\n"); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 319 | pathcpy(lower_path, &obbpath); |
| 320 | } else { |
| 321 | /* if the sbi->obbpath is not available, we can optionally |
| 322 | * setup the lower_path with its orig_path. |
| 323 | * but, the current implementation just returns an error |
| 324 | * because the sdcard daemon also regards this case as |
| 325 | * a lookup fail. */ |
Daniel Rosenberg | 497ac90 | 2016-02-03 21:08:21 -0800 | [diff] [blame] | 326 | printk(KERN_INFO "sdcardfs: the sbi->obbpath is not available\n"); |
Daniel Campello | 35c9e24 | 2015-07-20 16:23:50 -0700 | [diff] [blame] | 327 | } |
| 328 | return err; |
| 329 | } |
| 330 | |
| 331 | |