patch-2.2.7 linux/fs/sysv/dir.c

Next file: linux/fs/sysv/namei.c
Previous file: linux/fs/smbfs/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.6/linux/fs/sysv/dir.c linux/fs/sysv/dir.c
@@ -69,14 +69,12 @@
 static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir)
 {
 	struct inode *inode = filp->f_dentry->d_inode;
-	struct super_block * sb;
+	struct super_block * sb = inode->i_sb;
 	unsigned int offset,i;
 	struct buffer_head * bh;
 	char* bh_data;
 	struct sysv_dir_entry * de, sde;
 
-	if (!inode || !(sb = inode->i_sb) || !S_ISDIR(inode->i_mode))
-		return -EBADF;
 	if ((unsigned long)(filp->f_pos) % SYSV_DIRSIZE)
 		return -EBADF;
 	while (filp->f_pos < inode->i_size) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)