diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 6b90ef98e4cf..35d54bb0869a 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -337,6 +337,7 @@ int cifs_get_inode_info(struct inode **pinode, | |||
337 | pfindData = (FILE_ALL_INFO *)buf; | 337 | pfindData = (FILE_ALL_INFO *)buf; |
338 | /* could do find first instead but this returns more info */ | 338 | /* could do find first instead but this returns more info */ |
339 | rc = CIFSSMBQPathInfo(xid, pTcon, search_path, pfindData, | 339 | rc = CIFSSMBQPathInfo(xid, pTcon, search_path, pfindData, |
340 | 0 /* not legacy */, | ||
340 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | 341 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & |
341 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 342 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
342 | /* BB optimize code so we do not make the above call | 343 | /* BB optimize code so we do not make the above call |
@@ -384,8 +385,10 @@ int cifs_get_inode_info(struct inode **pinode, | |||
384 | /* get new inode */ | 385 | /* get new inode */ |
385 | if (*pinode == NULL) { | 386 | if (*pinode == NULL) { |
386 | *pinode = new_inode(sb); | 387 | *pinode = new_inode(sb); |
387 | if (*pinode == NULL) | 388 | if (*pinode == NULL) { |
389 | kfree(buf); | ||
388 | return -ENOMEM; | 390 | return -ENOMEM; |
391 | } | ||
389 | /* Is an i_ino of zero legal? Can we use that to check | 392 | /* Is an i_ino of zero legal? Can we use that to check |
390 | if the server supports returning inode numbers? Are | 393 | if the server supports returning inode numbers? Are |
391 | there other sanity checks we can use to ensure that | 394 | there other sanity checks we can use to ensure that |
@@ -431,8 +434,11 @@ int cifs_get_inode_info(struct inode **pinode, | |||
431 | (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/ | 434 | (pTcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE) & 0xFFFFFE00;*/ |
432 | 435 | ||
433 | /* Linux can not store file creation time so ignore it */ | 436 | /* Linux can not store file creation time so ignore it */ |
434 | inode->i_atime = | 437 | if(pfindData->LastAccessTime) |
435 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastAccessTime)); | 438 | inode->i_atime = cifs_NTtimeToUnix |
439 | (le64_to_cpu(pfindData->LastAccessTime)); | ||
440 | else /* do not need to use current_fs_time - time not stored */ | ||
441 | inode->i_atime = CURRENT_TIME; | ||
436 | inode->i_mtime = | 442 | inode->i_mtime = |
437 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastWriteTime)); | 443 | cifs_NTtimeToUnix(le64_to_cpu(pfindData->LastWriteTime)); |
438 | inode->i_ctime = | 444 | inode->i_ctime = |