X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fllite%2Fdir.c;h=35f6810321ca1a1a5056642559d4fb4d4d50d389;hb=c03d8b1fe386cfb7b8bf58923d293b87832481f9;hp=0496b01750248bde6a3a3e6c6c7c747a3be8fe23;hpb=3439adf093ef8d36ae7f95687c92ad1d436329c8;p=fs%2Flustre-release.git diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 0496b01..35f6810 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -595,7 +595,7 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir) struct inode *inode = filp->f_dentry->d_inode; struct ll_file_data *lfd = LUSTRE_FPRIVATE(filp); struct ll_sb_info *sbi = ll_i2sbi(inode); - __u64 pos = lfd->lfd_pos; + __u64 pos; int hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH; int api32 = ll_need_32bit_api(sbi); int rc; @@ -604,6 +604,11 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir) #endif ENTRY; + if (lfd != NULL) + pos = lfd->lfd_pos; + else + pos = 0; + CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p) pos %lu/%llu " " 32bit_api %d\n", inode->i_ino, inode->i_generation, inode, (unsigned long)pos, i_size_read(inode), api32); @@ -615,7 +620,8 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir) GOTO(out, rc = 0); rc = ll_dir_read(inode, &pos, cookie, filldir); - lfd->lfd_pos = pos; + if (lfd != NULL) + lfd->lfd_pos = pos; if (pos == MDS_DIR_END_OFF) { if (api32) filp->f_pos = LL_DIR_END_OFF_32BIT; @@ -1453,7 +1459,7 @@ free_lmv: * on 2.4, we use OBD_CONNECT_LVB_TYPE to detect whether the * server will support REINT_RMENTRY XXX*/ if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE)) - return -ENOTSUPP; + RETURN(-ENOTSUPP); filename = ll_getname((const char *)arg); if (IS_ERR(filename))