extern void abort(void); #include void reach_error() { assert(0); } /* Generated by CIL v. 1.5.1 */ /* print_CIL_Input is false */ typedef signed char __s8; typedef unsigned char __u8; typedef short __s16; typedef unsigned short __u16; typedef int __s32; typedef unsigned int __u32; typedef long long __s64; typedef unsigned long long __u64; typedef unsigned char u8; typedef unsigned short u16; typedef int s32; typedef unsigned int u32; typedef long long s64; typedef unsigned long long u64; typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef __kernel_ulong_t __kernel_ino_t; typedef int __kernel_pid_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; struct __anonstruct___kernel_fsid_t_5 { int val[2U] ; }; typedef struct __anonstruct___kernel_fsid_t_5 __kernel_fsid_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_time_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef __u32 __le32; typedef __u64 __le64; typedef __u32 __kernel_dev_t; typedef __kernel_dev_t dev_t; typedef __kernel_ino_t ino_t; typedef unsigned short umode_t; typedef __kernel_pid_t pid_t; typedef __kernel_clockid_t clockid_t; typedef _Bool bool; typedef __kernel_uid32_t uid_t; typedef __kernel_gid32_t gid_t; typedef __kernel_loff_t loff_t; typedef __kernel_size_t size_t; typedef __kernel_ssize_t ssize_t; typedef __kernel_time_t time_t; typedef __s32 int32_t; typedef __u8 uint8_t; typedef __u32 uint32_t; typedef __u64 uint64_t; typedef unsigned long sector_t; typedef unsigned long blkcnt_t; typedef unsigned int gfp_t; typedef unsigned int fmode_t; typedef unsigned int oom_flags_t; struct __anonstruct_atomic_t_6 { int counter ; }; typedef struct __anonstruct_atomic_t_6 atomic_t; struct __anonstruct_atomic64_t_7 { long counter ; }; typedef struct __anonstruct_atomic64_t_7 atomic64_t; struct list_head { struct list_head *next ; struct list_head *prev ; }; struct hlist_node; struct hlist_head { struct hlist_node *first ; }; struct hlist_node { struct hlist_node *next ; struct hlist_node **pprev ; }; struct callback_head { struct callback_head *next ; void (*func)(struct callback_head * ) ; }; struct module; struct file_operations; struct _ddebug { char const *modname ; char const *function ; char const *filename ; char const *format ; unsigned int lineno : 18 ; unsigned char flags ; }; struct device; struct completion; struct pt_regs; struct pid; typedef u16 __ticket_t; typedef u32 __ticketpair_t; struct __raw_tickets { __ticket_t head ; __ticket_t tail ; }; union __anonunion_ldv_2024_8 { __ticketpair_t head_tail ; struct __raw_tickets tickets ; }; struct arch_spinlock { union __anonunion_ldv_2024_8 ldv_2024 ; }; typedef struct arch_spinlock arch_spinlock_t; struct __anonstruct_ldv_2031_10 { u32 read ; s32 write ; }; union __anonunion_arch_rwlock_t_9 { s64 lock ; struct __anonstruct_ldv_2031_10 ldv_2031 ; }; typedef union __anonunion_arch_rwlock_t_9 arch_rwlock_t; struct task_struct; struct lockdep_map; struct mm_struct; struct pt_regs { unsigned long r15 ; unsigned long r14 ; unsigned long r13 ; unsigned long r12 ; unsigned long bp ; unsigned long bx ; unsigned long r11 ; unsigned long r10 ; unsigned long r9 ; unsigned long r8 ; unsigned long ax ; unsigned long cx ; unsigned long dx ; unsigned long si ; unsigned long di ; unsigned long orig_ax ; unsigned long ip ; unsigned long cs ; unsigned long flags ; unsigned long sp ; unsigned long ss ; }; struct __anonstruct_ldv_2096_12 { unsigned int a ; unsigned int b ; }; struct __anonstruct_ldv_2111_13 { u16 limit0 ; u16 base0 ; unsigned char base1 ; unsigned char type : 4 ; unsigned char s : 1 ; unsigned char dpl : 2 ; unsigned char p : 1 ; unsigned char limit : 4 ; unsigned char avl : 1 ; unsigned char l : 1 ; unsigned char d : 1 ; unsigned char g : 1 ; unsigned char base2 ; }; union __anonunion_ldv_2112_11 { struct __anonstruct_ldv_2096_12 ldv_2096 ; struct __anonstruct_ldv_2111_13 ldv_2111 ; }; struct desc_struct { union __anonunion_ldv_2112_11 ldv_2112 ; }; typedef unsigned long pgdval_t; typedef unsigned long pgprotval_t; struct pgprot { pgprotval_t pgprot ; }; typedef struct pgprot pgprot_t; struct __anonstruct_pgd_t_15 { pgdval_t pgd ; }; typedef struct __anonstruct_pgd_t_15 pgd_t; struct page; typedef struct page *pgtable_t; struct file; struct seq_file; struct thread_struct; struct cpumask; struct kernel_vm86_regs { struct pt_regs pt ; unsigned short es ; unsigned short __esh ; unsigned short ds ; unsigned short __dsh ; unsigned short fs ; unsigned short __fsh ; unsigned short gs ; unsigned short __gsh ; }; union __anonunion_ldv_2767_18 { struct pt_regs *regs ; struct kernel_vm86_regs *vm86 ; }; struct math_emu_info { long ___orig_eip ; union __anonunion_ldv_2767_18 ldv_2767 ; }; struct cpumask { unsigned long bits[64U] ; }; typedef struct cpumask cpumask_t; typedef struct cpumask *cpumask_var_t; struct i387_fsave_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u32 status ; }; struct __anonstruct_ldv_5125_23 { u64 rip ; u64 rdp ; }; struct __anonstruct_ldv_5131_24 { u32 fip ; u32 fcs ; u32 foo ; u32 fos ; }; union __anonunion_ldv_5132_22 { struct __anonstruct_ldv_5125_23 ldv_5125 ; struct __anonstruct_ldv_5131_24 ldv_5131 ; }; union __anonunion_ldv_5141_25 { u32 padding1[12U] ; u32 sw_reserved[12U] ; }; struct i387_fxsave_struct { u16 cwd ; u16 swd ; u16 twd ; u16 fop ; union __anonunion_ldv_5132_22 ldv_5132 ; u32 mxcsr ; u32 mxcsr_mask ; u32 st_space[32U] ; u32 xmm_space[64U] ; u32 padding[12U] ; union __anonunion_ldv_5141_25 ldv_5141 ; }; struct i387_soft_struct { u32 cwd ; u32 swd ; u32 twd ; u32 fip ; u32 fcs ; u32 foo ; u32 fos ; u32 st_space[20U] ; u8 ftop ; u8 changed ; u8 lookahead ; u8 no_update ; u8 rm ; u8 alimit ; struct math_emu_info *info ; u32 entry_eip ; }; struct ymmh_struct { u32 ymmh_space[64U] ; }; struct xsave_hdr_struct { u64 xstate_bv ; u64 reserved1[2U] ; u64 reserved2[5U] ; }; struct xsave_struct { struct i387_fxsave_struct i387 ; struct xsave_hdr_struct xsave_hdr ; struct ymmh_struct ymmh ; }; union thread_xstate { struct i387_fsave_struct fsave ; struct i387_fxsave_struct fxsave ; struct i387_soft_struct soft ; struct xsave_struct xsave ; }; struct fpu { unsigned int last_cpu ; unsigned int has_fpu ; union thread_xstate *state ; }; struct kmem_cache; struct perf_event; struct thread_struct { struct desc_struct tls_array[3U] ; unsigned long sp0 ; unsigned long sp ; unsigned long usersp ; unsigned short es ; unsigned short ds ; unsigned short fsindex ; unsigned short gsindex ; unsigned long fs ; unsigned long gs ; struct perf_event *ptrace_bps[4U] ; unsigned long debugreg6 ; unsigned long ptrace_dr7 ; unsigned long cr2 ; unsigned long trap_nr ; unsigned long error_code ; struct fpu fpu ; unsigned long *io_bitmap_ptr ; unsigned long iopl ; unsigned int io_bitmap_max ; }; typedef atomic64_t atomic_long_t; struct stack_trace { unsigned int nr_entries ; unsigned int max_entries ; unsigned long *entries ; int skip ; }; struct lockdep_subclass_key { char __one_byte ; } __attribute__((__packed__)) ; struct lock_class_key { struct lockdep_subclass_key subkeys[8U] ; }; struct lock_class { struct list_head hash_entry ; struct list_head lock_entry ; struct lockdep_subclass_key *key ; unsigned int subclass ; unsigned int dep_gen_id ; unsigned long usage_mask ; struct stack_trace usage_traces[13U] ; struct list_head locks_after ; struct list_head locks_before ; unsigned int version ; unsigned long ops ; char const *name ; int name_version ; unsigned long contention_point[4U] ; unsigned long contending_point[4U] ; }; struct lockdep_map { struct lock_class_key *key ; struct lock_class *class_cache[2U] ; char const *name ; int cpu ; unsigned long ip ; }; struct held_lock { u64 prev_chain_key ; unsigned long acquire_ip ; struct lockdep_map *instance ; struct lockdep_map *nest_lock ; u64 waittime_stamp ; u64 holdtime_stamp ; unsigned short class_idx : 13 ; unsigned char irq_context : 2 ; unsigned char trylock : 1 ; unsigned char read : 2 ; unsigned char check : 2 ; unsigned char hardirqs_off : 1 ; unsigned short references : 11 ; }; struct raw_spinlock { arch_spinlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct raw_spinlock raw_spinlock_t; struct __anonstruct_ldv_5960_29 { u8 __padding[24U] ; struct lockdep_map dep_map ; }; union __anonunion_ldv_5961_28 { struct raw_spinlock rlock ; struct __anonstruct_ldv_5960_29 ldv_5960 ; }; struct spinlock { union __anonunion_ldv_5961_28 ldv_5961 ; }; typedef struct spinlock spinlock_t; struct __anonstruct_rwlock_t_30 { arch_rwlock_t raw_lock ; unsigned int magic ; unsigned int owner_cpu ; void *owner ; struct lockdep_map dep_map ; }; typedef struct __anonstruct_rwlock_t_30 rwlock_t; struct mutex { atomic_t count ; spinlock_t wait_lock ; struct list_head wait_list ; struct task_struct *owner ; char const *name ; void *magic ; struct lockdep_map dep_map ; }; struct mutex_waiter { struct list_head list ; struct task_struct *task ; void *magic ; }; struct kstatfs { long f_type ; long f_bsize ; u64 f_blocks ; u64 f_bfree ; u64 f_bavail ; u64 f_files ; u64 f_ffree ; __kernel_fsid_t f_fsid ; long f_namelen ; long f_frsize ; long f_flags ; long f_spare[4U] ; }; struct timespec; struct __wait_queue_head { spinlock_t lock ; struct list_head task_list ; }; typedef struct __wait_queue_head wait_queue_head_t; struct seqcount { unsigned int sequence ; }; typedef struct seqcount seqcount_t; struct completion { unsigned int done ; wait_queue_head_t wait ; }; struct hlist_bl_node; struct hlist_bl_head { struct hlist_bl_node *first ; }; struct hlist_bl_node { struct hlist_bl_node *next ; struct hlist_bl_node **pprev ; }; struct nameidata; struct path; struct vfsmount; struct __anonstruct_ldv_7605_37 { u32 hash ; u32 len ; }; union __anonunion_ldv_7607_36 { struct __anonstruct_ldv_7605_37 ldv_7605 ; u64 hash_len ; }; struct qstr { union __anonunion_ldv_7607_36 ldv_7607 ; unsigned char const *name ; }; struct inode; struct dentry_operations; struct super_block; union __anonunion_d_u_38 { struct list_head d_child ; struct callback_head d_rcu ; }; struct dentry { unsigned int d_flags ; seqcount_t d_seq ; struct hlist_bl_node d_hash ; struct dentry *d_parent ; struct qstr d_name ; struct inode *d_inode ; unsigned char d_iname[32U] ; unsigned int d_count ; spinlock_t d_lock ; struct dentry_operations const *d_op ; struct super_block *d_sb ; unsigned long d_time ; void *d_fsdata ; struct list_head d_lru ; union __anonunion_d_u_38 d_u ; struct list_head d_subdirs ; struct hlist_node d_alias ; }; struct dentry_operations { int (*d_revalidate)(struct dentry * , unsigned int ) ; int (*d_hash)(struct dentry const * , struct inode const * , struct qstr * ) ; int (*d_compare)(struct dentry const * , struct inode const * , struct dentry const * , struct inode const * , unsigned int , char const * , struct qstr const * ) ; int (*d_delete)(struct dentry const * ) ; void (*d_release)(struct dentry * ) ; void (*d_prune)(struct dentry * ) ; void (*d_iput)(struct dentry * , struct inode * ) ; char *(*d_dname)(struct dentry * , char * , int ) ; struct vfsmount *(*d_automount)(struct path * ) ; int (*d_manage)(struct dentry * , bool ) ; }; struct path { struct vfsmount *mnt ; struct dentry *dentry ; }; struct timespec { __kernel_time_t tv_sec ; long tv_nsec ; }; struct user_namespace; typedef uid_t kuid_t; typedef gid_t kgid_t; struct kstat { u64 ino ; dev_t dev ; umode_t mode ; unsigned int nlink ; kuid_t uid ; kgid_t gid ; dev_t rdev ; loff_t size ; struct timespec atime ; struct timespec mtime ; struct timespec ctime ; unsigned long blksize ; unsigned long long blocks ; }; struct radix_tree_node; struct radix_tree_root { unsigned int height ; gfp_t gfp_mask ; struct radix_tree_node *rnode ; }; struct rb_node { unsigned long __rb_parent_color ; struct rb_node *rb_right ; struct rb_node *rb_left ; }; struct rb_root { struct rb_node *rb_node ; }; enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ; struct pid_namespace; struct upid { int nr ; struct pid_namespace *ns ; struct hlist_node pid_chain ; }; struct pid { atomic_t count ; unsigned int level ; struct hlist_head tasks[3U] ; struct callback_head rcu ; struct upid numbers[1U] ; }; struct pid_link { struct hlist_node node ; struct pid *pid ; }; struct kernel_cap_struct { __u32 cap[2U] ; }; typedef struct kernel_cap_struct kernel_cap_t; struct fiemap_extent { __u64 fe_logical ; __u64 fe_physical ; __u64 fe_length ; __u64 fe_reserved64[2U] ; __u32 fe_flags ; __u32 fe_reserved[3U] ; }; struct shrink_control { gfp_t gfp_mask ; unsigned long nr_to_scan ; }; struct shrinker { int (*shrink)(struct shrinker * , struct shrink_control * ) ; int seeks ; long batch ; struct list_head list ; atomic_long_t nr_in_batch ; }; enum migrate_mode { MIGRATE_ASYNC = 0, MIGRATE_SYNC_LIGHT = 1, MIGRATE_SYNC = 2 } ; struct rw_semaphore; struct rw_semaphore { long count ; raw_spinlock_t wait_lock ; struct list_head wait_list ; struct lockdep_map dep_map ; }; union ktime { s64 tv64 ; }; typedef union ktime ktime_t; struct tvec_base; struct timer_list { struct list_head entry ; unsigned long expires ; struct tvec_base *base ; void (*function)(unsigned long ) ; unsigned long data ; int slack ; int start_pid ; void *start_site ; char start_comm[16U] ; struct lockdep_map lockdep_map ; }; struct hrtimer; enum hrtimer_restart; struct work_struct; struct work_struct { atomic_long_t data ; struct list_head entry ; void (*func)(struct work_struct * ) ; struct lockdep_map lockdep_map ; }; struct delayed_work { struct work_struct work ; struct timer_list timer ; int cpu ; }; struct __anonstruct_nodemask_t_104 { unsigned long bits[16U] ; }; typedef struct __anonstruct_nodemask_t_104 nodemask_t; struct __anonstruct_mm_context_t_105 { void *ldt ; int size ; unsigned short ia32_compat ; struct mutex lock ; void *vdso ; }; typedef struct __anonstruct_mm_context_t_105 mm_context_t; struct vm_area_struct; struct block_device; struct io_context; struct export_operations; struct iovec; struct kiocb; struct kobject; struct pipe_inode_info; struct poll_table_struct; struct cred; struct swap_info_struct; struct iattr { unsigned int ia_valid ; umode_t ia_mode ; kuid_t ia_uid ; kgid_t ia_gid ; loff_t ia_size ; struct timespec ia_atime ; struct timespec ia_mtime ; struct timespec ia_ctime ; struct file *ia_file ; }; struct percpu_counter { raw_spinlock_t lock ; s64 count ; struct list_head list ; s32 *counters ; }; struct fs_disk_quota { __s8 d_version ; __s8 d_flags ; __u16 d_fieldmask ; __u32 d_id ; __u64 d_blk_hardlimit ; __u64 d_blk_softlimit ; __u64 d_ino_hardlimit ; __u64 d_ino_softlimit ; __u64 d_bcount ; __u64 d_icount ; __s32 d_itimer ; __s32 d_btimer ; __u16 d_iwarns ; __u16 d_bwarns ; __s32 d_padding2 ; __u64 d_rtb_hardlimit ; __u64 d_rtb_softlimit ; __u64 d_rtbcount ; __s32 d_rtbtimer ; __u16 d_rtbwarns ; __s16 d_padding3 ; char d_padding4[8U] ; }; struct fs_qfilestat { __u64 qfs_ino ; __u64 qfs_nblks ; __u32 qfs_nextents ; }; typedef struct fs_qfilestat fs_qfilestat_t; struct fs_quota_stat { __s8 qs_version ; __u16 qs_flags ; __s8 qs_pad ; fs_qfilestat_t qs_uquota ; fs_qfilestat_t qs_gquota ; __u32 qs_incoredqs ; __s32 qs_btimelimit ; __s32 qs_itimelimit ; __s32 qs_rtbtimelimit ; __u16 qs_bwarnlimit ; __u16 qs_iwarnlimit ; }; struct dquot; typedef __kernel_uid32_t projid_t; typedef projid_t kprojid_t; struct if_dqinfo { __u64 dqi_bgrace ; __u64 dqi_igrace ; __u32 dqi_flags ; __u32 dqi_valid ; }; enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ; typedef long long qsize_t; union __anonunion_ldv_12849_132 { kuid_t uid ; kgid_t gid ; kprojid_t projid ; }; struct kqid { union __anonunion_ldv_12849_132 ldv_12849 ; enum quota_type type ; }; struct mem_dqblk { qsize_t dqb_bhardlimit ; qsize_t dqb_bsoftlimit ; qsize_t dqb_curspace ; qsize_t dqb_rsvspace ; qsize_t dqb_ihardlimit ; qsize_t dqb_isoftlimit ; qsize_t dqb_curinodes ; time_t dqb_btime ; time_t dqb_itime ; }; struct quota_format_type; struct mem_dqinfo { struct quota_format_type *dqi_format ; int dqi_fmt_id ; struct list_head dqi_dirty_list ; unsigned long dqi_flags ; unsigned int dqi_bgrace ; unsigned int dqi_igrace ; qsize_t dqi_maxblimit ; qsize_t dqi_maxilimit ; void *dqi_priv ; }; struct dquot { struct hlist_node dq_hash ; struct list_head dq_inuse ; struct list_head dq_free ; struct list_head dq_dirty ; struct mutex dq_lock ; atomic_t dq_count ; wait_queue_head_t dq_wait_unused ; struct super_block *dq_sb ; struct kqid dq_id ; loff_t dq_off ; unsigned long dq_flags ; struct mem_dqblk dq_dqb ; }; struct quota_format_ops { int (*check_quota_file)(struct super_block * , int ) ; int (*read_file_info)(struct super_block * , int ) ; int (*write_file_info)(struct super_block * , int ) ; int (*free_file_info)(struct super_block * , int ) ; int (*read_dqblk)(struct dquot * ) ; int (*commit_dqblk)(struct dquot * ) ; int (*release_dqblk)(struct dquot * ) ; }; struct dquot_operations { int (*write_dquot)(struct dquot * ) ; struct dquot *(*alloc_dquot)(struct super_block * , int ) ; void (*destroy_dquot)(struct dquot * ) ; int (*acquire_dquot)(struct dquot * ) ; int (*release_dquot)(struct dquot * ) ; int (*mark_dirty)(struct dquot * ) ; int (*write_info)(struct super_block * , int ) ; qsize_t *(*get_reserved_space)(struct inode * ) ; }; struct quotactl_ops { int (*quota_on)(struct super_block * , int , int , struct path * ) ; int (*quota_on_meta)(struct super_block * , int , int ) ; int (*quota_off)(struct super_block * , int ) ; int (*quota_sync)(struct super_block * , int ) ; int (*get_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*set_info)(struct super_block * , int , struct if_dqinfo * ) ; int (*get_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*set_dqblk)(struct super_block * , struct kqid , struct fs_disk_quota * ) ; int (*get_xstate)(struct super_block * , struct fs_quota_stat * ) ; int (*set_xstate)(struct super_block * , unsigned int , int ) ; }; struct quota_format_type { int qf_fmt_id ; struct quota_format_ops const *qf_ops ; struct module *qf_owner ; struct quota_format_type *qf_next ; }; struct quota_info { unsigned int flags ; struct mutex dqio_mutex ; struct mutex dqonoff_mutex ; struct rw_semaphore dqptr_sem ; struct inode *files[2U] ; struct mem_dqinfo info[2U] ; struct quota_format_ops const *ops[2U] ; }; struct address_space; struct writeback_control; union __anonunion_arg_134 { char *buf ; void *data ; }; struct __anonstruct_read_descriptor_t_133 { size_t written ; size_t count ; union __anonunion_arg_134 arg ; int error ; }; typedef struct __anonstruct_read_descriptor_t_133 read_descriptor_t; struct address_space_operations { int (*writepage)(struct page * , struct writeback_control * ) ; int (*readpage)(struct file * , struct page * ) ; int (*writepages)(struct address_space * , struct writeback_control * ) ; int (*set_page_dirty)(struct page * ) ; int (*readpages)(struct file * , struct address_space * , struct list_head * , unsigned int ) ; int (*write_begin)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page ** , void ** ) ; int (*write_end)(struct file * , struct address_space * , loff_t , unsigned int , unsigned int , struct page * , void * ) ; sector_t (*bmap)(struct address_space * , sector_t ) ; void (*invalidatepage)(struct page * , unsigned long ) ; int (*releasepage)(struct page * , gfp_t ) ; void (*freepage)(struct page * ) ; ssize_t (*direct_IO)(int , struct kiocb * , struct iovec const * , loff_t , unsigned long ) ; int (*get_xip_mem)(struct address_space * , unsigned long , int , void ** , unsigned long * ) ; int (*migratepage)(struct address_space * , struct page * , struct page * , enum migrate_mode ) ; int (*launder_page)(struct page * ) ; int (*is_partially_uptodate)(struct page * , read_descriptor_t * , unsigned long ) ; int (*error_remove_page)(struct address_space * , struct page * ) ; int (*swap_activate)(struct swap_info_struct * , struct file * , sector_t * ) ; void (*swap_deactivate)(struct file * ) ; }; struct backing_dev_info; struct address_space { struct inode *host ; struct radix_tree_root page_tree ; spinlock_t tree_lock ; unsigned int i_mmap_writable ; struct rb_root i_mmap ; struct list_head i_mmap_nonlinear ; struct mutex i_mmap_mutex ; unsigned long nrpages ; unsigned long writeback_index ; struct address_space_operations const *a_ops ; unsigned long flags ; struct backing_dev_info *backing_dev_info ; spinlock_t private_lock ; struct list_head private_list ; void *private_data ; }; struct request_queue; struct hd_struct; struct gendisk; struct block_device { dev_t bd_dev ; int bd_openers ; struct inode *bd_inode ; struct super_block *bd_super ; struct mutex bd_mutex ; struct list_head bd_inodes ; void *bd_claiming ; void *bd_holder ; int bd_holders ; bool bd_write_holder ; struct list_head bd_holder_disks ; struct block_device *bd_contains ; unsigned int bd_block_size ; struct hd_struct *bd_part ; unsigned int bd_part_count ; int bd_invalidated ; struct gendisk *bd_disk ; struct request_queue *bd_queue ; struct list_head bd_list ; unsigned long bd_private ; int bd_fsfreeze_count ; struct mutex bd_fsfreeze_mutex ; }; struct posix_acl; struct inode_operations; union __anonunion_ldv_13285_135 { unsigned int const i_nlink ; unsigned int __i_nlink ; }; union __anonunion_ldv_13305_136 { struct hlist_head i_dentry ; struct callback_head i_rcu ; }; struct file_lock; struct cdev; union __anonunion_ldv_13321_137 { struct pipe_inode_info *i_pipe ; struct block_device *i_bdev ; struct cdev *i_cdev ; }; struct inode { umode_t i_mode ; unsigned short i_opflags ; kuid_t i_uid ; kgid_t i_gid ; unsigned int i_flags ; struct posix_acl *i_acl ; struct posix_acl *i_default_acl ; struct inode_operations const *i_op ; struct super_block *i_sb ; struct address_space *i_mapping ; void *i_security ; unsigned long i_ino ; union __anonunion_ldv_13285_135 ldv_13285 ; dev_t i_rdev ; loff_t i_size ; struct timespec i_atime ; struct timespec i_mtime ; struct timespec i_ctime ; spinlock_t i_lock ; unsigned short i_bytes ; unsigned int i_blkbits ; blkcnt_t i_blocks ; unsigned long i_state ; struct mutex i_mutex ; unsigned long dirtied_when ; struct hlist_node i_hash ; struct list_head i_wb_list ; struct list_head i_lru ; struct list_head i_sb_list ; union __anonunion_ldv_13305_136 ldv_13305 ; u64 i_version ; atomic_t i_count ; atomic_t i_dio_count ; atomic_t i_writecount ; struct file_operations const *i_fop ; struct file_lock *i_flock ; struct address_space i_data ; struct dquot *i_dquot[2U] ; struct list_head i_devices ; union __anonunion_ldv_13321_137 ldv_13321 ; __u32 i_generation ; __u32 i_fsnotify_mask ; struct hlist_head i_fsnotify_marks ; atomic_t i_readcount ; void *i_private ; }; struct fown_struct { rwlock_t lock ; struct pid *pid ; enum pid_type pid_type ; kuid_t uid ; kuid_t euid ; int signum ; }; struct file_ra_state { unsigned long start ; unsigned int size ; unsigned int async_size ; unsigned int ra_pages ; unsigned int mmap_miss ; loff_t prev_pos ; }; union __anonunion_f_u_138 { struct list_head fu_list ; struct callback_head fu_rcuhead ; }; struct file { union __anonunion_f_u_138 f_u ; struct path f_path ; struct file_operations const *f_op ; spinlock_t f_lock ; int f_sb_list_cpu ; atomic_long_t f_count ; unsigned int f_flags ; fmode_t f_mode ; loff_t f_pos ; struct fown_struct f_owner ; struct cred const *f_cred ; struct file_ra_state f_ra ; u64 f_version ; void *f_security ; void *private_data ; struct list_head f_ep_links ; struct list_head f_tfile_llink ; struct address_space *f_mapping ; unsigned long f_mnt_write_state ; }; struct files_struct; typedef struct files_struct *fl_owner_t; struct file_lock_operations { void (*fl_copy_lock)(struct file_lock * , struct file_lock * ) ; void (*fl_release_private)(struct file_lock * ) ; }; struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock * , struct file_lock * ) ; void (*lm_notify)(struct file_lock * ) ; int (*lm_grant)(struct file_lock * , struct file_lock * , int ) ; void (*lm_break)(struct file_lock * ) ; int (*lm_change)(struct file_lock ** , int ) ; }; struct nlm_lockowner; struct nfs_lock_info { u32 state ; struct nlm_lockowner *owner ; struct list_head list ; }; struct nfs4_lock_state; struct nfs4_lock_info { struct nfs4_lock_state *owner ; }; struct fasync_struct; struct __anonstruct_afs_140 { struct list_head link ; int state ; }; union __anonunion_fl_u_139 { struct nfs_lock_info nfs_fl ; struct nfs4_lock_info nfs4_fl ; struct __anonstruct_afs_140 afs ; }; struct file_lock { struct file_lock *fl_next ; struct list_head fl_link ; struct list_head fl_block ; fl_owner_t fl_owner ; unsigned int fl_flags ; unsigned char fl_type ; unsigned int fl_pid ; struct pid *fl_nspid ; wait_queue_head_t fl_wait ; struct file *fl_file ; loff_t fl_start ; loff_t fl_end ; struct fasync_struct *fl_fasync ; unsigned long fl_break_time ; unsigned long fl_downgrade_time ; struct file_lock_operations const *fl_ops ; struct lock_manager_operations const *fl_lmops ; union __anonunion_fl_u_139 fl_u ; }; struct fasync_struct { spinlock_t fa_lock ; int magic ; int fa_fd ; struct fasync_struct *fa_next ; struct file *fa_file ; struct callback_head fa_rcu ; }; struct sb_writers { struct percpu_counter counter[3U] ; wait_queue_head_t wait ; int frozen ; wait_queue_head_t wait_unfrozen ; struct lockdep_map lock_map[3U] ; }; struct file_system_type; struct super_operations; struct xattr_handler; struct mtd_info; struct super_block { struct list_head s_list ; dev_t s_dev ; unsigned char s_blocksize_bits ; unsigned long s_blocksize ; loff_t s_maxbytes ; struct file_system_type *s_type ; struct super_operations const *s_op ; struct dquot_operations const *dq_op ; struct quotactl_ops const *s_qcop ; struct export_operations const *s_export_op ; unsigned long s_flags ; unsigned long s_magic ; struct dentry *s_root ; struct rw_semaphore s_umount ; int s_count ; atomic_t s_active ; void *s_security ; struct xattr_handler const **s_xattr ; struct list_head s_inodes ; struct hlist_bl_head s_anon ; struct list_head *s_files ; struct list_head s_mounts ; struct list_head s_dentry_lru ; int s_nr_dentry_unused ; spinlock_t s_inode_lru_lock ; struct list_head s_inode_lru ; int s_nr_inodes_unused ; struct block_device *s_bdev ; struct backing_dev_info *s_bdi ; struct mtd_info *s_mtd ; struct hlist_node s_instances ; struct quota_info s_dquot ; struct sb_writers s_writers ; char s_id[32U] ; u8 s_uuid[16U] ; void *s_fs_info ; unsigned int s_max_links ; fmode_t s_mode ; u32 s_time_gran ; struct mutex s_vfs_rename_mutex ; char *s_subtype ; char *s_options ; struct dentry_operations const *s_d_op ; int cleancache_poolid ; struct shrinker s_shrink ; atomic_long_t s_remove_count ; int s_readonly_remount ; }; struct fiemap_extent_info { unsigned int fi_flags ; unsigned int fi_extents_mapped ; unsigned int fi_extents_max ; struct fiemap_extent *fi_extents_start ; }; struct file_operations { struct module *owner ; loff_t (*llseek)(struct file * , loff_t , int ) ; ssize_t (*read)(struct file * , char * , size_t , loff_t * ) ; ssize_t (*write)(struct file * , char const * , size_t , loff_t * ) ; ssize_t (*aio_read)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; ssize_t (*aio_write)(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; int (*readdir)(struct file * , void * , int (*)(void * , char const * , int , loff_t , u64 , unsigned int ) ) ; unsigned int (*poll)(struct file * , struct poll_table_struct * ) ; long (*unlocked_ioctl)(struct file * , unsigned int , unsigned long ) ; long (*compat_ioctl)(struct file * , unsigned int , unsigned long ) ; int (*mmap)(struct file * , struct vm_area_struct * ) ; int (*open)(struct inode * , struct file * ) ; int (*flush)(struct file * , fl_owner_t ) ; int (*release)(struct inode * , struct file * ) ; int (*fsync)(struct file * , loff_t , loff_t , int ) ; int (*aio_fsync)(struct kiocb * , int ) ; int (*fasync)(int , struct file * , int ) ; int (*lock)(struct file * , int , struct file_lock * ) ; ssize_t (*sendpage)(struct file * , struct page * , int , size_t , loff_t * , int ) ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; int (*check_flags)(int ) ; int (*flock)(struct file * , int , struct file_lock * ) ; ssize_t (*splice_write)(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; ssize_t (*splice_read)(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; int (*setlease)(struct file * , long , struct file_lock ** ) ; long (*fallocate)(struct file * , int , loff_t , loff_t ) ; int (*show_fdinfo)(struct seq_file * , struct file * ) ; }; struct inode_operations { struct dentry *(*lookup)(struct inode * , struct dentry * , unsigned int ) ; void *(*follow_link)(struct dentry * , struct nameidata * ) ; int (*permission)(struct inode * , int ) ; struct posix_acl *(*get_acl)(struct inode * , int ) ; int (*readlink)(struct dentry * , char * , int ) ; void (*put_link)(struct dentry * , struct nameidata * , void * ) ; int (*create)(struct inode * , struct dentry * , umode_t , bool ) ; int (*link)(struct dentry * , struct inode * , struct dentry * ) ; int (*unlink)(struct inode * , struct dentry * ) ; int (*symlink)(struct inode * , struct dentry * , char const * ) ; int (*mkdir)(struct inode * , struct dentry * , umode_t ) ; int (*rmdir)(struct inode * , struct dentry * ) ; int (*mknod)(struct inode * , struct dentry * , umode_t , dev_t ) ; int (*rename)(struct inode * , struct dentry * , struct inode * , struct dentry * ) ; int (*setattr)(struct dentry * , struct iattr * ) ; int (*getattr)(struct vfsmount * , struct dentry * , struct kstat * ) ; int (*setxattr)(struct dentry * , char const * , void const * , size_t , int ) ; ssize_t (*getxattr)(struct dentry * , char const * , void * , size_t ) ; ssize_t (*listxattr)(struct dentry * , char * , size_t ) ; int (*removexattr)(struct dentry * , char const * ) ; int (*fiemap)(struct inode * , struct fiemap_extent_info * , u64 , u64 ) ; int (*update_time)(struct inode * , struct timespec * , int ) ; int (*atomic_open)(struct inode * , struct dentry * , struct file * , unsigned int , umode_t , int * ) ; }; struct super_operations { struct inode *(*alloc_inode)(struct super_block * ) ; void (*destroy_inode)(struct inode * ) ; void (*dirty_inode)(struct inode * , int ) ; int (*write_inode)(struct inode * , struct writeback_control * ) ; int (*drop_inode)(struct inode * ) ; void (*evict_inode)(struct inode * ) ; void (*put_super)(struct super_block * ) ; int (*sync_fs)(struct super_block * , int ) ; int (*freeze_fs)(struct super_block * ) ; int (*unfreeze_fs)(struct super_block * ) ; int (*statfs)(struct dentry * , struct kstatfs * ) ; int (*remount_fs)(struct super_block * , int * , char * ) ; void (*umount_begin)(struct super_block * ) ; int (*show_options)(struct seq_file * , struct dentry * ) ; int (*show_devname)(struct seq_file * , struct dentry * ) ; int (*show_path)(struct seq_file * , struct dentry * ) ; int (*show_stats)(struct seq_file * , struct dentry * ) ; ssize_t (*quota_read)(struct super_block * , int , char * , size_t , loff_t ) ; ssize_t (*quota_write)(struct super_block * , int , char const * , size_t , loff_t ) ; int (*bdev_try_to_free_page)(struct super_block * , struct page * , gfp_t ) ; int (*nr_cached_objects)(struct super_block * ) ; void (*free_cached_objects)(struct super_block * , int ) ; }; struct file_system_type { char const *name ; int fs_flags ; struct dentry *(*mount)(struct file_system_type * , int , char const * , void * ) ; void (*kill_sb)(struct super_block * ) ; struct module *owner ; struct file_system_type *next ; struct hlist_head fs_supers ; struct lock_class_key s_lock_key ; struct lock_class_key s_umount_key ; struct lock_class_key s_vfs_rename_key ; struct lock_class_key s_writers_key[3U] ; struct lock_class_key i_lock_key ; struct lock_class_key i_mutex_key ; struct lock_class_key i_mutex_dir_key ; }; struct arch_uprobe_task { unsigned long saved_scratch_register ; unsigned int saved_trap_nr ; unsigned int saved_tf ; }; enum uprobe_task_state { UTASK_RUNNING = 0, UTASK_SSTEP = 1, UTASK_SSTEP_ACK = 2, UTASK_SSTEP_TRAPPED = 3 } ; struct uprobe; struct uprobe_task { enum uprobe_task_state state ; struct arch_uprobe_task autask ; struct uprobe *active_uprobe ; unsigned long xol_vaddr ; unsigned long vaddr ; }; struct xol_area { wait_queue_head_t wq ; atomic_t slot_count ; unsigned long *bitmap ; struct page *page ; unsigned long vaddr ; }; struct uprobes_state { struct xol_area *xol_area ; }; union __anonunion_ldv_15597_142 { unsigned long index ; void *freelist ; bool pfmemalloc ; }; struct __anonstruct_ldv_15607_146 { unsigned short inuse ; unsigned short objects : 15 ; unsigned char frozen : 1 ; }; union __anonunion_ldv_15609_145 { atomic_t _mapcount ; struct __anonstruct_ldv_15607_146 ldv_15607 ; int units ; }; struct __anonstruct_ldv_15611_144 { union __anonunion_ldv_15609_145 ldv_15609 ; atomic_t _count ; }; union __anonunion_ldv_15612_143 { unsigned long counters ; struct __anonstruct_ldv_15611_144 ldv_15611 ; }; struct __anonstruct_ldv_15613_141 { union __anonunion_ldv_15597_142 ldv_15597 ; union __anonunion_ldv_15612_143 ldv_15612 ; }; struct __anonstruct_ldv_15620_148 { struct page *next ; int pages ; int pobjects ; }; struct slab; union __anonunion_ldv_15624_147 { struct list_head lru ; struct __anonstruct_ldv_15620_148 ldv_15620 ; struct list_head list ; struct slab *slab_page ; }; union __anonunion_ldv_15629_149 { unsigned long private ; struct kmem_cache *slab_cache ; struct page *first_page ; }; struct page { unsigned long flags ; struct address_space *mapping ; struct __anonstruct_ldv_15613_141 ldv_15613 ; union __anonunion_ldv_15624_147 ldv_15624 ; union __anonunion_ldv_15629_149 ldv_15629 ; unsigned long debug_flags ; int _last_nid ; }; struct page_frag { struct page *page ; __u32 offset ; __u32 size ; }; struct __anonstruct_linear_151 { struct rb_node rb ; unsigned long rb_subtree_last ; }; union __anonunion_shared_150 { struct __anonstruct_linear_151 linear ; struct list_head nonlinear ; }; struct anon_vma; struct vm_operations_struct; struct mempolicy; struct vm_area_struct { unsigned long vm_start ; unsigned long vm_end ; struct vm_area_struct *vm_next ; struct vm_area_struct *vm_prev ; struct rb_node vm_rb ; unsigned long rb_subtree_gap ; struct mm_struct *vm_mm ; pgprot_t vm_page_prot ; unsigned long vm_flags ; union __anonunion_shared_150 shared ; struct list_head anon_vma_chain ; struct anon_vma *anon_vma ; struct vm_operations_struct const *vm_ops ; unsigned long vm_pgoff ; struct file *vm_file ; void *vm_private_data ; struct mempolicy *vm_policy ; }; struct core_thread { struct task_struct *task ; struct core_thread *next ; }; struct core_state { atomic_t nr_threads ; struct core_thread dumper ; struct completion startup ; }; struct mm_rss_stat { atomic_long_t count[3U] ; }; struct linux_binfmt; struct mmu_notifier_mm; struct mm_struct { struct vm_area_struct *mmap ; struct rb_root mm_rb ; struct vm_area_struct *mmap_cache ; unsigned long (*get_unmapped_area)(struct file * , unsigned long , unsigned long , unsigned long , unsigned long ) ; void (*unmap_area)(struct mm_struct * , unsigned long ) ; unsigned long mmap_base ; unsigned long task_size ; unsigned long cached_hole_size ; unsigned long free_area_cache ; unsigned long highest_vm_end ; pgd_t *pgd ; atomic_t mm_users ; atomic_t mm_count ; int map_count ; spinlock_t page_table_lock ; struct rw_semaphore mmap_sem ; struct list_head mmlist ; unsigned long hiwater_rss ; unsigned long hiwater_vm ; unsigned long total_vm ; unsigned long locked_vm ; unsigned long pinned_vm ; unsigned long shared_vm ; unsigned long exec_vm ; unsigned long stack_vm ; unsigned long def_flags ; unsigned long nr_ptes ; unsigned long start_code ; unsigned long end_code ; unsigned long start_data ; unsigned long end_data ; unsigned long start_brk ; unsigned long brk ; unsigned long start_stack ; unsigned long arg_start ; unsigned long arg_end ; unsigned long env_start ; unsigned long env_end ; unsigned long saved_auxv[44U] ; struct mm_rss_stat rss_stat ; struct linux_binfmt *binfmt ; cpumask_var_t cpu_vm_mask_var ; mm_context_t context ; unsigned long flags ; struct core_state *core_state ; spinlock_t ioctx_lock ; struct hlist_head ioctx_list ; struct task_struct *owner ; struct file *exe_file ; struct mmu_notifier_mm *mmu_notifier_mm ; pgtable_t pmd_huge_pte ; struct cpumask cpumask_allocation ; unsigned long numa_next_scan ; unsigned long numa_next_reset ; unsigned long numa_scan_offset ; int numa_scan_seq ; int first_nid ; struct uprobes_state uprobes_state ; }; typedef unsigned long cputime_t; struct sem_undo_list; struct sysv_sem { struct sem_undo_list *undo_list ; }; struct __anonstruct_sigset_t_152 { unsigned long sig[1U] ; }; typedef struct __anonstruct_sigset_t_152 sigset_t; struct siginfo; typedef void __signalfn_t(int ); typedef __signalfn_t *__sighandler_t; typedef void __restorefn_t(void); typedef __restorefn_t *__sigrestore_t; struct sigaction { __sighandler_t sa_handler ; unsigned long sa_flags ; __sigrestore_t sa_restorer ; sigset_t sa_mask ; }; struct k_sigaction { struct sigaction sa ; }; union sigval { int sival_int ; void *sival_ptr ; }; typedef union sigval sigval_t; struct __anonstruct__kill_154 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; }; struct __anonstruct__timer_155 { __kernel_timer_t _tid ; int _overrun ; char _pad[0U] ; sigval_t _sigval ; int _sys_private ; }; struct __anonstruct__rt_156 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; sigval_t _sigval ; }; struct __anonstruct__sigchld_157 { __kernel_pid_t _pid ; __kernel_uid32_t _uid ; int _status ; __kernel_clock_t _utime ; __kernel_clock_t _stime ; }; struct __anonstruct__sigfault_158 { void *_addr ; short _addr_lsb ; }; struct __anonstruct__sigpoll_159 { long _band ; int _fd ; }; struct __anonstruct__sigsys_160 { void *_call_addr ; int _syscall ; unsigned int _arch ; }; union __anonunion__sifields_153 { int _pad[28U] ; struct __anonstruct__kill_154 _kill ; struct __anonstruct__timer_155 _timer ; struct __anonstruct__rt_156 _rt ; struct __anonstruct__sigchld_157 _sigchld ; struct __anonstruct__sigfault_158 _sigfault ; struct __anonstruct__sigpoll_159 _sigpoll ; struct __anonstruct__sigsys_160 _sigsys ; }; struct siginfo { int si_signo ; int si_errno ; int si_code ; union __anonunion__sifields_153 _sifields ; }; typedef struct siginfo siginfo_t; struct user_struct; struct sigpending { struct list_head list ; sigset_t signal ; }; struct seccomp_filter; struct seccomp { int mode ; struct seccomp_filter *filter ; }; struct plist_head { struct list_head node_list ; }; struct plist_node { int prio ; struct list_head prio_list ; struct list_head node_list ; }; struct rt_mutex_waiter; struct rlimit { unsigned long rlim_cur ; unsigned long rlim_max ; }; struct timerqueue_node { struct rb_node node ; ktime_t expires ; }; struct timerqueue_head { struct rb_root head ; struct timerqueue_node *next ; }; struct hrtimer_clock_base; struct hrtimer_cpu_base; enum hrtimer_restart { HRTIMER_NORESTART = 0, HRTIMER_RESTART = 1 } ; struct hrtimer { struct timerqueue_node node ; ktime_t _softexpires ; enum hrtimer_restart (*function)(struct hrtimer * ) ; struct hrtimer_clock_base *base ; unsigned long state ; int start_pid ; void *start_site ; char start_comm[16U] ; }; struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base ; int index ; clockid_t clockid ; struct timerqueue_head active ; ktime_t resolution ; ktime_t (*get_time)(void) ; ktime_t softirq_time ; ktime_t offset ; }; struct hrtimer_cpu_base { raw_spinlock_t lock ; unsigned int active_bases ; unsigned int clock_was_set ; ktime_t expires_next ; int hres_active ; int hang_detected ; unsigned long nr_events ; unsigned long nr_retries ; unsigned long nr_hangs ; ktime_t max_hang_time ; struct hrtimer_clock_base clock_base[3U] ; }; struct task_io_accounting { u64 rchar ; u64 wchar ; u64 syscr ; u64 syscw ; u64 read_bytes ; u64 write_bytes ; u64 cancelled_write_bytes ; }; struct latency_record { unsigned long backtrace[12U] ; unsigned int count ; unsigned long time ; unsigned long max ; }; struct nsproxy; typedef int32_t key_serial_t; typedef uint32_t key_perm_t; struct key; struct signal_struct; struct key_type; struct keyring_list; union __anonunion_ldv_18173_165 { struct list_head graveyard_link ; struct rb_node serial_node ; }; struct key_user; union __anonunion_ldv_18182_166 { time_t expiry ; time_t revoked_at ; }; union __anonunion_type_data_167 { struct list_head link ; unsigned long x[2U] ; void *p[2U] ; int reject_error ; }; union __anonunion_payload_168 { unsigned long value ; void *rcudata ; void *data ; struct keyring_list *subscriptions ; }; struct key { atomic_t usage ; key_serial_t serial ; union __anonunion_ldv_18173_165 ldv_18173 ; struct key_type *type ; struct rw_semaphore sem ; struct key_user *user ; void *security ; union __anonunion_ldv_18182_166 ldv_18182 ; time_t last_used_at ; kuid_t uid ; kgid_t gid ; key_perm_t perm ; unsigned short quotalen ; unsigned short datalen ; unsigned long flags ; char *description ; union __anonunion_type_data_167 type_data ; union __anonunion_payload_168 payload ; }; struct audit_context; struct group_info { atomic_t usage ; int ngroups ; int nblocks ; kgid_t small_block[32U] ; kgid_t *blocks[0U] ; }; struct thread_group_cred; struct cred { atomic_t usage ; atomic_t subscribers ; void *put_addr ; unsigned int magic ; kuid_t uid ; kgid_t gid ; kuid_t suid ; kgid_t sgid ; kuid_t euid ; kgid_t egid ; kuid_t fsuid ; kgid_t fsgid ; unsigned int securebits ; kernel_cap_t cap_inheritable ; kernel_cap_t cap_permitted ; kernel_cap_t cap_effective ; kernel_cap_t cap_bset ; unsigned char jit_keyring ; struct key *session_keyring ; struct key *process_keyring ; struct key *thread_keyring ; struct key *request_key_auth ; struct thread_group_cred *tgcred ; void *security ; struct user_struct *user ; struct user_namespace *user_ns ; struct group_info *group_info ; struct callback_head rcu ; }; struct llist_node; struct llist_node { struct llist_node *next ; }; struct futex_pi_state; struct robust_list_head; struct bio_list; struct fs_struct; struct perf_event_context; struct blk_plug; struct cfs_rq; struct task_group; struct io_event { __u64 data ; __u64 obj ; __s64 res ; __s64 res2 ; }; struct iovec { void *iov_base ; __kernel_size_t iov_len ; }; struct kioctx; union __anonunion_ki_obj_169 { void *user ; struct task_struct *tsk ; }; struct eventfd_ctx; struct kiocb { struct list_head ki_run_list ; unsigned long ki_flags ; int ki_users ; unsigned int ki_key ; struct file *ki_filp ; struct kioctx *ki_ctx ; int (*ki_cancel)(struct kiocb * , struct io_event * ) ; ssize_t (*ki_retry)(struct kiocb * ) ; void (*ki_dtor)(struct kiocb * ) ; union __anonunion_ki_obj_169 ki_obj ; __u64 ki_user_data ; loff_t ki_pos ; void *private ; unsigned short ki_opcode ; size_t ki_nbytes ; char *ki_buf ; size_t ki_left ; struct iovec ki_inline_vec ; struct iovec *ki_iovec ; unsigned long ki_nr_segs ; unsigned long ki_cur_seg ; struct list_head ki_list ; struct list_head ki_batch ; struct eventfd_ctx *ki_eventfd ; }; struct aio_ring_info { unsigned long mmap_base ; unsigned long mmap_size ; struct page **ring_pages ; spinlock_t ring_lock ; long nr_pages ; unsigned int nr ; unsigned int tail ; struct page *internal_pages[8U] ; }; struct kioctx { atomic_t users ; int dead ; struct mm_struct *mm ; unsigned long user_id ; struct hlist_node list ; wait_queue_head_t wait ; spinlock_t ctx_lock ; int reqs_active ; struct list_head active_reqs ; struct list_head run_list ; unsigned int max_reqs ; struct aio_ring_info ring_info ; struct delayed_work wq ; struct callback_head callback_head ; }; struct sighand_struct { atomic_t count ; struct k_sigaction action[64U] ; spinlock_t siglock ; wait_queue_head_t signalfd_wqh ; }; struct pacct_struct { int ac_flag ; long ac_exitcode ; unsigned long ac_mem ; cputime_t ac_utime ; cputime_t ac_stime ; unsigned long ac_minflt ; unsigned long ac_majflt ; }; struct cpu_itimer { cputime_t expires ; cputime_t incr ; u32 error ; u32 incr_error ; }; struct cputime { cputime_t utime ; cputime_t stime ; }; struct task_cputime { cputime_t utime ; cputime_t stime ; unsigned long long sum_exec_runtime ; }; struct thread_group_cputimer { struct task_cputime cputime ; int running ; raw_spinlock_t lock ; }; struct autogroup; struct tty_struct; struct taskstats; struct tty_audit_buf; struct signal_struct { atomic_t sigcnt ; atomic_t live ; int nr_threads ; wait_queue_head_t wait_chldexit ; struct task_struct *curr_target ; struct sigpending shared_pending ; int group_exit_code ; int notify_count ; struct task_struct *group_exit_task ; int group_stop_count ; unsigned int flags ; unsigned char is_child_subreaper : 1 ; unsigned char has_child_subreaper : 1 ; struct list_head posix_timers ; struct hrtimer real_timer ; struct pid *leader_pid ; ktime_t it_real_incr ; struct cpu_itimer it[2U] ; struct thread_group_cputimer cputimer ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct pid *tty_old_pgrp ; int leader ; struct tty_struct *tty ; struct autogroup *autogroup ; cputime_t utime ; cputime_t stime ; cputime_t cutime ; cputime_t cstime ; cputime_t gtime ; cputime_t cgtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; unsigned long cnvcsw ; unsigned long cnivcsw ; unsigned long min_flt ; unsigned long maj_flt ; unsigned long cmin_flt ; unsigned long cmaj_flt ; unsigned long inblock ; unsigned long oublock ; unsigned long cinblock ; unsigned long coublock ; unsigned long maxrss ; unsigned long cmaxrss ; struct task_io_accounting ioac ; unsigned long long sum_sched_runtime ; struct rlimit rlim[16U] ; struct pacct_struct pacct ; struct taskstats *stats ; unsigned int audit_tty ; struct tty_audit_buf *tty_audit_buf ; struct rw_semaphore group_rwsem ; oom_flags_t oom_flags ; short oom_score_adj ; short oom_score_adj_min ; struct mutex cred_guard_mutex ; }; struct user_struct { atomic_t __count ; atomic_t processes ; atomic_t files ; atomic_t sigpending ; atomic_t inotify_watches ; atomic_t inotify_devs ; atomic_t fanotify_listeners ; atomic_long_t epoll_watches ; unsigned long mq_bytes ; unsigned long locked_shm ; struct key *uid_keyring ; struct key *session_keyring ; struct hlist_node uidhash_node ; kuid_t uid ; atomic_long_t locked_vm ; }; struct reclaim_state; struct sched_info { unsigned long pcount ; unsigned long long run_delay ; unsigned long long last_arrival ; unsigned long long last_queued ; }; struct task_delay_info { spinlock_t lock ; unsigned int flags ; struct timespec blkio_start ; struct timespec blkio_end ; u64 blkio_delay ; u64 swapin_delay ; u32 blkio_count ; u32 swapin_count ; struct timespec freepages_start ; struct timespec freepages_end ; u64 freepages_delay ; u32 freepages_count ; }; struct rq; struct sched_class { struct sched_class const *next ; void (*enqueue_task)(struct rq * , struct task_struct * , int ) ; void (*dequeue_task)(struct rq * , struct task_struct * , int ) ; void (*yield_task)(struct rq * ) ; bool (*yield_to_task)(struct rq * , struct task_struct * , bool ) ; void (*check_preempt_curr)(struct rq * , struct task_struct * , int ) ; struct task_struct *(*pick_next_task)(struct rq * ) ; void (*put_prev_task)(struct rq * , struct task_struct * ) ; int (*select_task_rq)(struct task_struct * , int , int ) ; void (*migrate_task_rq)(struct task_struct * , int ) ; void (*pre_schedule)(struct rq * , struct task_struct * ) ; void (*post_schedule)(struct rq * ) ; void (*task_waking)(struct task_struct * ) ; void (*task_woken)(struct rq * , struct task_struct * ) ; void (*set_cpus_allowed)(struct task_struct * , struct cpumask const * ) ; void (*rq_online)(struct rq * ) ; void (*rq_offline)(struct rq * ) ; void (*set_curr_task)(struct rq * ) ; void (*task_tick)(struct rq * , struct task_struct * , int ) ; void (*task_fork)(struct task_struct * ) ; void (*switched_from)(struct rq * , struct task_struct * ) ; void (*switched_to)(struct rq * , struct task_struct * ) ; void (*prio_changed)(struct rq * , struct task_struct * , int ) ; unsigned int (*get_rr_interval)(struct rq * , struct task_struct * ) ; void (*task_move_group)(struct task_struct * , int ) ; }; struct load_weight { unsigned long weight ; unsigned long inv_weight ; }; struct sched_avg { u32 runnable_avg_sum ; u32 runnable_avg_period ; u64 last_runnable_update ; s64 decay_count ; unsigned long load_avg_contrib ; }; struct sched_statistics { u64 wait_start ; u64 wait_max ; u64 wait_count ; u64 wait_sum ; u64 iowait_count ; u64 iowait_sum ; u64 sleep_start ; u64 sleep_max ; s64 sum_sleep_runtime ; u64 block_start ; u64 block_max ; u64 exec_max ; u64 slice_max ; u64 nr_migrations_cold ; u64 nr_failed_migrations_affine ; u64 nr_failed_migrations_running ; u64 nr_failed_migrations_hot ; u64 nr_forced_migrations ; u64 nr_wakeups ; u64 nr_wakeups_sync ; u64 nr_wakeups_migrate ; u64 nr_wakeups_local ; u64 nr_wakeups_remote ; u64 nr_wakeups_affine ; u64 nr_wakeups_affine_attempts ; u64 nr_wakeups_passive ; u64 nr_wakeups_idle ; }; struct sched_entity { struct load_weight load ; struct rb_node run_node ; struct list_head group_node ; unsigned int on_rq ; u64 exec_start ; u64 sum_exec_runtime ; u64 vruntime ; u64 prev_sum_exec_runtime ; u64 nr_migrations ; struct sched_statistics statistics ; struct sched_entity *parent ; struct cfs_rq *cfs_rq ; struct cfs_rq *my_q ; struct sched_avg avg ; }; struct rt_rq; struct sched_rt_entity { struct list_head run_list ; unsigned long timeout ; unsigned int time_slice ; struct sched_rt_entity *back ; struct sched_rt_entity *parent ; struct rt_rq *rt_rq ; struct rt_rq *my_q ; }; struct mem_cgroup; struct memcg_batch_info { int do_batch ; struct mem_cgroup *memcg ; unsigned long nr_pages ; unsigned long memsw_nr_pages ; }; struct css_set; struct compat_robust_list_head; struct task_struct { long volatile state ; void *stack ; atomic_t usage ; unsigned int flags ; unsigned int ptrace ; struct llist_node wake_entry ; int on_cpu ; int on_rq ; int prio ; int static_prio ; int normal_prio ; unsigned int rt_priority ; struct sched_class const *sched_class ; struct sched_entity se ; struct sched_rt_entity rt ; struct task_group *sched_task_group ; struct hlist_head preempt_notifiers ; unsigned char fpu_counter ; unsigned int policy ; int nr_cpus_allowed ; cpumask_t cpus_allowed ; struct sched_info sched_info ; struct list_head tasks ; struct plist_node pushable_tasks ; struct mm_struct *mm ; struct mm_struct *active_mm ; unsigned char brk_randomized : 1 ; int exit_state ; int exit_code ; int exit_signal ; int pdeath_signal ; unsigned int jobctl ; unsigned int personality ; unsigned char did_exec : 1 ; unsigned char in_execve : 1 ; unsigned char in_iowait : 1 ; unsigned char no_new_privs : 1 ; unsigned char sched_reset_on_fork : 1 ; unsigned char sched_contributes_to_load : 1 ; pid_t pid ; pid_t tgid ; unsigned long stack_canary ; struct task_struct *real_parent ; struct task_struct *parent ; struct list_head children ; struct list_head sibling ; struct task_struct *group_leader ; struct list_head ptraced ; struct list_head ptrace_entry ; struct pid_link pids[3U] ; struct list_head thread_group ; struct completion *vfork_done ; int *set_child_tid ; int *clear_child_tid ; cputime_t utime ; cputime_t stime ; cputime_t utimescaled ; cputime_t stimescaled ; cputime_t gtime ; struct cputime prev_cputime ; unsigned long nvcsw ; unsigned long nivcsw ; struct timespec start_time ; struct timespec real_start_time ; unsigned long min_flt ; unsigned long maj_flt ; struct task_cputime cputime_expires ; struct list_head cpu_timers[3U] ; struct cred const *real_cred ; struct cred const *cred ; char comm[16U] ; int link_count ; int total_link_count ; struct sysv_sem sysvsem ; unsigned long last_switch_count ; struct thread_struct thread ; struct fs_struct *fs ; struct files_struct *files ; struct nsproxy *nsproxy ; struct signal_struct *signal ; struct sighand_struct *sighand ; sigset_t blocked ; sigset_t real_blocked ; sigset_t saved_sigmask ; struct sigpending pending ; unsigned long sas_ss_sp ; size_t sas_ss_size ; int (*notifier)(void * ) ; void *notifier_data ; sigset_t *notifier_mask ; struct callback_head *task_works ; struct audit_context *audit_context ; kuid_t loginuid ; unsigned int sessionid ; struct seccomp seccomp ; u32 parent_exec_id ; u32 self_exec_id ; spinlock_t alloc_lock ; raw_spinlock_t pi_lock ; struct plist_head pi_waiters ; struct rt_mutex_waiter *pi_blocked_on ; struct mutex_waiter *blocked_on ; unsigned int irq_events ; unsigned long hardirq_enable_ip ; unsigned long hardirq_disable_ip ; unsigned int hardirq_enable_event ; unsigned int hardirq_disable_event ; int hardirqs_enabled ; int hardirq_context ; unsigned long softirq_disable_ip ; unsigned long softirq_enable_ip ; unsigned int softirq_disable_event ; unsigned int softirq_enable_event ; int softirqs_enabled ; int softirq_context ; u64 curr_chain_key ; int lockdep_depth ; unsigned int lockdep_recursion ; struct held_lock held_locks[48U] ; gfp_t lockdep_reclaim_gfp ; void *journal_info ; struct bio_list *bio_list ; struct blk_plug *plug ; struct reclaim_state *reclaim_state ; struct backing_dev_info *backing_dev_info ; struct io_context *io_context ; unsigned long ptrace_message ; siginfo_t *last_siginfo ; struct task_io_accounting ioac ; u64 acct_rss_mem1 ; u64 acct_vm_mem1 ; cputime_t acct_timexpd ; nodemask_t mems_allowed ; seqcount_t mems_allowed_seq ; int cpuset_mem_spread_rotor ; int cpuset_slab_spread_rotor ; struct css_set *cgroups ; struct list_head cg_list ; struct robust_list_head *robust_list ; struct compat_robust_list_head *compat_robust_list ; struct list_head pi_state_list ; struct futex_pi_state *pi_state_cache ; struct perf_event_context *perf_event_ctxp[2U] ; struct mutex perf_event_mutex ; struct list_head perf_event_list ; struct mempolicy *mempolicy ; short il_next ; short pref_node_fork ; int numa_scan_seq ; int numa_migrate_seq ; unsigned int numa_scan_period ; u64 node_stamp ; struct callback_head numa_work ; struct callback_head rcu ; struct pipe_inode_info *splice_pipe ; struct page_frag task_frag ; struct task_delay_info *delays ; int make_it_fail ; int nr_dirtied ; int nr_dirtied_pause ; unsigned long dirty_paused_when ; int latency_record_count ; struct latency_record latency_record[32U] ; unsigned long timer_slack_ns ; unsigned long default_timer_slack_ns ; unsigned long trace ; unsigned long trace_recursion ; struct memcg_batch_info memcg_batch ; unsigned int memcg_kmem_skip_account ; atomic_t ptrace_bp_refcnt ; struct uprobe_task *utask ; }; struct __anonstruct_ldv_20219_172 { struct mem_cgroup *memcg ; struct list_head list ; struct kmem_cache *root_cache ; bool dead ; atomic_t nr_pages ; struct work_struct destroy ; }; union __anonunion_ldv_20220_171 { struct kmem_cache *memcg_caches[0U] ; struct __anonstruct_ldv_20219_172 ldv_20219 ; }; struct memcg_cache_params { bool is_root_cache ; union __anonunion_ldv_20220_171 ldv_20220 ; }; struct sock; enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ; struct kobj_ns_type_operations { enum kobj_ns_type type ; void *(*grab_current_ns)(void) ; void const *(*netlink_ns)(struct sock * ) ; void const *(*initial_ns)(void) ; void (*drop_ns)(void * ) ; }; struct attribute { char const *name ; umode_t mode ; bool ignore_lockdep ; struct lock_class_key *key ; struct lock_class_key skey ; }; struct sysfs_ops { ssize_t (*show)(struct kobject * , struct attribute * , char * ) ; ssize_t (*store)(struct kobject * , struct attribute * , char const * , size_t ) ; void const *(*namespace)(struct kobject * , struct attribute const * ) ; }; struct sysfs_dirent; struct kref { atomic_t refcount ; }; struct kset; struct kobj_type; struct kobject { char const *name ; struct list_head entry ; struct kobject *parent ; struct kset *kset ; struct kobj_type *ktype ; struct sysfs_dirent *sd ; struct kref kref ; unsigned char state_initialized : 1 ; unsigned char state_in_sysfs : 1 ; unsigned char state_add_uevent_sent : 1 ; unsigned char state_remove_uevent_sent : 1 ; unsigned char uevent_suppress : 1 ; }; struct kobj_type { void (*release)(struct kobject * ) ; struct sysfs_ops const *sysfs_ops ; struct attribute **default_attrs ; struct kobj_ns_type_operations const *(*child_ns_type)(struct kobject * ) ; void const *(*namespace)(struct kobject * ) ; }; struct kobj_uevent_env { char *envp[32U] ; int envp_idx ; char buf[2048U] ; int buflen ; }; struct kset_uevent_ops { int (* const filter)(struct kset * , struct kobject * ) ; char const *(* const name)(struct kset * , struct kobject * ) ; int (* const uevent)(struct kset * , struct kobject * , struct kobj_uevent_env * ) ; }; struct kset { struct list_head list ; spinlock_t list_lock ; struct kobject kobj ; struct kset_uevent_ops const *uevent_ops ; }; struct kmem_cache_cpu { void **freelist ; unsigned long tid ; struct page *page ; struct page *partial ; unsigned int stat[26U] ; }; struct kmem_cache_node { spinlock_t list_lock ; unsigned long nr_partial ; struct list_head partial ; atomic_long_t nr_slabs ; atomic_long_t total_objects ; struct list_head full ; }; struct kmem_cache_order_objects { unsigned long x ; }; struct kmem_cache { struct kmem_cache_cpu *cpu_slab ; unsigned long flags ; unsigned long min_partial ; int size ; int object_size ; int offset ; int cpu_partial ; struct kmem_cache_order_objects oo ; struct kmem_cache_order_objects max ; struct kmem_cache_order_objects min ; gfp_t allocflags ; int refcount ; void (*ctor)(void * ) ; int inuse ; int align ; int reserved ; char const *name ; struct list_head list ; struct kobject kobj ; struct memcg_cache_params *memcg_params ; int max_attr_size ; int remote_node_defrag_ratio ; struct kmem_cache_node *node[1024U] ; }; struct ubi_volume_info { int ubi_num ; int vol_id ; int size ; long long used_bytes ; int used_ebs ; int vol_type ; int corrupted ; int upd_marker ; int alignment ; int usable_leb_size ; int name_len ; char const *name ; dev_t cdev ; }; struct ubi_device_info { int ubi_num ; int leb_size ; int leb_start ; int min_io_size ; int max_write_size ; int ro_mode ; dev_t cdev ; }; struct ubi_volume_desc; struct vm_fault { unsigned int flags ; unsigned long pgoff ; void *virtual_address ; struct page *page ; }; struct vm_operations_struct { void (*open)(struct vm_area_struct * ) ; void (*close)(struct vm_area_struct * ) ; int (*fault)(struct vm_area_struct * , struct vm_fault * ) ; int (*page_mkwrite)(struct vm_area_struct * , struct vm_fault * ) ; int (*access)(struct vm_area_struct * , unsigned long , void * , int , int ) ; int (*set_policy)(struct vm_area_struct * , struct mempolicy * ) ; struct mempolicy *(*get_policy)(struct vm_area_struct * , unsigned long ) ; int (*migrate)(struct vm_area_struct * , nodemask_t const * , nodemask_t const * , unsigned long ) ; int (*remap_pages)(struct vm_area_struct * , unsigned long , unsigned long , unsigned long ) ; }; struct fprop_local_percpu { struct percpu_counter events ; unsigned int period ; raw_spinlock_t lock ; }; enum writeback_sync_modes { WB_SYNC_NONE = 0, WB_SYNC_ALL = 1 } ; struct writeback_control { long nr_to_write ; long pages_skipped ; loff_t range_start ; loff_t range_end ; enum writeback_sync_modes sync_mode ; unsigned char for_kupdate : 1 ; unsigned char for_background : 1 ; unsigned char tagged_writepages : 1 ; unsigned char for_reclaim : 1 ; unsigned char range_cyclic : 1 ; }; struct bdi_writeback; typedef int congested_fn(void * , int ); struct bdi_writeback { struct backing_dev_info *bdi ; unsigned int nr ; unsigned long last_old_flush ; unsigned long last_active ; struct task_struct *task ; struct timer_list wakeup_timer ; struct list_head b_dirty ; struct list_head b_io ; struct list_head b_more_io ; spinlock_t list_lock ; }; struct backing_dev_info { struct list_head bdi_list ; unsigned long ra_pages ; unsigned long state ; unsigned int capabilities ; congested_fn *congested_fn ; void *congested_data ; char *name ; struct percpu_counter bdi_stat[4U] ; unsigned long bw_time_stamp ; unsigned long dirtied_stamp ; unsigned long written_stamp ; unsigned long write_bandwidth ; unsigned long avg_write_bandwidth ; unsigned long dirty_ratelimit ; unsigned long balanced_dirty_ratelimit ; struct fprop_local_percpu completions ; int dirty_exceeded ; unsigned int min_ratio ; unsigned int max_ratio ; unsigned int max_prop_frac ; struct bdi_writeback wb ; spinlock_t wb_lock ; struct list_head work_list ; struct device *dev ; struct timer_list laptop_mode_wb_timer ; struct dentry *debug_dir ; struct dentry *debug_stats ; }; struct ubifs_ch { __le32 magic ; __le32 crc ; __le64 sqnum ; __le32 len ; __u8 node_type ; __u8 group_type ; __u8 padding[2U] ; }; struct ubifs_mst_node { struct ubifs_ch ch ; __le64 highest_inum ; __le64 cmt_no ; __le32 flags ; __le32 log_lnum ; __le32 root_lnum ; __le32 root_offs ; __le32 root_len ; __le32 gc_lnum ; __le32 ihead_lnum ; __le32 ihead_offs ; __le64 index_size ; __le64 total_free ; __le64 total_dirty ; __le64 total_used ; __le64 total_dead ; __le64 total_dark ; __le32 lpt_lnum ; __le32 lpt_offs ; __le32 nhead_lnum ; __le32 nhead_offs ; __le32 ltab_lnum ; __le32 ltab_offs ; __le32 lsave_lnum ; __le32 lsave_offs ; __le32 lscan_lnum ; __le32 empty_lebs ; __le32 idx_lebs ; __le32 leb_cnt ; __u8 padding[344U] ; }; union ubifs_key { uint8_t u8[8U] ; uint32_t u32[2U] ; uint64_t u64[1U] ; __le32 j32[2U] ; }; union __anonunion_ldv_25977_175 { struct list_head list ; int hpos ; }; struct ubifs_lprops { int free ; int dirty ; int flags ; int lnum ; union __anonunion_ldv_25977_175 ldv_25977 ; }; struct ubifs_lpt_lprops { int free ; int dirty ; unsigned char tgc : 1 ; unsigned char cmt : 1 ; }; struct ubifs_lp_stats { int empty_lebs ; int taken_empty_lebs ; int idx_lebs ; long long total_free ; long long total_dirty ; long long total_used ; long long total_dead ; long long total_dark ; }; struct ubifs_nnode; struct ubifs_cnode { struct ubifs_nnode *parent ; struct ubifs_cnode *cnext ; unsigned long flags ; int iip ; int level ; int num ; }; struct ubifs_pnode { struct ubifs_nnode *parent ; struct ubifs_cnode *cnext ; unsigned long flags ; int iip ; int level ; int num ; struct ubifs_lprops lprops[4U] ; }; union __anonunion_ldv_26015_176 { struct ubifs_nnode *nnode ; struct ubifs_pnode *pnode ; struct ubifs_cnode *cnode ; }; struct ubifs_nbranch { int lnum ; int offs ; union __anonunion_ldv_26015_176 ldv_26015 ; }; struct ubifs_nnode { struct ubifs_nnode *parent ; struct ubifs_cnode *cnext ; unsigned long flags ; int iip ; int level ; int num ; struct ubifs_nbranch nbranch[4U] ; }; struct ubifs_lpt_heap { struct ubifs_lprops **arr ; int cnt ; int max_cnt ; }; struct ubifs_info; struct ubifs_wbuf { struct ubifs_info *c ; void *buf ; int lnum ; int offs ; int avail ; int used ; int size ; int jhead ; int (*sync_callback)(struct ubifs_info * , int , int , int ) ; struct mutex io_mutex ; spinlock_t lock ; ktime_t softlimit ; unsigned long long delta ; struct hrtimer timer ; unsigned char no_timer : 1 ; unsigned char need_sync : 1 ; int next_ino ; ino_t *inodes ; }; struct ubifs_jhead { struct ubifs_wbuf wbuf ; struct list_head buds_list ; unsigned char grouped : 1 ; }; struct ubifs_znode; union __anonunion_ldv_26076_177 { struct ubifs_znode *znode ; void *leaf ; }; struct ubifs_zbranch { union ubifs_key key ; union __anonunion_ldv_26076_177 ldv_26076 ; int lnum ; int offs ; int len ; }; struct ubifs_znode { struct ubifs_znode *parent ; struct ubifs_znode *cnext ; unsigned long flags ; unsigned long time ; int level ; int child_cnt ; int iip ; int alt ; int lnum ; int offs ; int len ; struct ubifs_zbranch zbranch[] ; }; struct bu_info { union ubifs_key key ; struct ubifs_zbranch zbranch[32U] ; void *buf ; int buf_len ; int gc_seq ; int cnt ; int blk_cnt ; int eof ; }; union __anonunion_ldv_26105_178 { int len ; int min_len ; }; struct ubifs_node_range { union __anonunion_ldv_26105_178 ldv_26105 ; int max_len ; }; struct ubifs_orphan { struct rb_node rb ; struct list_head list ; struct list_head new_list ; struct ubifs_orphan *cnext ; struct ubifs_orphan *dnext ; ino_t inum ; int new ; }; struct ubifs_mount_opts { unsigned char unmount_mode : 2 ; unsigned char bulk_read : 2 ; unsigned char chk_data_crc : 2 ; unsigned char override_compr : 1 ; unsigned char compr_type : 2 ; }; struct ubifs_budg_info { long long idx_growth ; long long data_growth ; long long dd_growth ; long long uncommitted_idx ; unsigned long long old_idx_sz ; int min_idx_lebs ; unsigned char nospace : 1 ; unsigned char nospace_rp : 1 ; int page_budget ; int inode_budget ; int dent_budget ; }; struct ubifs_debug_info; struct ubifs_info { struct super_block *vfs_sb ; struct backing_dev_info bdi ; ino_t highest_inum ; unsigned long long max_sqnum ; unsigned long long cmt_no ; spinlock_t cnt_lock ; int fmt_version ; int ro_compat_version ; unsigned char uuid[16U] ; int lhead_lnum ; int lhead_offs ; int ltail_lnum ; struct mutex log_mutex ; int min_log_bytes ; long long cmt_bud_bytes ; struct rb_root buds ; long long bud_bytes ; spinlock_t buds_lock ; int jhead_cnt ; struct ubifs_jhead *jheads ; long long max_bud_bytes ; long long bg_bud_bytes ; struct list_head old_buds ; int max_bud_cnt ; struct rw_semaphore commit_sem ; int cmt_state ; spinlock_t cs_lock ; wait_queue_head_t cmt_wq ; unsigned char big_lpt : 1 ; unsigned char space_fixup : 1 ; unsigned char no_chk_data_crc : 1 ; unsigned char bulk_read : 1 ; unsigned char default_compr : 2 ; unsigned char rw_incompat : 1 ; struct mutex tnc_mutex ; struct ubifs_zbranch zroot ; struct ubifs_znode *cnext ; struct ubifs_znode *enext ; int *gap_lebs ; void *cbuf ; void *ileb_buf ; int ileb_len ; int ihead_lnum ; int ihead_offs ; int *ilebs ; int ileb_cnt ; int ileb_nxt ; struct rb_root old_idx ; int *bottom_up_buf ; struct ubifs_mst_node *mst_node ; int mst_offs ; struct mutex mst_mutex ; int max_bu_buf_len ; struct mutex bu_mutex ; struct bu_info bu ; struct mutex write_reserve_mutex ; void *write_reserve_buf ; int log_lebs ; long long log_bytes ; int log_last ; int lpt_lebs ; int lpt_first ; int lpt_last ; int orph_lebs ; int orph_first ; int orph_last ; int main_lebs ; int main_first ; long long main_bytes ; uint8_t key_hash_type ; uint32_t (*key_hash)(char const * , int ) ; int key_fmt ; int key_len ; int fanout ; int min_io_size ; int min_io_shift ; int max_write_size ; int max_write_shift ; int leb_size ; int leb_start ; int half_leb_size ; int idx_leb_size ; int leb_cnt ; int max_leb_cnt ; int old_leb_cnt ; unsigned char ro_media : 1 ; unsigned char ro_mount : 1 ; unsigned char ro_error : 1 ; atomic_long_t dirty_pg_cnt ; atomic_long_t dirty_zn_cnt ; atomic_long_t clean_zn_cnt ; spinlock_t space_lock ; struct ubifs_lp_stats lst ; struct ubifs_budg_info bi ; unsigned long long calc_idx_sz ; int ref_node_alsz ; int mst_node_alsz ; int min_idx_node_sz ; int max_idx_node_sz ; long long max_inode_sz ; int max_znode_sz ; int leb_overhead ; int dead_wm ; int dark_wm ; int block_cnt ; struct ubifs_node_range ranges[12U] ; struct ubi_volume_desc *ubi ; struct ubi_device_info di ; struct ubi_volume_info vi ; struct rb_root orph_tree ; struct list_head orph_list ; struct list_head orph_new ; struct ubifs_orphan *orph_cnext ; struct ubifs_orphan *orph_dnext ; spinlock_t orphan_lock ; void *orph_buf ; int new_orphans ; int cmt_orphans ; int tot_orphans ; int max_orphans ; int ohead_lnum ; int ohead_offs ; int no_orphs ; struct task_struct *bgt ; char bgt_name[24U] ; int need_bgt ; int need_wbuf_sync ; int gc_lnum ; void *sbuf ; struct list_head idx_gc ; int idx_gc_cnt ; int gc_seq ; int gced_lnum ; struct list_head infos_list ; struct mutex umount_mutex ; unsigned int shrinker_run_no ; int space_bits ; int lpt_lnum_bits ; int lpt_offs_bits ; int lpt_spc_bits ; int pcnt_bits ; int lnum_bits ; int nnode_sz ; int pnode_sz ; int ltab_sz ; int lsave_sz ; int pnode_cnt ; int nnode_cnt ; int lpt_hght ; int pnodes_have ; struct mutex lp_mutex ; int lpt_lnum ; int lpt_offs ; int nhead_lnum ; int nhead_offs ; int lpt_drty_flgs ; int dirty_nn_cnt ; int dirty_pn_cnt ; int check_lpt_free ; long long lpt_sz ; void *lpt_nod_buf ; void *lpt_buf ; struct ubifs_nnode *nroot ; struct ubifs_cnode *lpt_cnext ; struct ubifs_lpt_heap lpt_heap[3U] ; struct ubifs_lpt_heap dirty_idx ; struct list_head uncat_list ; struct list_head empty_list ; struct list_head freeable_list ; struct list_head frdi_idx_list ; int freeable_cnt ; int in_a_category_cnt ; int ltab_lnum ; int ltab_offs ; struct ubifs_lpt_lprops *ltab ; struct ubifs_lpt_lprops *ltab_cmt ; int lsave_cnt ; int lsave_lnum ; int lsave_offs ; int *lsave ; int lscan_lnum ; long long rp_size ; long long report_rp_size ; kuid_t rp_uid ; kgid_t rp_gid ; unsigned char empty : 1 ; unsigned char need_recovery : 1 ; unsigned char replaying : 1 ; unsigned char mounting : 1 ; unsigned char remounting_rw : 1 ; struct list_head replay_list ; struct list_head replay_buds ; unsigned long long cs_sqnum ; unsigned long long replay_sqnum ; struct list_head unclean_leb_list ; struct ubifs_mst_node *rcvrd_mst_node ; struct rb_root size_tree ; struct ubifs_mount_opts mount_opts ; struct ubifs_debug_info *dbg ; }; struct ubifs_debug_info { struct ubifs_zbranch old_zroot ; int old_zroot_level ; unsigned long long old_zroot_sqnum ; int pc_happened ; int pc_delay ; unsigned long pc_timeout ; unsigned int pc_cnt ; unsigned int pc_cnt_max ; long long chk_lpt_sz ; long long chk_lpt_sz2 ; long long chk_lpt_wastage ; int chk_lpt_lebs ; int new_nhead_offs ; int new_ihead_lnum ; int new_ihead_offs ; struct ubifs_lp_stats saved_lst ; struct ubifs_budg_info saved_bi ; long long saved_free ; int saved_idx_gc_cnt ; unsigned char chk_gen : 1 ; unsigned char chk_index : 1 ; unsigned char chk_orph : 1 ; unsigned char chk_lprops : 1 ; unsigned char chk_fs : 1 ; unsigned char tst_rcvry : 1 ; char dfs_dir_name[10U] ; struct dentry *dfs_dir ; struct dentry *dfs_dump_lprops ; struct dentry *dfs_dump_budg ; struct dentry *dfs_dump_tnc ; struct dentry *dfs_chk_gen ; struct dentry *dfs_chk_index ; struct dentry *dfs_chk_orph ; struct dentry *dfs_chk_lprops ; struct dentry *dfs_chk_fs ; struct dentry *dfs_tst_rcvry ; struct dentry *dfs_ro_error ; }; typedef int ldv_func_ret_type___7; typedef int ldv_func_ret_type___8; typedef int ldv_func_ret_type___12; typedef __u16 __le16; enum hrtimer_restart; struct ubifs_ino_node { struct ubifs_ch ch ; __u8 key[16U] ; __le64 creat_sqnum ; __le64 size ; __le64 atime_sec ; __le64 ctime_sec ; __le64 mtime_sec ; __le32 atime_nsec ; __le32 ctime_nsec ; __le32 mtime_nsec ; __le32 nlink ; __le32 uid ; __le32 gid ; __le32 mode ; __le32 flags ; __le32 data_len ; __le32 xattr_cnt ; __le32 xattr_size ; __u8 padding1[4U] ; __le32 xattr_names ; __le16 compr_type ; __u8 padding2[26U] ; __u8 data[] ; }; struct ubifs_dent_node { struct ubifs_ch ch ; __u8 key[16U] ; __le64 inum ; __u8 padding1 ; __u8 type ; __le16 nlen ; __u8 padding2[4U] ; __u8 name[] ; }; struct ubifs_data_node { struct ubifs_ch ch ; __u8 key[16U] ; __le32 size ; __le16 compr_type ; __u8 padding[2U] ; __u8 data[] ; }; struct ubifs_trun_node { struct ubifs_ch ch ; __le32 inum ; __u8 padding[12U] ; __le64 old_size ; __le64 new_size ; }; struct ubifs_inode { struct inode vfs_inode ; unsigned long long creat_sqnum ; unsigned long long del_cmtno ; unsigned int xattr_size ; unsigned int xattr_cnt ; unsigned int xattr_names ; unsigned char dirty : 1 ; unsigned char xattr : 1 ; unsigned char bulk_read : 1 ; unsigned char compr_type : 2 ; struct mutex ui_mutex ; spinlock_t ui_lock ; loff_t synced_i_size ; loff_t ui_size ; int flags ; unsigned long last_page_read ; unsigned long read_in_a_row ; int data_len ; void *data ; }; struct exec_domain; struct map_segment; struct exec_domain { char const *name ; void (*handler)(int , struct pt_regs * ) ; unsigned char pers_low ; unsigned char pers_high ; unsigned long *signal_map ; unsigned long *signal_invmap ; struct map_segment *err_map ; struct map_segment *socktype_map ; struct map_segment *sockopt_map ; struct map_segment *af_map ; struct module *module ; struct exec_domain *next ; }; struct __anonstruct_mm_segment_t_27 { unsigned long seg ; }; typedef struct __anonstruct_mm_segment_t_27 mm_segment_t; struct compat_timespec; struct __anonstruct_futex_32 { u32 *uaddr ; u32 val ; u32 flags ; u32 bitset ; u64 time ; u32 *uaddr2 ; }; struct __anonstruct_nanosleep_33 { clockid_t clockid ; struct timespec *rmtp ; struct compat_timespec *compat_rmtp ; u64 expires ; }; struct pollfd; struct __anonstruct_poll_34 { struct pollfd *ufds ; int nfds ; int has_timeout ; unsigned long tv_sec ; unsigned long tv_nsec ; }; union __anonunion_ldv_6463_31 { struct __anonstruct_futex_32 futex ; struct __anonstruct_nanosleep_33 nanosleep ; struct __anonstruct_poll_34 poll ; }; struct restart_block { long (*fn)(struct restart_block * ) ; union __anonunion_ldv_6463_31 ldv_6463 ; }; struct thread_info { struct task_struct *task ; struct exec_domain *exec_domain ; __u32 flags ; __u32 status ; __u32 cpu ; int preempt_count ; mm_segment_t addr_limit ; struct restart_block restart_block ; void *sysenter_return ; unsigned char sig_on_uaccess_error : 1 ; unsigned char uaccess_err : 1 ; }; enum hrtimer_restart; struct ubifs_budget_req { unsigned char fast : 1 ; unsigned char recalculate : 1 ; unsigned char new_page : 1 ; unsigned char dirtied_page : 1 ; unsigned char new_dent : 1 ; unsigned char mod_dent : 1 ; unsigned char new_ino : 1 ; unsigned short new_ino_d : 13 ; unsigned char dirtied_ino : 4 ; unsigned short dirtied_ino_d : 15 ; int idx_growth ; int data_growth ; int dd_growth ; }; struct vfsmount { struct dentry *mnt_root ; struct super_block *mnt_sb ; int mnt_flags ; }; struct nameidata { struct path path ; struct qstr last ; struct path root ; struct inode *inode ; unsigned int flags ; unsigned int seq ; int last_type ; unsigned int depth ; char *saved_names[9U] ; }; typedef int ldv_func_ret_type___13; typedef int ldv_func_ret_type___14; enum hrtimer_restart; union ubifs_dev_desc { __le32 new ; __le64 huge ; }; struct ubifs_global_debug_info { unsigned char chk_gen : 1 ; unsigned char chk_index : 1 ; unsigned char chk_orph : 1 ; unsigned char chk_lprops : 1 ; unsigned char chk_fs : 1 ; unsigned char tst_rcvry : 1 ; }; typedef short s16; typedef void (*ctor_fn_t)(void); struct bug_entry { int bug_addr_disp ; int file_disp ; unsigned short line ; unsigned short flags ; }; struct static_key; struct seq_operations; enum hrtimer_restart; typedef __u64 Elf64_Addr; typedef __u16 Elf64_Half; typedef __u32 Elf64_Word; typedef __u64 Elf64_Xword; struct elf64_sym { Elf64_Word st_name ; unsigned char st_info ; unsigned char st_other ; Elf64_Half st_shndx ; Elf64_Addr st_value ; Elf64_Xword st_size ; }; typedef struct elf64_sym Elf64_Sym; struct kernel_param; struct kernel_param_ops { int (*set)(char const * , struct kernel_param const * ) ; int (*get)(char * , struct kernel_param const * ) ; void (*free)(void * ) ; }; struct kparam_string; struct kparam_array; union __anonunion_ldv_14347_136 { void *arg ; struct kparam_string const *str ; struct kparam_array const *arr ; }; struct kernel_param { char const *name ; struct kernel_param_ops const *ops ; u16 perm ; s16 level ; union __anonunion_ldv_14347_136 ldv_14347 ; }; struct kparam_string { unsigned int maxlen ; char *string ; }; struct kparam_array { unsigned int max ; unsigned int elemsize ; unsigned int *num ; struct kernel_param_ops const *ops ; void *elem ; }; struct static_key { atomic_t enabled ; }; struct tracepoint; struct tracepoint_func { void *func ; void *data ; }; struct tracepoint { char const *name ; struct static_key key ; void (*regfunc)(void) ; void (*unregfunc)(void) ; struct tracepoint_func *funcs ; }; struct kernel_symbol { unsigned long value ; char const *name ; }; struct mod_arch_specific { }; struct module_param_attrs; struct module_kobject { struct kobject kobj ; struct module *mod ; struct kobject *drivers_dir ; struct module_param_attrs *mp ; }; struct module_attribute { struct attribute attr ; ssize_t (*show)(struct module_attribute * , struct module_kobject * , char * ) ; ssize_t (*store)(struct module_attribute * , struct module_kobject * , char const * , size_t ) ; void (*setup)(struct module * , char const * ) ; int (*test)(struct module * ) ; void (*free)(struct module * ) ; }; struct exception_table_entry; enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2 } ; struct module_ref { unsigned long incs ; unsigned long decs ; }; struct module_sect_attrs; struct module_notes_attrs; struct ftrace_event_call; struct module { enum module_state state ; struct list_head list ; char name[56U] ; struct module_kobject mkobj ; struct module_attribute *modinfo_attrs ; char const *version ; char const *srcversion ; struct kobject *holders_dir ; struct kernel_symbol const *syms ; unsigned long const *crcs ; unsigned int num_syms ; struct kernel_param *kp ; unsigned int num_kp ; unsigned int num_gpl_syms ; struct kernel_symbol const *gpl_syms ; unsigned long const *gpl_crcs ; struct kernel_symbol const *unused_syms ; unsigned long const *unused_crcs ; unsigned int num_unused_syms ; unsigned int num_unused_gpl_syms ; struct kernel_symbol const *unused_gpl_syms ; unsigned long const *unused_gpl_crcs ; struct kernel_symbol const *gpl_future_syms ; unsigned long const *gpl_future_crcs ; unsigned int num_gpl_future_syms ; unsigned int num_exentries ; struct exception_table_entry *extable ; int (*init)(void) ; void *module_init ; void *module_core ; unsigned int init_size ; unsigned int core_size ; unsigned int init_text_size ; unsigned int core_text_size ; unsigned int init_ro_size ; unsigned int core_ro_size ; struct mod_arch_specific arch ; unsigned int taints ; unsigned int num_bugs ; struct list_head bug_list ; struct bug_entry *bug_table ; Elf64_Sym *symtab ; Elf64_Sym *core_symtab ; unsigned int num_symtab ; unsigned int core_num_syms ; char *strtab ; char *core_strtab ; struct module_sect_attrs *sect_attrs ; struct module_notes_attrs *notes_attrs ; char *args ; void *percpu ; unsigned int percpu_size ; unsigned int num_tracepoints ; struct tracepoint * const *tracepoints_ptrs ; unsigned int num_trace_bprintk_fmt ; char const **trace_bprintk_fmt_start ; struct ftrace_event_call **trace_events ; unsigned int num_trace_events ; struct list_head source_list ; struct list_head target_list ; struct task_struct *waiter ; void (*exit)(void) ; struct module_ref *refptr ; ctor_fn_t (**ctors)(void) ; unsigned int num_ctors ; }; struct match_token { int token ; char const *pattern ; }; struct __anonstruct_substring_t_166 { char *from ; char *to ; }; typedef struct __anonstruct_substring_t_166 substring_t; struct seq_file { char *buf ; size_t size ; size_t from ; size_t count ; loff_t index ; loff_t read_pos ; u64 version ; struct mutex lock ; struct seq_operations const *op ; int poll_event ; void *private ; }; struct seq_operations { void *(*start)(struct seq_file * , loff_t * ) ; void (*stop)(struct seq_file * , void * ) ; void *(*next)(struct seq_file * , void * , loff_t * ) ; int (*show)(struct seq_file * , void * ) ; }; struct exception_table_entry { int insn ; int fixup ; }; struct ubifs_sb_node { struct ubifs_ch ch ; __u8 padding[2U] ; __u8 key_hash ; __u8 key_fmt ; __le32 flags ; __le32 min_io_size ; __le32 leb_size ; __le32 leb_cnt ; __le32 max_leb_cnt ; __le64 max_bud_bytes ; __le32 log_lebs ; __le32 lpt_lebs ; __le32 orph_lebs ; __le32 jhead_cnt ; __le32 fanout ; __le32 lsave_cnt ; __le32 fmt_version ; __le16 default_compr ; __u8 padding1[2U] ; __le32 rp_uid ; __le32 rp_gid ; __le64 rp_size ; __le32 time_gran ; __u8 uuid[16U] ; __le32 ro_compat_version ; __u8 padding2[3968U] ; }; struct ubifs_unclean_leb { struct list_head list ; int lnum ; int endpt ; }; struct ubifs_bud { int lnum ; int start ; int jhead ; struct list_head list ; struct rb_node rb ; }; struct crypto_comp; struct ubifs_compressor { int compr_type ; struct crypto_comp *cc ; struct mutex *comp_mutex ; struct mutex *decomp_mutex ; char const *name ; char const *capi_name ; }; enum hrtimer_restart; struct ubifs_branch { __le32 lnum ; __le32 offs ; __le32 len ; __u8 key[] ; }; struct ubifs_idx_node { struct ubifs_ch ch ; __le16 child_cnt ; __le16 level ; __u8 branches[] ; }; struct ubifs_cs_node { struct ubifs_ch ch ; __le64 cmt_no ; }; enum hrtimer_restart; enum hrtimer_mode { HRTIMER_MODE_ABS = 0, HRTIMER_MODE_REL = 1, HRTIMER_MODE_PINNED = 2, HRTIMER_MODE_ABS_PINNED = 2, HRTIMER_MODE_REL_PINNED = 3 } ; struct ubifs_pad_node { struct ubifs_ch ch ; __le32 pad_len ; }; enum hrtimer_restart; struct ubifs_old_idx { struct rb_node rb ; int lnum ; int offs ; }; enum hrtimer_restart; struct ubifs_scan_node { struct list_head list ; union ubifs_key key ; unsigned long long sqnum ; int type ; int offs ; int len ; void *node ; }; struct ubifs_scan_leb { int lnum ; int nodes_cnt ; struct list_head nodes ; int endpt ; int ecc ; void *buf ; }; enum hrtimer_restart; enum hrtimer_restart; struct ubifs_ref_node { struct ubifs_ch ch ; __le32 lnum ; __le32 offs ; __le32 jhead ; __u8 padding[28U] ; }; struct __anonstruct_ldv_27506_180 { loff_t old_size ; loff_t new_size ; }; union __anonunion_ldv_27507_179 { struct qstr nm ; struct __anonstruct_ldv_27506_180 ldv_27506 ; }; struct replay_entry { int lnum ; int offs ; int len ; unsigned char deletion : 1 ; unsigned long long sqnum ; struct list_head list ; union ubifs_key key ; union __anonunion_ldv_27507_179 ldv_27507 ; }; struct bud_entry { struct list_head list ; struct ubifs_bud *bud ; unsigned long long sqnum ; int free ; int dirty ; }; enum hrtimer_restart; struct done_ref { struct rb_node rb ; int lnum ; }; struct __wait_queue; typedef struct __wait_queue wait_queue_t; struct __wait_queue { unsigned int flags ; void *private ; int (*func)(wait_queue_t * , unsigned int , int , void * ) ; struct list_head task_list ; }; enum hrtimer_restart; struct idx_node { struct list_head list ; int iip ; union ubifs_key upper_key ; struct ubifs_idx_node idx ; }; enum hrtimer_restart; struct ubifs_gced_idx_leb { struct list_head list ; int lnum ; int unmap ; }; enum hrtimer_restart; struct ubifs_orph_node { struct ubifs_ch ch ; __le64 cmt_no ; __le64 inos[] ; }; struct check_orphan { struct rb_node rb ; ino_t inum ; }; struct check_info { unsigned long last_ino ; unsigned long tot_inos ; unsigned long missing ; unsigned long long leaf_cnt ; struct ubifs_ino_node *node ; struct rb_root root ; }; enum hrtimer_restart; enum wb_reason { WB_REASON_BACKGROUND = 0, WB_REASON_TRY_TO_FREE_PAGES = 1, WB_REASON_SYNC = 2, WB_REASON_PERIODIC = 3, WB_REASON_LAPTOP_TIMER = 4, WB_REASON_FREE_MORE_MEM = 5, WB_REASON_FS_FREE_SPACE = 6, WB_REASON_FORKER_THREAD = 7, WB_REASON_MAX = 8 } ; enum hrtimer_restart; struct scan_data { int min_space ; int pick_free ; int lnum ; int exclude_index ; }; enum hrtimer_restart; enum hrtimer_restart; struct scatterlist; struct crypto_ablkcipher; struct crypto_async_request; struct crypto_aead; struct crypto_blkcipher; struct crypto_hash; struct crypto_rng; struct crypto_tfm; struct crypto_type; struct aead_givcrypt_request; struct skcipher_givcrypt_request; struct crypto_async_request { struct list_head list ; void (*complete)(struct crypto_async_request * , int ) ; void *data ; struct crypto_tfm *tfm ; u32 flags ; }; struct ablkcipher_request { struct crypto_async_request base ; unsigned int nbytes ; void *info ; struct scatterlist *src ; struct scatterlist *dst ; void *__ctx[] ; }; struct aead_request { struct crypto_async_request base ; unsigned int assoclen ; unsigned int cryptlen ; u8 *iv ; struct scatterlist *assoc ; struct scatterlist *src ; struct scatterlist *dst ; void *__ctx[] ; }; struct blkcipher_desc { struct crypto_blkcipher *tfm ; void *info ; u32 flags ; }; struct hash_desc { struct crypto_hash *tfm ; u32 flags ; }; struct ablkcipher_alg { int (*setkey)(struct crypto_ablkcipher * , u8 const * , unsigned int ) ; int (*encrypt)(struct ablkcipher_request * ) ; int (*decrypt)(struct ablkcipher_request * ) ; int (*givencrypt)(struct skcipher_givcrypt_request * ) ; int (*givdecrypt)(struct skcipher_givcrypt_request * ) ; char const *geniv ; unsigned int min_keysize ; unsigned int max_keysize ; unsigned int ivsize ; }; struct aead_alg { int (*setkey)(struct crypto_aead * , u8 const * , unsigned int ) ; int (*setauthsize)(struct crypto_aead * , unsigned int ) ; int (*encrypt)(struct aead_request * ) ; int (*decrypt)(struct aead_request * ) ; int (*givencrypt)(struct aead_givcrypt_request * ) ; int (*givdecrypt)(struct aead_givcrypt_request * ) ; char const *geniv ; unsigned int ivsize ; unsigned int maxauthsize ; }; struct blkcipher_alg { int (*setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; int (*encrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; int (*decrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; char const *geniv ; unsigned int min_keysize ; unsigned int max_keysize ; unsigned int ivsize ; }; struct cipher_alg { unsigned int cia_min_keysize ; unsigned int cia_max_keysize ; int (*cia_setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; void (*cia_encrypt)(struct crypto_tfm * , u8 * , u8 const * ) ; void (*cia_decrypt)(struct crypto_tfm * , u8 * , u8 const * ) ; }; struct compress_alg { int (*coa_compress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; int (*coa_decompress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; }; struct rng_alg { int (*rng_make_random)(struct crypto_rng * , u8 * , unsigned int ) ; int (*rng_reset)(struct crypto_rng * , u8 * , unsigned int ) ; unsigned int seedsize ; }; union __anonunion_cra_u_130 { struct ablkcipher_alg ablkcipher ; struct aead_alg aead ; struct blkcipher_alg blkcipher ; struct cipher_alg cipher ; struct compress_alg compress ; struct rng_alg rng ; }; struct crypto_alg { struct list_head cra_list ; struct list_head cra_users ; u32 cra_flags ; unsigned int cra_blocksize ; unsigned int cra_ctxsize ; unsigned int cra_alignmask ; int cra_priority ; atomic_t cra_refcnt ; char cra_name[64U] ; char cra_driver_name[64U] ; struct crypto_type const *cra_type ; union __anonunion_cra_u_130 cra_u ; int (*cra_init)(struct crypto_tfm * ) ; void (*cra_exit)(struct crypto_tfm * ) ; void (*cra_destroy)(struct crypto_alg * ) ; struct module *cra_module ; }; struct ablkcipher_tfm { int (*setkey)(struct crypto_ablkcipher * , u8 const * , unsigned int ) ; int (*encrypt)(struct ablkcipher_request * ) ; int (*decrypt)(struct ablkcipher_request * ) ; int (*givencrypt)(struct skcipher_givcrypt_request * ) ; int (*givdecrypt)(struct skcipher_givcrypt_request * ) ; struct crypto_ablkcipher *base ; unsigned int ivsize ; unsigned int reqsize ; }; struct aead_tfm { int (*setkey)(struct crypto_aead * , u8 const * , unsigned int ) ; int (*encrypt)(struct aead_request * ) ; int (*decrypt)(struct aead_request * ) ; int (*givencrypt)(struct aead_givcrypt_request * ) ; int (*givdecrypt)(struct aead_givcrypt_request * ) ; struct crypto_aead *base ; unsigned int ivsize ; unsigned int authsize ; unsigned int reqsize ; }; struct blkcipher_tfm { void *iv ; int (*setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; int (*encrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; int (*decrypt)(struct blkcipher_desc * , struct scatterlist * , struct scatterlist * , unsigned int ) ; }; struct cipher_tfm { int (*cit_setkey)(struct crypto_tfm * , u8 const * , unsigned int ) ; void (*cit_encrypt_one)(struct crypto_tfm * , u8 * , u8 const * ) ; void (*cit_decrypt_one)(struct crypto_tfm * , u8 * , u8 const * ) ; }; struct hash_tfm { int (*init)(struct hash_desc * ) ; int (*update)(struct hash_desc * , struct scatterlist * , unsigned int ) ; int (*final)(struct hash_desc * , u8 * ) ; int (*digest)(struct hash_desc * , struct scatterlist * , unsigned int , u8 * ) ; int (*setkey)(struct crypto_hash * , u8 const * , unsigned int ) ; unsigned int digestsize ; }; struct compress_tfm { int (*cot_compress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; int (*cot_decompress)(struct crypto_tfm * , u8 const * , unsigned int , u8 * , unsigned int * ) ; }; struct rng_tfm { int (*rng_gen_random)(struct crypto_rng * , u8 * , unsigned int ) ; int (*rng_reset)(struct crypto_rng * , u8 * , unsigned int ) ; }; union __anonunion_crt_u_131 { struct ablkcipher_tfm ablkcipher ; struct aead_tfm aead ; struct blkcipher_tfm blkcipher ; struct cipher_tfm cipher ; struct hash_tfm hash ; struct compress_tfm compress ; struct rng_tfm rng ; }; struct crypto_tfm { u32 crt_flags ; union __anonunion_crt_u_131 crt_u ; void (*exit)(struct crypto_tfm * ) ; struct crypto_alg *__crt_alg ; void *__crt_ctx[] ; }; struct crypto_ablkcipher { struct crypto_tfm base ; }; struct crypto_aead { struct crypto_tfm base ; }; struct crypto_blkcipher { struct crypto_tfm base ; }; struct crypto_comp { struct crypto_tfm base ; }; struct crypto_hash { struct crypto_tfm base ; }; struct crypto_rng { struct crypto_tfm base ; }; typedef __u16 uint16_t; enum hrtimer_restart; union __anonunion_ldv_28033_179 { struct ubifs_nnode nnode ; struct ubifs_pnode pnode ; struct ubifs_cnode cnode ; }; union __anonunion_ptr_180 { struct ubifs_nnode *nnode ; struct ubifs_pnode *pnode ; struct ubifs_cnode *cnode ; }; struct lpt_scan_node { union __anonunion_ldv_28033_179 ldv_28033 ; int in_tree ; union __anonunion_ptr_180 ptr ; }; enum hrtimer_restart; enum hrtimer_restart; struct size_entry { struct rb_node rb ; ino_t inum ; loff_t i_size ; loff_t d_size ; int exists ; struct inode *inode ; }; enum hrtimer_restart; typedef s32 compat_long_t; typedef u32 compat_uptr_t; struct compat_robust_list { compat_uptr_t next ; }; struct compat_robust_list_head { struct compat_robust_list list ; compat_long_t futex_offset ; compat_uptr_t list_op_pending ; }; enum hrtimer_restart; enum hrtimer_restart; enum hrtimer_restart; struct xattr_handler { char const *prefix ; int flags ; size_t (*list)(struct dentry * , char * , size_t , char const * , size_t , int ) ; int (*get)(struct dentry * , char const * , void * , size_t , int ) ; int (*set)(struct dentry * , char const * , void const * , size_t , int , int ) ; }; union __anonunion_ldv_27664_179 { kuid_t e_uid ; kgid_t e_gid ; unsigned int e_id ; }; struct posix_acl_entry { short e_tag ; unsigned short e_perm ; union __anonunion_ldv_27664_179 ldv_27664 ; }; union __anonunion_ldv_27668_180 { atomic_t a_refcount ; struct callback_head a_rcu ; }; struct posix_acl { union __anonunion_ldv_27668_180 ldv_27668 ; unsigned int a_count ; struct posix_acl_entry a_entries[0U] ; }; enum hrtimer_restart; struct fsck_inode { struct rb_node rb ; ino_t inum ; umode_t mode ; unsigned int nlink ; unsigned int xattr_cnt ; int references ; int calc_cnt ; long long size ; unsigned int xattr_sz ; long long calc_sz ; long long calc_xcnt ; long long calc_xsz ; unsigned int xattr_nms ; long long calc_xnms ; }; struct fsck_data { struct rb_root inodes ; }; long ldv__builtin_expect(long exp , long c ) ; __inline static int constant_test_bit(unsigned int nr , unsigned long const volatile *addr ) { { return ((int )((unsigned long )*(addr + (unsigned long )(nr / 64U)) >> ((int )nr & 63)) & 1); } } extern int printk(char const * , ...) ; extern void dump_stack(void) ; extern int __dynamic_pr_debug(struct _ddebug * , char const * , ...) ; extern void __might_sleep(char const * , int , int ) ; extern void __list_add(struct list_head * , struct list_head * , struct list_head * ) ; __inline static void list_add_tail(struct list_head *new , struct list_head *head ) { { __list_add(new, head->prev, head); return; } } extern void __list_del_entry(struct list_head * ) ; __inline static void list_move_tail(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add_tail(list, head); return; } } extern void __bad_percpu_size(void) ; extern struct task_struct *current_task ; __inline static struct task_struct *get_current(void) { struct task_struct *pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& current_task)); goto ldv_2861; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2861; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2861; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& current_task)); goto ldv_2861; default: __bad_percpu_size(); } ldv_2861: ; return (pfo_ret__); } } __inline static int atomic_read(atomic_t const *v ) { { return ((int )*((int volatile *)(& v->counter))); } } __inline static long atomic64_read(atomic64_t const *v ) { { return ((long )*((long volatile *)(& v->counter))); } } __inline static void atomic64_sub(long i , atomic64_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; subq %1,%0": "=m" (v->counter): "er" (i), "m" (v->counter)); return; } } __inline static long atomic_long_read(atomic_long_t *l ) { atomic64_t *v ; long tmp ; { v = l; tmp = atomic64_read((atomic64_t const *)v); return (tmp); } } __inline static void atomic_long_sub(long i , atomic_long_t *l ) { atomic64_t *v ; { v = l; atomic64_sub(i, v); return; } } __inline static int mutex_is_locked(struct mutex *lock ) { int tmp ; { tmp = atomic_read((atomic_t const *)(& lock->count)); return (tmp != 1); } } extern void mutex_lock_nested(struct mutex * , unsigned int ) ; void ldv_mutex_lock_nested_5(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; extern int mutex_trylock(struct mutex * ) ; int ldv_mutex_trylock_9(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_trylock_10(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_trylock_14(struct mutex *ldv_func_arg1 ) ; extern void mutex_unlock(struct mutex * ) ; void ldv_mutex_unlock_2(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_4(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_6(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_8(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_11(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_12(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_13(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_15(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_16(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_17(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_18(struct mutex *ldv_func_arg1 ) ; extern void mutex_lock(struct mutex * ) ; void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_3(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_7(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_cred_guard_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_cred_guard_mutex(struct mutex *lock ) ; void ldv_mutex_lock_io_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_io_mutex(struct mutex *lock ) ; void ldv_mutex_lock_lock(struct mutex *lock ) ; void ldv_mutex_unlock_lock(struct mutex *lock ) ; void ldv_mutex_lock_lp_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_lp_mutex(struct mutex *lock ) ; int ldv_mutex_trylock_tnc_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_tnc_mutex(struct mutex *lock ) ; int ldv_mutex_trylock_umount_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_umount_mutex(struct mutex *lock ) ; extern void _raw_spin_lock(raw_spinlock_t * ) ; extern void _raw_spin_unlock(raw_spinlock_t * ) ; __inline static void spin_lock(spinlock_t *lock ) { { _raw_spin_lock(& lock->ldv_5961.rlock); return; } } __inline static void spin_unlock(spinlock_t *lock ) { { _raw_spin_unlock(& lock->ldv_5961.rlock); return; } } extern unsigned long get_seconds(void) ; extern int _cond_resched(void) ; struct list_head ubifs_infos ; spinlock_t ubifs_infos_lock ; atomic_long_t ubifs_clean_zn_cnt ; struct ubifs_znode *ubifs_tnc_levelorder_next(struct ubifs_znode *zr , struct ubifs_znode *znode ) ; long ubifs_destroy_tnc_subtree(struct ubifs_znode *znode ) ; int ubifs_shrinker(struct shrinker *shrink , struct shrink_control *sc ) ; void ubifs_request_bg_commit(struct ubifs_info *c ) ; __inline static int ubifs_zn_dirty(struct ubifs_znode const *znode ) { int tmp ; { tmp = constant_test_bit(0U, (unsigned long const volatile *)(& znode->flags)); return (tmp != 0); } } struct list_head ubifs_infos = {& ubifs_infos, & ubifs_infos}; static unsigned int shrinker_run_no ; spinlock_t ubifs_infos_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "ubifs_infos_lock", 0, 0UL}}}}; static int shrink_tnc(struct ubifs_info *c , int nr , int age , int *contention ) { int total_freed ; struct ubifs_znode *znode ; struct ubifs_znode *zprev ; int time ; unsigned long tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; int freed ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; long tmp___10 ; int tmp___11 ; long ret ; long __x ; long tmp___12 ; long tmp___13 ; { total_freed = 0; tmp = get_seconds(); time = (int )tmp; tmp___1 = mutex_is_locked(& c->umount_mutex); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "shrink_tnc", 195, tmp___0->pid); dump_stack(); } else { } tmp___4 = mutex_is_locked(& c->tnc_mutex); tmp___5 = ldv__builtin_expect(tmp___4 == 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "shrink_tnc", 196, tmp___3->pid); dump_stack(); } else { } if ((unsigned long )c->zroot.ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { tmp___6 = atomic_long_read(& c->clean_zn_cnt); if (tmp___6 == 0L) { return (0); } else { } } zprev = 0; znode = ubifs_tnc_levelorder_next(c->zroot.ldv_26076.znode, 0); goto ldv_27550; ldv_27549: ; if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { *contention = 1; } else { tmp___11 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___11 == 0) { __x = (long )((unsigned long )time - znode->time); ret = __x < 0L ? - __x : __x; if (ret >= (long )age) { if ((unsigned long )znode->parent != (unsigned long )((struct ubifs_znode *)0)) { (znode->parent)->zbranch[znode->iip].ldv_26076.znode = 0; } else { c->zroot.ldv_26076.znode = 0; } tmp___7 = ubifs_destroy_tnc_subtree(znode); freed = (int )tmp___7; atomic_long_sub((long )freed, & ubifs_clean_zn_cnt); atomic_long_sub((long )freed, & c->clean_zn_cnt); tmp___9 = atomic_long_read(& c->clean_zn_cnt); tmp___10 = ldv__builtin_expect(tmp___9 < 0L, 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "shrink_tnc", 250, tmp___8->pid); dump_stack(); } else { } total_freed = total_freed + freed; znode = zprev; } else { } } else { } } tmp___12 = ldv__builtin_expect((unsigned long )c->zroot.ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___12 != 0L) { goto ldv_27547; } else { } zprev = znode; znode = ubifs_tnc_levelorder_next(c->zroot.ldv_26076.znode, znode); __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/shrinker.c.prepared", 260, 0); _cond_resched(); ldv_27550: ; if ((unsigned long )znode != (unsigned long )((struct ubifs_znode *)0) && total_freed < nr) { tmp___13 = atomic_long_read(& c->clean_zn_cnt); if (tmp___13 > 0L) { goto ldv_27549; } else { goto ldv_27547; } } else { } ldv_27547: ; return (total_freed); } } static int shrink_tnc_trees(int nr , int age , int *contention ) { struct ubifs_info *c ; struct list_head *p ; unsigned int run_no ; int freed ; struct list_head const *__mptr ; int tmp ; int tmp___0 ; int tmp___1 ; { freed = 0; spin_lock(& ubifs_infos_lock); ldv_27560: shrinker_run_no = shrinker_run_no + 1U; run_no = shrinker_run_no; if (run_no == 0U) { goto ldv_27560; } else { } p = ubifs_infos.next; goto ldv_27565; ldv_27566: __mptr = (struct list_head const *)p; c = (struct ubifs_info *)__mptr + 0xffffffffffffed28UL; if (c->shrinker_run_no == run_no) { goto ldv_27564; } else { } tmp = ldv_mutex_trylock_9(& c->umount_mutex); if (tmp == 0) { *contention = 1; p = p->next; goto ldv_27565; } else { } tmp___0 = ldv_mutex_trylock_10(& c->tnc_mutex); if (tmp___0 == 0) { ldv_mutex_unlock_11(& c->umount_mutex); *contention = 1; p = p->next; goto ldv_27565; } else { } spin_unlock(& ubifs_infos_lock); c->shrinker_run_no = run_no; tmp___1 = shrink_tnc(c, nr, age, contention); freed = tmp___1 + freed; ldv_mutex_unlock_12(& c->tnc_mutex); spin_lock(& ubifs_infos_lock); p = p->next; list_move_tail(& c->infos_list, & ubifs_infos); ldv_mutex_unlock_13(& c->umount_mutex); if (freed >= nr) { goto ldv_27564; } else { } ldv_27565: ; if ((unsigned long )p != (unsigned long )(& ubifs_infos)) { goto ldv_27566; } else { } ldv_27564: spin_unlock(& ubifs_infos_lock); return (freed); } } static int kick_a_thread(void) { int i ; struct ubifs_info *c ; struct list_head const *__mptr ; long dirty_zn_cnt ; int tmp ; struct list_head const *__mptr___0 ; { spin_lock(& ubifs_infos_lock); i = 0; goto ldv_27582; ldv_27581: __mptr = (struct list_head const *)ubifs_infos.next; c = (struct ubifs_info *)__mptr + 0xffffffffffffed28UL; goto ldv_27579; ldv_27578: tmp = ldv_mutex_trylock_14(& c->umount_mutex); if (tmp == 0) { spin_unlock(& ubifs_infos_lock); return (-1); } else { } dirty_zn_cnt = atomic_long_read(& c->dirty_zn_cnt); if (((dirty_zn_cnt == 0L || c->cmt_state == 5) || (unsigned int )*((unsigned char *)c + 4080UL) != 0U) || (unsigned int )*((unsigned char *)c + 4080UL) != 0U) { ldv_mutex_unlock_15(& c->umount_mutex); goto ldv_27577; } else { } if (c->cmt_state != 0) { spin_unlock(& ubifs_infos_lock); ldv_mutex_unlock_16(& c->umount_mutex); return (-1); } else { } if (i == 1) { list_move_tail(& c->infos_list, & ubifs_infos); spin_unlock(& ubifs_infos_lock); ubifs_request_bg_commit(c); ldv_mutex_unlock_17(& c->umount_mutex); return (-1); } else { } ldv_mutex_unlock_18(& c->umount_mutex); ldv_27577: __mptr___0 = (struct list_head const *)c->infos_list.next; c = (struct ubifs_info *)__mptr___0 + 0xffffffffffffed28UL; ldv_27579: ; if ((unsigned long )(& c->infos_list) != (unsigned long )(& ubifs_infos)) { goto ldv_27578; } else { } i = i + 1; ldv_27582: ; if (i <= 1) { goto ldv_27581; } else { } spin_unlock(& ubifs_infos_lock); return (0); } } int ubifs_shrinker(struct shrinker *shrink , struct shrink_control *sc ) { int nr ; int freed ; int contention ; long clean_zn_cnt ; long tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___6 ; long tmp___7 ; int tmp___8 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___9 ; long tmp___10 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___11 ; long tmp___12 ; { nr = (int )sc->nr_to_scan; contention = 0; tmp = atomic_long_read(& ubifs_clean_zn_cnt); clean_zn_cnt = tmp; if (nr == 0) { return (clean_zn_cnt >= 0L ? (int )clean_zn_cnt : 1); } else { } if (clean_zn_cnt == 0L) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_shrinker"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/shrinker.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): no clean znodes, kick a thread\n"; descriptor.lineno = 420U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): no clean znodes, kick a thread\n", tmp___0->pid); } else { } tmp___2 = kick_a_thread(); return (tmp___2); } else { } freed = shrink_tnc_trees(nr, 20, & contention); if (freed >= nr) { goto out; } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_shrinker"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/shrinker.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): not enough old znodes, try to free young ones\n"; descriptor___0.lineno = 428U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): not enough old znodes, try to free young ones\n", tmp___3->pid); } else { } tmp___5 = shrink_tnc_trees(nr - freed, 5, & contention); freed = tmp___5 + freed; if (freed >= nr) { goto out; } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_shrinker"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/shrinker.c.prepared"; descriptor___1.format = "UBIFS DBG tnc (pid %d): not enough young znodes, free all\n"; descriptor___1.lineno = 433U; descriptor___1.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG tnc (pid %d): not enough young znodes, free all\n", tmp___6->pid); } else { } tmp___8 = shrink_tnc_trees(nr - freed, 0, & contention); freed = tmp___8 + freed; if (freed == 0 && contention != 0) { descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_shrinker"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/shrinker.c.prepared"; descriptor___2.format = "UBIFS DBG tnc (pid %d): freed nothing, but contention\n"; descriptor___2.lineno = 437U; descriptor___2.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG tnc (pid %d): freed nothing, but contention\n", tmp___9->pid); } else { } return (-1); } else { } out: descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_shrinker"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/shrinker.c.prepared"; descriptor___3.format = "UBIFS DBG tnc (pid %d): %d znodes were freed, requested %d\n"; descriptor___3.lineno = 442U; descriptor___3.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG tnc (pid %d): %d znodes were freed, requested %d\n", tmp___11->pid, freed, nr); } else { } return (freed); } } void ldv_mutex_lock_1(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_2(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_3(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_4(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_5(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_6(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_7(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_8(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_9(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_umount_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } int ldv_mutex_trylock_10(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___8 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_tnc_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_11(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_12(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_13(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_14(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___12 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_umount_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_15(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_16(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_17(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_18(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void *memset(void * , int , size_t ) ; void ldv_mutex_lock_nested_41(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_45(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_47(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_38(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_40(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_42(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_44(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_46(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_48(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_49(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_50(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_52(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_53(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_37(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_39(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_43(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_51(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_write_reserve_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_write_reserve_mutex(struct mutex *lock ) ; extern struct user_namespace init_user_ns ; __inline static uid_t __kuid_val(kuid_t uid ) { { return (uid); } } __inline static gid_t __kgid_val(kgid_t gid ) { { return (gid); } } __inline static uid_t from_kuid(struct user_namespace *to , kuid_t kuid ) { uid_t tmp ; { tmp = __kuid_val(kuid); return (tmp); } } __inline static gid_t from_kgid(struct user_namespace *to , kgid_t kgid ) { gid_t tmp ; { tmp = __kgid_val(kgid); return (tmp); } } extern void down_read(struct rw_semaphore * ) ; extern void down_write(struct rw_semaphore * ) ; extern void up_read(struct rw_semaphore * ) ; extern void up_write(struct rw_semaphore * ) ; __inline static uid_t i_uid_read(struct inode const *inode ) { uid_t tmp ; { tmp = from_kuid(& init_user_ns, inode->i_uid); return (tmp); } } __inline static gid_t i_gid_read(struct inode const *inode ) { gid_t tmp ; { tmp = from_kgid(& init_user_ns, inode->i_gid); return (tmp); } } extern void kfree(void const * ) ; extern int __VERIFIER_nondet_int(void); extern void abort(void); void assume_abort_if_not(int cond) { if(!cond) {abort();} } extern void *malloc(size_t size); long ldv_is_err(const void *ptr) { return ((unsigned long)ptr > ((unsigned long)-4095)); } void *ldv_malloc(size_t size) { if (__VERIFIER_nondet_int()) { void *res = malloc(size); assume_abort_if_not(!ldv_is_err(res)); return res; } else { return ((void *)0); } } void *__kmalloc(size_t size, gfp_t t) { return ldv_malloc(size); } void *ldv_malloc(size_t size ) ; __inline static void *kmalloc(size_t size , gfp_t flags ) { void *tmp___2 ; { tmp___2 = __kmalloc(size, flags); return (tmp___2); } } void ubifs_ro_mode(struct ubifs_info *c , int err ) ; int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf , void *buf , int len ) ; int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf , int lnum , int offs ) ; void ubifs_prepare_node(struct ubifs_info *c , void *node , int len , int pad ) ; void ubifs_prep_grp_node(struct ubifs_info *c , void *node , int len , int last ) ; int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf ) ; void ubifs_wbuf_add_ino_nolock(struct ubifs_wbuf *wbuf , ino_t inum ) ; int ubifs_add_bud_to_log(struct ubifs_info *c , int jhead , int lnum , int offs ) ; int ubifs_jnl_update(struct ubifs_info *c , struct inode const *dir , struct qstr const *nm , struct inode const *inode , int deletion , int xent ) ; int ubifs_jnl_write_data(struct ubifs_info *c , struct inode const *inode , union ubifs_key const *key , void const *buf , int len ) ; int ubifs_jnl_write_inode(struct ubifs_info *c , struct inode const *inode ) ; int ubifs_jnl_delete_inode(struct ubifs_info *c , struct inode const *inode ) ; int ubifs_jnl_rename(struct ubifs_info *c , struct inode const *old_dir , struct dentry const *old_dentry , struct inode const *new_dir , struct dentry const *new_dentry , int sync ) ; int ubifs_jnl_truncate(struct ubifs_info *c , struct inode const *inode , loff_t old_size , loff_t new_size ) ; int ubifs_jnl_delete_xattr(struct ubifs_info *c , struct inode const *host , struct inode const *inode , struct qstr const *nm ) ; int ubifs_jnl_change_xattr(struct ubifs_info *c , struct inode const *inode , struct inode const *host ) ; void ubifs_release_dirty_inode_budget(struct ubifs_info *c , struct ubifs_inode *ui ) ; int ubifs_find_free_space(struct ubifs_info *c , int min_space , int *offs , int squeeze ) ; int ubifs_tnc_locate(struct ubifs_info *c , union ubifs_key const *key , void *node , int *lnum , int *offs ) ; int ubifs_tnc_add(struct ubifs_info *c , union ubifs_key const *key , int lnum , int offs , int len ) ; int ubifs_tnc_add_nm(struct ubifs_info *c , union ubifs_key const *key , int lnum , int offs , int len , struct qstr const *nm ) ; int ubifs_tnc_remove_nm(struct ubifs_info *c , union ubifs_key const *key , struct qstr const *nm ) ; int ubifs_tnc_remove_range(struct ubifs_info *c , union ubifs_key *from_key , union ubifs_key *to_key ) ; int ubifs_tnc_remove_ino(struct ubifs_info *c , ino_t inum ) ; int ubifs_run_commit(struct ubifs_info *c ) ; int ubifs_garbage_collect(struct ubifs_info *c , int anyway ) ; int ubifs_add_orphan(struct ubifs_info *c , ino_t inum ) ; void ubifs_delete_orphan(struct ubifs_info *c , ino_t inum ) ; int ubifs_change_one_lp(struct ubifs_info *c , int lnum , int free , int dirty , int flags_set , int flags_clean , int idx_gc_cnt ) ; int ubifs_update_one_lp(struct ubifs_info *c , int lnum , int free , int dirty , int flags_set , int flags_clean ) ; void ubifs_compress(void const *in_buf , int in_len , void *out_buf , int *out_len , int *compr_type ) ; int ubifs_decompress(void const *in_buf , int in_len , void *out_buf , int *out_len , int compr_type ) ; char const *dbg_jhead(int jhead ) ; char const *dbg_snprintf_key(struct ubifs_info const *c , union ubifs_key const *key , char *buffer , int len ) ; void ubifs_dump_budg(struct ubifs_info *c , struct ubifs_budg_info const *bi ) ; void ubifs_dump_lprops(struct ubifs_info *c ) ; int dbg_check_lprops(struct ubifs_info *c ) ; __inline static struct ubifs_inode *ubifs_inode(struct inode const *inode ) { struct inode const *__mptr ; { __mptr = inode; return ((struct ubifs_inode *)__mptr); } } __inline static int ubifs_add_dirt(struct ubifs_info *c , int lnum , int dirty ) { int tmp ; { tmp = ubifs_update_one_lp(c, lnum, -2147483647, dirty, 0, 0); return (tmp); } } __inline static int ubifs_return_leb(struct ubifs_info *c , int lnum ) { int tmp ; { tmp = ubifs_change_one_lp(c, lnum, -2147483647, -2147483647, 0, 16, 0); return (tmp); } } __inline static int ubifs_tnc_lookup(struct ubifs_info *c , union ubifs_key const *key , void *node ) { int tmp ; { tmp = ubifs_tnc_locate(c, key, node, 0, 0); return (tmp); } } __inline static void ino_key_init(struct ubifs_info const *c , union ubifs_key *key , ino_t inum ) { { key->u32[0] = (uint32_t )inum; key->u32[1] = 0U; return; } } __inline static void ino_key_init_flash(struct ubifs_info const *c , void *k , ino_t inum ) { union ubifs_key *key ; { key = (union ubifs_key *)k; key->j32[0] = (unsigned int )inum; key->j32[1] = 0U; memset(k + 8UL, 0, 8UL); return; } } __inline static void highest_ino_key(struct ubifs_info const *c , union ubifs_key *key , ino_t inum ) { { key->u32[0] = (uint32_t )inum; key->u32[1] = 4294967295U; return; } } __inline static void dent_key_init(struct ubifs_info const *c , union ubifs_key *key , ino_t inum , struct qstr const *nm ) { uint32_t hash ; uint32_t tmp ; struct task_struct *tmp___0 ; long tmp___1 ; { tmp = (*(c->key_hash))((char const *)nm->name, (int )nm->ldv_7607.ldv_7605.len); hash = tmp; tmp___1 = ldv__builtin_expect((hash & 3758096384U) != 0U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dent_key_init", 158, tmp___0->pid); dump_stack(); } else { } key->u32[0] = (uint32_t )inum; key->u32[1] = hash | 1073741824U; return; } } __inline static void dent_key_init_flash(struct ubifs_info const *c , void *k , ino_t inum , struct qstr const *nm ) { union ubifs_key *key ; uint32_t hash ; uint32_t tmp ; struct task_struct *tmp___0 ; long tmp___1 ; { key = (union ubifs_key *)k; tmp = (*(c->key_hash))((char const *)nm->name, (int )nm->ldv_7607.ldv_7605.len); hash = tmp; tmp___1 = ldv__builtin_expect((hash & 3758096384U) != 0U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dent_key_init_flash", 193, tmp___0->pid); dump_stack(); } else { } key->j32[0] = (unsigned int )inum; key->j32[1] = hash | 1073741824U; memset(k + 8UL, 0, 8UL); return; } } __inline static void xent_key_init(struct ubifs_info const *c , union ubifs_key *key , ino_t inum , struct qstr const *nm ) { uint32_t hash ; uint32_t tmp ; struct task_struct *tmp___0 ; long tmp___1 ; { tmp = (*(c->key_hash))((char const *)nm->name, (int )nm->ldv_7607.ldv_7605.len); hash = tmp; tmp___1 = ldv__builtin_expect((hash & 3758096384U) != 0U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "xent_key_init", 226, tmp___0->pid); dump_stack(); } else { } key->u32[0] = (uint32_t )inum; key->u32[1] = hash | 1610612736U; return; } } __inline static void data_key_init(struct ubifs_info const *c , union ubifs_key *key , ino_t inum , unsigned int block ) { struct task_struct *tmp ; long tmp___0 ; { tmp___0 = ldv__builtin_expect((block & 3758096384U) != 0U, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "data_key_init", 275, tmp->pid); dump_stack(); } else { } key->u32[0] = (uint32_t )inum; key->u32[1] = block | 536870912U; return; } } __inline static ino_t key_inum(struct ubifs_info const *c , void const *k ) { union ubifs_key const *key ; { key = (union ubifs_key const *)k; return ((ino_t )key->u32[0]); } } __inline static unsigned int key_block(struct ubifs_info const *c , union ubifs_key const *key ) { { return (key->u32[1] & 536870911U); } } __inline static void key_write(struct ubifs_info const *c , union ubifs_key const *from , void *to ) { union ubifs_key *t ; { t = (union ubifs_key *)to; t->j32[0] = from->u32[0]; t->j32[1] = from->u32[1]; memset(to + 8UL, 0, 8UL); return; } } __inline static void zero_ino_node_unused(struct ubifs_ino_node *ino ) { { memset((void *)(& ino->padding1), 0, 4UL); memset((void *)(& ino->padding2), 0, 26UL); return; } } __inline static void zero_dent_node_unused(struct ubifs_dent_node *dent ) { { dent->padding1 = 0U; memset((void *)(& dent->padding2), 0, 4UL); return; } } __inline static void zero_data_node_unused(struct ubifs_data_node *data ) { { memset((void *)(& data->padding), 0, 2UL); return; } } __inline static void zero_trun_node_unused(struct ubifs_trun_node *trun ) { { memset((void *)(& trun->padding), 0, 12UL); return; } } static int reserve_space(struct ubifs_info *c , int jhead , int len ) { int err ; int err1 ; int retries ; int avail ; int lnum ; int offs ; int squeeze ; struct ubifs_wbuf *wbuf ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct _ddebug descriptor ; char const *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; char const *tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___8 ; long tmp___9 ; int tmp___10 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___11 ; long tmp___12 ; struct _ddebug descriptor___3 ; char const *tmp___13 ; struct task_struct *tmp___14 ; long tmp___15 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___16 ; long tmp___17 ; struct task_struct *tmp___18 ; long tmp___19 ; { err = 0; retries = 0; wbuf = & (c->jheads + (unsigned long )jhead)->wbuf; tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "reserve_space", 244, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "reserve_space", 244, tmp->pid); dump_stack(); } else { } } squeeze = jhead == 1; again: ldv_mutex_lock_nested_45(& wbuf->io_mutex, (unsigned int )wbuf->jhead); if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { err = -30; goto out_unlock; } else { } avail = (c->leb_size - wbuf->offs) - wbuf->used; if (wbuf->lnum != -1 && avail >= len) { return (0); } else { } lnum = ubifs_find_free_space(c, len, & offs, squeeze); if (lnum >= 0) { goto out; } else { } err = lnum; if (err != -28) { goto out_unlock; } else { } descriptor.modname = "ubifs"; descriptor.function = "reserve_space"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): no free space in jhead %s, run GC\n"; descriptor.lineno = 275U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___2 = dbg_jhead(jhead); tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): no free space in jhead %s, run GC\n", tmp___3->pid, tmp___2); } else { } ldv_mutex_unlock_46(& wbuf->io_mutex); lnum = ubifs_garbage_collect(c, 0); if (lnum < 0) { err = lnum; if (err != -28) { return (err); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "reserve_space"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___0.format = "UBIFS DBG jnl (pid %d): GC couldn\'t make a free LEB for jhead %s\n"; descriptor___0.lineno = 291U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___5 = dbg_jhead(jhead); tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG jnl (pid %d): GC couldn\'t make a free LEB for jhead %s\n", tmp___6->pid, tmp___5); } else { } tmp___10 = retries; retries = retries + 1; if (tmp___10 <= 1) { descriptor___1.modname = "ubifs"; descriptor___1.function = "reserve_space"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___1.format = "UBIFS DBG jnl (pid %d): retry (%d)\n"; descriptor___1.lineno = 293U; descriptor___1.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG jnl (pid %d): retry (%d)\n", tmp___8->pid, retries); } else { } goto again; } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "reserve_space"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___2.format = "UBIFS DBG jnl (pid %d): return -ENOSPC\n"; descriptor___2.lineno = 297U; descriptor___2.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG jnl (pid %d): return -ENOSPC\n", tmp___11->pid); } else { } return (err); } else { } ldv_mutex_lock_nested_47(& wbuf->io_mutex, (unsigned int )wbuf->jhead); descriptor___3.modname = "ubifs"; descriptor___3.function = "reserve_space"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___3.format = "UBIFS DBG jnl (pid %d): got LEB %d for jhead %s\n"; descriptor___3.lineno = 302U; descriptor___3.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___13 = dbg_jhead(jhead); tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG jnl (pid %d): got LEB %d for jhead %s\n", tmp___14->pid, lnum, tmp___13); } else { } avail = (c->leb_size - wbuf->offs) - wbuf->used; if (wbuf->lnum != -1 && avail >= len) { descriptor___4.modname = "ubifs"; descriptor___4.function = "reserve_space"; descriptor___4.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___4.format = "UBIFS DBG jnl (pid %d): return LEB %d back, already have LEB %d:%d\n"; descriptor___4.lineno = 312U; descriptor___4.flags = 0U; tmp___17 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); __dynamic_pr_debug(& descriptor___4, "UBIFS DBG jnl (pid %d): return LEB %d back, already have LEB %d:%d\n", tmp___16->pid, lnum, wbuf->lnum, wbuf->offs + wbuf->used); } else { } err = ubifs_return_leb(c, lnum); if (err != 0) { goto out_unlock; } else { } return (0); } else { } offs = 0; out: err = ubifs_wbuf_sync_nolock(wbuf); if (err != 0) { goto out_return; } else { } err = ubifs_add_bud_to_log(c, jhead, lnum, offs); if (err != 0) { goto out_return; } else { } err = ubifs_wbuf_seek_nolock(wbuf, lnum, offs); if (err != 0) { goto out_unlock; } else { } return (0); out_unlock: ldv_mutex_unlock_48(& wbuf->io_mutex); return (err); out_return: tmp___19 = ldv__builtin_expect(err >= 0, 0L); if (tmp___19 != 0L) { tmp___18 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "reserve_space", 348, tmp___18->pid); dump_stack(); } else { } err1 = ubifs_return_leb(c, lnum); if (err1 != 0 && err == -11) { err = err1; } else { } ldv_mutex_unlock_49(& wbuf->io_mutex); return (err); } } static int write_node(struct ubifs_info *c , int jhead , void *node , int len , int *lnum , int *offs ) { struct ubifs_wbuf *wbuf ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; char const *tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; int tmp___4 ; { wbuf = & (c->jheads + (unsigned long )jhead)->wbuf; tmp___0 = ldv__builtin_expect(jhead == 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_node", 379, tmp->pid); dump_stack(); } else { } *lnum = (c->jheads + (unsigned long )jhead)->wbuf.lnum; *offs = (c->jheads + (unsigned long )jhead)->wbuf.offs + (c->jheads + (unsigned long )jhead)->wbuf.used; descriptor.modname = "ubifs"; descriptor.function = "write_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): jhead %s, LEB %d:%d, len %d\n"; descriptor.lineno = 385U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___1 = dbg_jhead(jhead); tmp___2 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): jhead %s, LEB %d:%d, len %d\n", tmp___2->pid, tmp___1, *lnum, *offs, len); } else { } ubifs_prepare_node(c, node, len, 0); tmp___4 = ubifs_wbuf_write_nolock(wbuf, node, len); return (tmp___4); } } static int write_head(struct ubifs_info *c , int jhead , void *buf , int len , int *lnum , int *offs , int sync ) { int err ; struct ubifs_wbuf *wbuf ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; char const *tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; { wbuf = & (c->jheads + (unsigned long )jhead)->wbuf; tmp___0 = ldv__builtin_expect(jhead == 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_head", 411, tmp->pid); dump_stack(); } else { } *lnum = (c->jheads + (unsigned long )jhead)->wbuf.lnum; *offs = (c->jheads + (unsigned long )jhead)->wbuf.offs + (c->jheads + (unsigned long )jhead)->wbuf.used; descriptor.modname = "ubifs"; descriptor.function = "write_head"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): jhead %s, LEB %d:%d, len %d\n"; descriptor.lineno = 416U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___1 = dbg_jhead(jhead); tmp___2 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): jhead %s, LEB %d:%d, len %d\n", tmp___2->pid, tmp___1, *lnum, *offs, len); } else { } err = ubifs_wbuf_write_nolock(wbuf, buf, len); if (err != 0) { return (err); } else { } if (sync != 0) { err = ubifs_wbuf_sync_nolock(wbuf); } else { } return (err); } } static int make_reservation(struct ubifs_info *c , int jhead , int len ) { int err ; int cmt_retries ; int nospc_retries ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; { cmt_retries = 0; nospc_retries = 0; again: down_read(& c->commit_sem); err = reserve_space(c, jhead, len); if (err == 0) { return (0); } else { } up_read(& c->commit_sem); if (err == -28) { tmp___1 = nospc_retries; nospc_retries = nospc_retries + 1; if (tmp___1 <= 1) { descriptor.modname = "ubifs"; descriptor.function = "make_reservation"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): no space, retry\n"; descriptor.lineno = 461U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): no space, retry\n", tmp->pid); } else { } err = -11; } else { } } else { } if (err != -11) { goto out; } else { } if (cmt_retries > 128) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: stuck in space allocation\n", tmp___2->pid, "make_reservation"); err = -28; goto out; } else if (cmt_retries > 32) { tmp___3 = get_current(); printk("\fUBIFS warning (pid %d): %s: too many space allocation re-tries (%d)\n", tmp___3->pid, "make_reservation", cmt_retries); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "make_reservation"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___0.format = "UBIFS DBG jnl (pid %d): -EAGAIN, commit and retry (retried %d times)\n"; descriptor___0.lineno = 493U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG jnl (pid %d): -EAGAIN, commit and retry (retried %d times)\n", tmp___4->pid, cmt_retries); } else { } cmt_retries = cmt_retries + 1; err = ubifs_run_commit(c); if (err != 0) { return (err); } else { } goto again; out: tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot reserve %d bytes in jhead %d, error %d\n", tmp___6->pid, "make_reservation", len, jhead, err); if (err == -28) { down_write(& c->commit_sem); dump_stack(); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); ubifs_dump_lprops(c); cmt_retries = dbg_check_lprops(c); up_write(& c->commit_sem); } else { } return (err); } } __inline static void release_head(struct ubifs_info *c , int jhead ) { { ldv_mutex_unlock_50(& (c->jheads + (unsigned long )jhead)->wbuf.io_mutex); return; } } static void finish_reservation(struct ubifs_info *c ) { { up_read(& c->commit_sem); return; } } static int get_dent_type(int mode ) { { switch (mode & 61440) { case 32768: ; return (0); case 16384: ; return (1); case 40960: ; return (2); case 24576: ; return (3); case 8192: ; return (4); case 4096: ; return (5); case 49152: ; return (6); default: __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"), "i" (564), "i" (12UL)); ldv_27617: ; goto ldv_27617; } return (0); } } static void pack_inode(struct ubifs_info *c , struct ubifs_ino_node *ino , struct inode const *inode , int last ) { int data_len ; int last_reference ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; size_t __len ; void *__ret ; { data_len = 0; last_reference = (unsigned int )inode->ldv_13285.i_nlink == 0U; tmp = ubifs_inode(inode); ui = tmp; ino->ch.node_type = 0U; ino_key_init_flash((struct ubifs_info const *)c, (void *)(& ino->key), inode->i_ino); ino->creat_sqnum = ui->creat_sqnum; ino->atime_sec = (unsigned long long )inode->i_atime.tv_sec; ino->atime_nsec = (unsigned int )inode->i_atime.tv_nsec; ino->ctime_sec = (unsigned long long )inode->i_ctime.tv_sec; ino->ctime_nsec = (unsigned int )inode->i_ctime.tv_nsec; ino->mtime_sec = (unsigned long long )inode->i_mtime.tv_sec; ino->mtime_nsec = (unsigned int )inode->i_mtime.tv_nsec; ino->uid = i_uid_read(inode); ino->gid = i_gid_read(inode); ino->mode = (unsigned int )inode->i_mode; ino->flags = (unsigned int )ui->flags; ino->size = (unsigned long long )ui->ui_size; ino->nlink = inode->ldv_13285.i_nlink; ino->compr_type = (unsigned short )ui->compr_type; ino->data_len = (unsigned int )ui->data_len; ino->xattr_cnt = ui->xattr_cnt; ino->xattr_size = ui->xattr_size; ino->xattr_names = ui->xattr_names; zero_ino_node_unused(ino); if (last_reference == 0) { __len = (size_t )ui->data_len; __ret = memcpy((void *)(& ino->data), (void const *)ui->data, __len); data_len = ui->data_len; } else { } ubifs_prep_grp_node(c, (void *)ino, (int )((unsigned int )data_len + 160U), last); return; } } static void mark_inode_clean(struct ubifs_info *c , struct ubifs_inode *ui ) { { if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { ubifs_release_dirty_inode_budget(c, ui); } else { } ui->dirty = 0U; return; } } int ubifs_jnl_update(struct ubifs_info *c , struct inode const *dir , struct qstr const *nm , struct inode const *inode , int deletion , int xent ) { int err ; int dlen ; int ilen ; int len ; int lnum ; int ino_offs ; int dent_offs ; int aligned_dlen ; int aligned_ilen ; int sync ; int last_reference ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp___0 ; struct ubifs_dent_node *dent ; struct ubifs_ino_node *ino ; union ubifs_key dent_key ; union ubifs_key ino_key ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; void *tmp___8 ; int tmp___9 ; size_t __len ; void *__ret ; struct ubifs_wbuf *wbuf ; { sync = ((dir->i_sb)->s_flags & 144UL) != 0UL || ((unsigned int )dir->i_flags & 65U) != 0U; last_reference = deletion != 0 && (unsigned int )inode->ldv_13285.i_nlink == 0U; tmp = ubifs_inode(inode); ui = tmp; tmp___0 = ubifs_inode(dir); dir_ui = tmp___0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_update"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): ino %lu, dent \'%.*s\', data len %d in dir ino %lu\n"; descriptor.lineno = 674U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): ino %lu, dent \'%.*s\', data len %d in dir ino %lu\n", tmp___1->pid, inode->i_ino, nm->ldv_7607.ldv_7605.len, nm->name, ui->data_len, dir->i_ino); } else { } tmp___4 = ldv__builtin_expect(dir_ui->data_len != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_update", 675, tmp___3->pid); dump_stack(); } else { } tmp___6 = mutex_is_locked(& dir_ui->ui_mutex); tmp___7 = ldv__builtin_expect(tmp___6 == 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_update", 676, tmp___5->pid); dump_stack(); } else { } dlen = (int )((unsigned int )nm->ldv_7607.ldv_7605.len + 57U); ilen = 160; if (last_reference == 0) { ilen = ui->data_len + ilen; sync = (((inode->i_sb)->s_flags & 16UL) != 0UL || (int )inode->i_flags & 1) | sync; } else { } aligned_dlen = (dlen + 7) & -8; aligned_ilen = (ilen + 7) & -8; len = (int )((unsigned int )(aligned_dlen + aligned_ilen) + 160U); tmp___8 = kmalloc((size_t )len, 80U); dent = (struct ubifs_dent_node *)tmp___8; if ((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } err = make_reservation(c, 1, len); if (err != 0) { goto out_free; } else { } if (xent == 0) { dent->ch.node_type = 2U; dent_key_init((struct ubifs_info const *)c, & dent_key, dir->i_ino, nm); } else { dent->ch.node_type = 3U; xent_key_init((struct ubifs_info const *)c, & dent_key, dir->i_ino, nm); } key_write((struct ubifs_info const *)c, (union ubifs_key const *)(& dent_key), (void *)(& dent->key)); dent->inum = deletion == 0 ? (unsigned long long )inode->i_ino : 0ULL; tmp___9 = get_dent_type((int )inode->i_mode); dent->type = (__u8 )tmp___9; dent->nlen = (unsigned short )nm->ldv_7607.ldv_7605.len; __len = (size_t )nm->ldv_7607.ldv_7605.len; __ret = memcpy((void *)(& dent->name), (void const *)nm->name, __len); dent->name[nm->ldv_7607.ldv_7605.len] = 0U; zero_dent_node_unused(dent); ubifs_prep_grp_node(c, (void *)dent, dlen, 0); ino = (struct ubifs_ino_node *)dent + (unsigned long )aligned_dlen; pack_inode(c, ino, inode, 0); ino = ino + (unsigned long )aligned_ilen; pack_inode(c, ino, dir, 1); if (last_reference != 0) { err = ubifs_add_orphan(c, inode->i_ino); if (err != 0) { release_head(c, 1); goto out_finish; } else { } ui->del_cmtno = c->cmt_no; } else { } err = write_head(c, 1, (void *)dent, len, & lnum, & dent_offs, sync); if (err != 0) { goto out_release; } else { } if (sync == 0) { wbuf = & (c->jheads + 1UL)->wbuf; ubifs_wbuf_add_ino_nolock(wbuf, inode->i_ino); ubifs_wbuf_add_ino_nolock(wbuf, dir->i_ino); } else { } release_head(c, 1); kfree((void const *)dent); if (deletion != 0) { err = ubifs_tnc_remove_nm(c, (union ubifs_key const *)(& dent_key), nm); if (err != 0) { goto out_ro; } else { } err = ubifs_add_dirt(c, lnum, dlen); } else { err = ubifs_tnc_add_nm(c, (union ubifs_key const *)(& dent_key), lnum, dent_offs, dlen, nm); } if (err != 0) { goto out_ro; } else { } ino_key_init((struct ubifs_info const *)c, & ino_key, inode->i_ino); ino_offs = dent_offs + aligned_dlen; err = ubifs_tnc_add(c, (union ubifs_key const *)(& ino_key), lnum, ino_offs, ilen); if (err != 0) { goto out_ro; } else { } ino_key_init((struct ubifs_info const *)c, & ino_key, dir->i_ino); ino_offs = ino_offs + aligned_ilen; err = ubifs_tnc_add(c, (union ubifs_key const *)(& ino_key), lnum, ino_offs, 160); if (err != 0) { goto out_ro; } else { } finish_reservation(c); spin_lock(& ui->ui_lock); ui->synced_i_size = ui->ui_size; spin_unlock(& ui->ui_lock); mark_inode_clean(c, ui); mark_inode_clean(c, dir_ui); return (0); out_finish: finish_reservation(c); out_free: kfree((void const *)dent); return (err); out_release: release_head(c, 1); kfree((void const *)dent); out_ro: ubifs_ro_mode(c, err); if (last_reference != 0) { ubifs_delete_orphan(c, inode->i_ino); } else { } finish_reservation(c); return (err); } } int ubifs_jnl_write_data(struct ubifs_info *c , struct inode const *inode , union ubifs_key const *key , void const *buf , int len ) { struct ubifs_data_node *data ; int err ; int lnum ; int offs ; int compr_type ; int out_len ; int dlen ; int allocated ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___0 ; unsigned int tmp___1 ; ino_t tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; void *tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; ino_t tmp___10 ; { dlen = 8240; allocated = 1; tmp = ubifs_inode(inode); ui = tmp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_write_data"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): ino %lu, blk %u, len %d, key %s\n"; descriptor.lineno = 820U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___0 = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___1 = key_block((struct ubifs_info const *)c, key); tmp___2 = key_inum((struct ubifs_info const *)c, (void const *)key); tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): ino %lu, blk %u, len %d, key %s\n", tmp___3->pid, tmp___2, tmp___1, len, tmp___0); } else { } tmp___6 = ldv__builtin_expect(len > 4096, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_write_data", 821, tmp___5->pid); dump_stack(); } else { } tmp___7 = kmalloc((size_t )dlen, 592U); data = (struct ubifs_data_node *)tmp___7; if ((unsigned long )data == (unsigned long )((struct ubifs_data_node *)0)) { allocated = 0; ldv_mutex_lock_51(& c->write_reserve_mutex); data = (struct ubifs_data_node *)c->write_reserve_buf; } else { } data->ch.node_type = 1U; key_write((struct ubifs_info const *)c, key, (void *)(& data->key)); data->size = (unsigned int )len; zero_data_node_unused(data); if ((ui->flags & 1) == 0) { compr_type = 0; } else { compr_type = (int )ui->compr_type; } out_len = (int )((unsigned int )dlen - 48U); ubifs_compress(buf, len, (void *)(& data->data), & out_len, & compr_type); tmp___9 = ldv__builtin_expect(out_len > 4096, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_write_data", 850, tmp___8->pid); dump_stack(); } else { } dlen = (int )((unsigned int )out_len + 48U); data->compr_type = (unsigned short )compr_type; err = make_reservation(c, 2, dlen); if (err != 0) { goto out_free; } else { } err = write_node(c, 2, (void *)data, dlen, & lnum, & offs); if (err != 0) { goto out_release; } else { } tmp___10 = key_inum((struct ubifs_info const *)c, (void const *)key); ubifs_wbuf_add_ino_nolock(& (c->jheads + 2UL)->wbuf, tmp___10); release_head(c, 2); err = ubifs_tnc_add(c, key, lnum, offs, dlen); if (err != 0) { goto out_ro; } else { } finish_reservation(c); if (allocated == 0) { ldv_mutex_unlock_52(& c->write_reserve_mutex); } else { kfree((void const *)data); } return (0); out_release: release_head(c, 2); out_ro: ubifs_ro_mode(c, err); finish_reservation(c); out_free: ; if (allocated == 0) { ldv_mutex_unlock_53(& c->write_reserve_mutex); } else { kfree((void const *)data); } return (err); } } int ubifs_jnl_write_inode(struct ubifs_info *c , struct inode const *inode ) { int err ; int lnum ; int offs ; struct ubifs_ino_node *ino ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; int sync ; int len ; int last_reference ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; void *tmp___2 ; union ubifs_key key ; { tmp = ubifs_inode(inode); ui = tmp; sync = 0; len = 160; last_reference = (unsigned int )inode->ldv_13285.i_nlink == 0U; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_write_inode"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): ino %lu, nlink %u\n"; descriptor.lineno = 906U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): ino %lu, nlink %u\n", tmp___0->pid, inode->i_ino, inode->ldv_13285.i_nlink); } else { } if (last_reference == 0) { len = ui->data_len + len; sync = ((inode->i_sb)->s_flags & 16UL) != 0UL || (int )inode->i_flags & 1; } else { } tmp___2 = kmalloc((size_t )len, 80U); ino = (struct ubifs_ino_node *)tmp___2; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { return (-12); } else { } err = make_reservation(c, 1, len); if (err != 0) { goto out_free; } else { } pack_inode(c, ino, inode, 1); err = write_head(c, 1, (void *)ino, len, & lnum, & offs, sync); if (err != 0) { goto out_release; } else { } if (sync == 0) { ubifs_wbuf_add_ino_nolock(& (c->jheads + 1UL)->wbuf, inode->i_ino); } else { } release_head(c, 1); if (last_reference != 0) { err = ubifs_tnc_remove_ino(c, inode->i_ino); if (err != 0) { goto out_ro; } else { } ubifs_delete_orphan(c, inode->i_ino); err = ubifs_add_dirt(c, lnum, len); } else { ino_key_init((struct ubifs_info const *)c, & key, inode->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs, len); } if (err != 0) { goto out_ro; } else { } finish_reservation(c); spin_lock(& ui->ui_lock); ui->synced_i_size = ui->ui_size; spin_unlock(& ui->ui_lock); kfree((void const *)ino); return (0); out_release: release_head(c, 1); out_ro: ubifs_ro_mode(c, err); finish_reservation(c); out_free: kfree((void const *)ino); return (err); } } int ubifs_jnl_delete_inode(struct ubifs_info *c , struct inode const *inode ) { int err ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = ubifs_inode(inode); ui = tmp; tmp___1 = ldv__builtin_expect((unsigned int )inode->ldv_13285.i_nlink != 0U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_delete_inode", 1000, tmp___0->pid); dump_stack(); } else { } if (ui->del_cmtno != c->cmt_no) { tmp___2 = ubifs_jnl_write_inode(c, inode); return (tmp___2); } else { } down_read(& c->commit_sem); if (ui->del_cmtno != c->cmt_no) { up_read(& c->commit_sem); tmp___3 = ubifs_jnl_write_inode(c, inode); return (tmp___3); } else { } err = ubifs_tnc_remove_ino(c, inode->i_ino); if (err != 0) { ubifs_ro_mode(c, err); } else { ubifs_delete_orphan(c, inode->i_ino); } up_read(& c->commit_sem); return (err); } } int ubifs_jnl_rename(struct ubifs_info *c , struct inode const *old_dir , struct dentry const *old_dentry , struct inode const *new_dir , struct dentry const *new_dentry , int sync ) { void *p ; union ubifs_key key ; struct ubifs_dent_node *dent ; struct ubifs_dent_node *dent2 ; int err ; int dlen1 ; int dlen2 ; int ilen ; int lnum ; int offs ; int len ; struct inode const *old_inode ; struct inode const *new_inode___0 ; int aligned_dlen1 ; int aligned_dlen2 ; int plen ; int last_reference ; int move ; struct ubifs_inode *new_ui ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; struct ubifs_inode *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; struct ubifs_inode *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; struct ubifs_inode *tmp___8 ; int tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; struct ubifs_inode *tmp___12 ; int tmp___13 ; long tmp___14 ; struct task_struct *tmp___15 ; int tmp___16 ; long tmp___17 ; void *tmp___18 ; int tmp___19 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; struct ubifs_wbuf *wbuf ; struct ubifs_inode *tmp___20 ; struct ubifs_inode *tmp___21 ; { old_inode = (struct inode const *)old_dentry->d_inode; new_inode___0 = (struct inode const *)new_dentry->d_inode; plen = 160; last_reference = (unsigned long )new_inode___0 != (unsigned long )((struct inode const *)0) && (unsigned int )new_inode___0->ldv_13285.i_nlink == 0U; move = (unsigned long )old_dir != (unsigned long )new_dir; new_ui = new_ui; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_rename"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): dent \'%.*s\' in dir ino %lu to dent \'%.*s\' in dir ino %lu\n"; descriptor.lineno = 1058U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): dent \'%.*s\' in dir ino %lu to dent \'%.*s\' in dir ino %lu\n", tmp->pid, old_dentry->d_name.ldv_7607.ldv_7605.len, old_dentry->d_name.name, old_dir->i_ino, new_dentry->d_name.ldv_7607.ldv_7605.len, new_dentry->d_name.name, new_dir->i_ino); } else { } tmp___2 = ubifs_inode(old_dir); tmp___3 = ldv__builtin_expect(tmp___2->data_len != 0, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_rename", 1059, tmp___1->pid); dump_stack(); } else { } tmp___5 = ubifs_inode(new_dir); tmp___6 = ldv__builtin_expect(tmp___5->data_len != 0, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_rename", 1060, tmp___4->pid); dump_stack(); } else { } tmp___8 = ubifs_inode(old_dir); tmp___9 = mutex_is_locked(& tmp___8->ui_mutex); tmp___10 = ldv__builtin_expect(tmp___9 == 0, 0L); if (tmp___10 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_rename", 1061, tmp___7->pid); dump_stack(); } else { } tmp___12 = ubifs_inode(new_dir); tmp___13 = mutex_is_locked(& tmp___12->ui_mutex); tmp___14 = ldv__builtin_expect(tmp___13 == 0, 0L); if (tmp___14 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_rename", 1062, tmp___11->pid); dump_stack(); } else { } dlen1 = (int )((unsigned int )new_dentry->d_name.ldv_7607.ldv_7605.len + 57U); dlen2 = (int )((unsigned int )old_dentry->d_name.ldv_7607.ldv_7605.len + 57U); if ((unsigned long )new_inode___0 != (unsigned long )((struct inode const *)0)) { new_ui = ubifs_inode(new_inode___0); tmp___16 = mutex_is_locked(& new_ui->ui_mutex); tmp___17 = ldv__builtin_expect(tmp___16 == 0, 0L); if (tmp___17 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_rename", 1068, tmp___15->pid); dump_stack(); } else { } ilen = 160; if (last_reference == 0) { ilen = new_ui->data_len + ilen; } else { } } else { ilen = 0; } aligned_dlen1 = (dlen1 + 7) & -8; aligned_dlen2 = (dlen2 + 7) & -8; len = ((aligned_dlen1 + aligned_dlen2) + ((ilen + 7) & -8)) + ((plen + 7) & -8); if ((unsigned long )old_dir != (unsigned long )new_dir) { len = len + plen; } else { } tmp___18 = kmalloc((size_t )len, 80U); dent = (struct ubifs_dent_node *)tmp___18; if ((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } err = make_reservation(c, 1, len); if (err != 0) { goto out_free; } else { } dent->ch.node_type = 2U; dent_key_init_flash((struct ubifs_info const *)c, (void *)(& dent->key), new_dir->i_ino, & new_dentry->d_name); dent->inum = (unsigned long long )old_inode->i_ino; tmp___19 = get_dent_type((int )old_inode->i_mode); dent->type = (__u8 )tmp___19; dent->nlen = (unsigned short )new_dentry->d_name.ldv_7607.ldv_7605.len; __len = (size_t )new_dentry->d_name.ldv_7607.ldv_7605.len; __ret = memcpy((void *)(& dent->name), (void const *)new_dentry->d_name.name, __len); dent->name[new_dentry->d_name.ldv_7607.ldv_7605.len] = 0U; zero_dent_node_unused(dent); ubifs_prep_grp_node(c, (void *)dent, dlen1, 0); dent2 = dent + (unsigned long )aligned_dlen1; dent2->ch.node_type = 2U; dent_key_init_flash((struct ubifs_info const *)c, (void *)(& dent2->key), old_dir->i_ino, & old_dentry->d_name); dent2->inum = 0ULL; dent2->type = 0U; dent2->nlen = (unsigned short )old_dentry->d_name.ldv_7607.ldv_7605.len; __len___0 = (size_t )old_dentry->d_name.ldv_7607.ldv_7605.len; __ret___0 = memcpy((void *)(& dent2->name), (void const *)old_dentry->d_name.name, __len___0); dent2->name[old_dentry->d_name.ldv_7607.ldv_7605.len] = 0U; zero_dent_node_unused(dent2); ubifs_prep_grp_node(c, (void *)dent2, dlen2, 0); p = (void *)dent2 + (unsigned long )aligned_dlen2; if ((unsigned long )new_inode___0 != (unsigned long )((struct inode const *)0)) { pack_inode(c, (struct ubifs_ino_node *)p, new_inode___0, 0); p = p + (unsigned long )((ilen + 7) & -8); } else { } if (move == 0) { pack_inode(c, (struct ubifs_ino_node *)p, old_dir, 1); } else { pack_inode(c, (struct ubifs_ino_node *)p, old_dir, 0); p = p + (unsigned long )((plen + 7) & -8); pack_inode(c, (struct ubifs_ino_node *)p, new_dir, 1); } if (last_reference != 0) { err = ubifs_add_orphan(c, new_inode___0->i_ino); if (err != 0) { release_head(c, 1); goto out_finish; } else { } new_ui->del_cmtno = c->cmt_no; } else { } err = write_head(c, 1, (void *)dent, len, & lnum, & offs, sync); if (err != 0) { goto out_release; } else { } if (sync == 0) { wbuf = & (c->jheads + 1UL)->wbuf; ubifs_wbuf_add_ino_nolock(wbuf, new_dir->i_ino); ubifs_wbuf_add_ino_nolock(wbuf, old_dir->i_ino); if ((unsigned long )new_inode___0 != (unsigned long )((struct inode const *)0)) { ubifs_wbuf_add_ino_nolock(& (c->jheads + 1UL)->wbuf, new_inode___0->i_ino); } else { } } else { } release_head(c, 1); dent_key_init((struct ubifs_info const *)c, & key, new_dir->i_ino, & new_dentry->d_name); err = ubifs_tnc_add_nm(c, (union ubifs_key const *)(& key), lnum, offs, dlen1, & new_dentry->d_name); if (err != 0) { goto out_ro; } else { } err = ubifs_add_dirt(c, lnum, dlen2); if (err != 0) { goto out_ro; } else { } dent_key_init((struct ubifs_info const *)c, & key, old_dir->i_ino, & old_dentry->d_name); err = ubifs_tnc_remove_nm(c, (union ubifs_key const *)(& key), & old_dentry->d_name); if (err != 0) { goto out_ro; } else { } offs = (aligned_dlen1 + aligned_dlen2) + offs; if ((unsigned long )new_inode___0 != (unsigned long )((struct inode const *)0)) { ino_key_init((struct ubifs_info const *)c, & key, new_inode___0->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs, ilen); if (err != 0) { goto out_ro; } else { } offs = ((ilen + 7) & -8) + offs; } else { } ino_key_init((struct ubifs_info const *)c, & key, old_dir->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs, plen); if (err != 0) { goto out_ro; } else { } if ((unsigned long )old_dir != (unsigned long )new_dir) { offs = ((plen + 7) & -8) + offs; ino_key_init((struct ubifs_info const *)c, & key, new_dir->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs, plen); if (err != 0) { goto out_ro; } else { } } else { } finish_reservation(c); if ((unsigned long )new_inode___0 != (unsigned long )((struct inode const *)0)) { mark_inode_clean(c, new_ui); spin_lock(& new_ui->ui_lock); new_ui->synced_i_size = new_ui->ui_size; spin_unlock(& new_ui->ui_lock); } else { } tmp___20 = ubifs_inode(old_dir); mark_inode_clean(c, tmp___20); if (move != 0) { tmp___21 = ubifs_inode(new_dir); mark_inode_clean(c, tmp___21); } else { } kfree((void const *)dent); return (0); out_release: release_head(c, 1); out_ro: ubifs_ro_mode(c, err); if (last_reference != 0) { ubifs_delete_orphan(c, new_inode___0->i_ino); } else { } out_finish: finish_reservation(c); out_free: kfree((void const *)dent); return (err); } } static int recomp_data_node(struct ubifs_data_node *dn , int *new_len ) { void *buf ; int err ; int len ; int compr_type ; int out_len ; struct task_struct *tmp ; long tmp___0 ; { out_len = (int )dn->size; buf = kmalloc((size_t )(out_len * 2), 80U); if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } len = (int )(dn->ch.len - 48U); compr_type = (int )dn->compr_type; err = ubifs_decompress((void const *)(& dn->data), len, buf, & out_len, compr_type); if (err != 0) { goto out; } else { } ubifs_compress((void const *)buf, *new_len, (void *)(& dn->data), & out_len, & compr_type); tmp___0 = ldv__builtin_expect(out_len > 4096, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "recomp_data_node", 1237, tmp->pid); dump_stack(); } else { } dn->compr_type = (unsigned short )compr_type; dn->size = (unsigned int )*new_len; *new_len = (int )((unsigned int )out_len + 48U); out: kfree((void const *)buf); return (err); } } int ubifs_jnl_truncate(struct ubifs_info *c , struct inode const *inode , loff_t old_size , loff_t new_size ) { union ubifs_key key ; union ubifs_key to_key ; struct ubifs_ino_node *ino ; struct ubifs_trun_node *trun ; struct ubifs_data_node *dn ; int err ; int dlen ; int len ; int lnum ; int offs ; int bit ; int sz ; int sync ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; ino_t inum ; unsigned int blk ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; long tmp___8 ; void *tmp___9 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor___0 ; char const *tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; int compr_type ; { dn = dn; sync = ((inode->i_sb)->s_flags & 16UL) != 0UL || (int )inode->i_flags & 1; tmp = ubifs_inode(inode); ui = tmp; inum = inode->i_ino; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_truncate"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): ino %lu, size %lld -> %lld\n"; descriptor.lineno = 1274U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): ino %lu, size %lld -> %lld\n", tmp___0->pid, inum, old_size, new_size); } else { } tmp___3 = ldv__builtin_expect(ui->data_len != 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_truncate", 1275, tmp___2->pid); dump_stack(); } else { } tmp___5 = ldv__builtin_expect(((int )inode->i_mode & 61440) != 32768, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_truncate", 1276, tmp___4->pid); dump_stack(); } else { } tmp___7 = mutex_is_locked(& ui->ui_mutex); tmp___8 = ldv__builtin_expect(tmp___7 == 0, 0L); if (tmp___8 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_truncate", 1277, tmp___6->pid); dump_stack(); } else { } sz = 8504; tmp___9 = kmalloc((size_t )sz, 80U); ino = (struct ubifs_ino_node *)tmp___9; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { return (-12); } else { } trun = (struct ubifs_trun_node *)ino + 160U; trun->ch.node_type = 4U; trun->inum = (unsigned int )inum; trun->old_size = (unsigned long long )old_size; trun->new_size = (unsigned long long )new_size; zero_trun_node_unused(trun); dlen = (int )new_size & 4095; if (dlen != 0) { dn = (struct ubifs_data_node *)trun + 56U; blk = (unsigned int )(new_size >> 12); data_key_init((struct ubifs_info const *)c, & key, inum, blk); descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_jnl_truncate"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor___0.format = "UBIFS DBG jnl (pid %d): last block key %s\n"; descriptor___0.lineno = 1298U; descriptor___0.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___12 != 0L) { tmp___10 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& key), (char *)(& __tmp_key_buf), 48); tmp___11 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG jnl (pid %d): last block key %s\n", tmp___11->pid, tmp___10); } else { } err = ubifs_tnc_lookup(c, (union ubifs_key const *)(& key), (void *)dn); if (err == -2) { dlen = 0; } else if (err != 0) { goto out_free; } else if (dn->size <= (__le32 )dlen) { dlen = 0; } else { compr_type = (int )dn->compr_type; if (compr_type != 0) { err = recomp_data_node(dn, & dlen); if (err != 0) { goto out_free; } else { } } else { dn->size = (unsigned int )dlen; dlen = (int )((unsigned int )dlen + 48U); } zero_data_node_unused(dn); } } else { } len = 216; if (dlen != 0) { len = len + dlen; } else { } err = make_reservation(c, 1, len); if (err != 0) { goto out_free; } else { } pack_inode(c, ino, inode, 0); ubifs_prep_grp_node(c, (void *)trun, 56, dlen == 0); if (dlen != 0) { ubifs_prep_grp_node(c, (void *)dn, dlen, 1); } else { } err = write_head(c, 1, (void *)ino, len, & lnum, & offs, sync); if (err != 0) { goto out_release; } else { } if (sync == 0) { ubifs_wbuf_add_ino_nolock(& (c->jheads + 1UL)->wbuf, inum); } else { } release_head(c, 1); if (dlen != 0) { sz = (int )((unsigned int )offs + 216U); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, sz, dlen); if (err != 0) { goto out_ro; } else { } } else { } ino_key_init((struct ubifs_info const *)c, & key, inum); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs, 160); if (err != 0) { goto out_ro; } else { } err = ubifs_add_dirt(c, lnum, 56); if (err != 0) { goto out_ro; } else { } bit = (int )new_size & 4095; blk = (unsigned int )(new_size >> 12) + (bit != 0 ? 1U : 0U); data_key_init((struct ubifs_info const *)c, & key, inum, blk); bit = (int )old_size & 4095; blk = (unsigned int )(old_size >> 12) - (unsigned int )(bit == 0); data_key_init((struct ubifs_info const *)c, & to_key, inum, blk); err = ubifs_tnc_remove_range(c, & key, & to_key); if (err != 0) { goto out_ro; } else { } finish_reservation(c); spin_lock(& ui->ui_lock); ui->synced_i_size = ui->ui_size; spin_unlock(& ui->ui_lock); mark_inode_clean(c, ui); kfree((void const *)ino); return (0); out_release: release_head(c, 1); out_ro: ubifs_ro_mode(c, err); finish_reservation(c); out_free: kfree((void const *)ino); return (err); } } int ubifs_jnl_delete_xattr(struct ubifs_info *c , struct inode const *host , struct inode const *inode , struct qstr const *nm ) { int err ; int xlen ; int hlen ; int len ; int lnum ; int xent_offs ; int aligned_xlen ; struct ubifs_dent_node *xent ; struct ubifs_ino_node *ino ; union ubifs_key xent_key ; union ubifs_key key1 ; union ubifs_key key2 ; int sync ; struct ubifs_inode *host_ui ; struct ubifs_inode *tmp ; struct _ddebug descriptor ; struct ubifs_inode *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; void *tmp___8 ; int tmp___9 ; size_t __len ; void *__ret ; { sync = ((host->i_sb)->s_flags & 144UL) != 0UL || ((unsigned int )host->i_flags & 65U) != 0U; tmp = ubifs_inode(host); host_ui = tmp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_delete_xattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): host %lu, xattr ino %lu, name \'%s\', data len %d\n"; descriptor.lineno = 1414U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = ubifs_inode(inode); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): host %lu, xattr ino %lu, name \'%s\', data len %d\n", tmp___1->pid, host->i_ino, inode->i_ino, nm->name, tmp___0->data_len); } else { } tmp___4 = ldv__builtin_expect((unsigned int )inode->ldv_13285.i_nlink != 0U, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_delete_xattr", 1415, tmp___3->pid); dump_stack(); } else { } tmp___6 = mutex_is_locked(& host_ui->ui_mutex); tmp___7 = ldv__builtin_expect(tmp___6 == 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_delete_xattr", 1416, tmp___5->pid); dump_stack(); } else { } xlen = (int )((unsigned int )nm->ldv_7607.ldv_7605.len + 57U); aligned_xlen = (xlen + 7) & -8; hlen = (int )((unsigned int )host_ui->data_len + 160U); len = (int )((((unsigned int )(hlen + 7) & 4294967288U) + (unsigned int )aligned_xlen) + 160U); tmp___8 = kmalloc((size_t )len, 80U); xent = (struct ubifs_dent_node *)tmp___8; if ((unsigned long )xent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } err = make_reservation(c, 1, len); if (err != 0) { kfree((void const *)xent); return (err); } else { } xent->ch.node_type = 3U; xent_key_init((struct ubifs_info const *)c, & xent_key, host->i_ino, nm); key_write((struct ubifs_info const *)c, (union ubifs_key const *)(& xent_key), (void *)(& xent->key)); xent->inum = 0ULL; tmp___9 = get_dent_type((int )inode->i_mode); xent->type = (__u8 )tmp___9; xent->nlen = (unsigned short )nm->ldv_7607.ldv_7605.len; __len = (size_t )nm->ldv_7607.ldv_7605.len; __ret = memcpy((void *)(& xent->name), (void const *)nm->name, __len); xent->name[nm->ldv_7607.ldv_7605.len] = 0U; zero_dent_node_unused(xent); ubifs_prep_grp_node(c, (void *)xent, xlen, 0); ino = (struct ubifs_ino_node *)xent + (unsigned long )aligned_xlen; pack_inode(c, ino, inode, 0); ino = ino + 160U; pack_inode(c, ino, host, 1); err = write_head(c, 1, (void *)xent, len, & lnum, & xent_offs, sync); if (sync == 0 && err == 0) { ubifs_wbuf_add_ino_nolock(& (c->jheads + 1UL)->wbuf, host->i_ino); } else { } release_head(c, 1); kfree((void const *)xent); if (err != 0) { goto out_ro; } else { } err = ubifs_tnc_remove_nm(c, (union ubifs_key const *)(& xent_key), nm); if (err != 0) { goto out_ro; } else { } err = ubifs_add_dirt(c, lnum, xlen); if (err != 0) { goto out_ro; } else { } ino_key_init((struct ubifs_info const *)c, & key1, inode->i_ino); highest_ino_key((struct ubifs_info const *)c, & key2, inode->i_ino); err = ubifs_tnc_remove_range(c, & key1, & key2); if (err != 0) { goto out_ro; } else { } err = ubifs_add_dirt(c, lnum, 160); if (err != 0) { goto out_ro; } else { } ino_key_init((struct ubifs_info const *)c, & key1, host->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key1), lnum, (xent_offs + len) - hlen, hlen); if (err != 0) { goto out_ro; } else { } finish_reservation(c); spin_lock(& host_ui->ui_lock); host_ui->synced_i_size = host_ui->ui_size; spin_unlock(& host_ui->ui_lock); mark_inode_clean(c, host_ui); return (0); out_ro: ubifs_ro_mode(c, err); finish_reservation(c); return (err); } } int ubifs_jnl_change_xattr(struct ubifs_info *c , struct inode const *inode , struct inode const *host ) { int err ; int len1 ; int len2 ; int aligned_len ; int aligned_len1 ; int lnum ; int offs ; struct ubifs_inode *host_ui ; struct ubifs_inode *tmp ; struct ubifs_ino_node *ino ; union ubifs_key key ; int sync ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; long tmp___8 ; struct ubifs_inode *tmp___9 ; void *tmp___10 ; struct ubifs_wbuf *wbuf ; { tmp = ubifs_inode(host); host_ui = tmp; sync = ((host->i_sb)->s_flags & 144UL) != 0UL || ((unsigned int )host->i_flags & 65U) != 0U; descriptor.modname = "ubifs"; descriptor.function = "ubifs_jnl_change_xattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/journal.c.prepared"; descriptor.format = "UBIFS DBG jnl (pid %d): ino %lu, ino %lu\n"; descriptor.lineno = 1524U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG jnl (pid %d): ino %lu, ino %lu\n", tmp___0->pid, host->i_ino, inode->i_ino); } else { } tmp___3 = ldv__builtin_expect((unsigned int )host->ldv_13285.i_nlink == 0U, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_change_xattr", 1525, tmp___2->pid); dump_stack(); } else { } tmp___5 = ldv__builtin_expect((unsigned int )inode->ldv_13285.i_nlink == 0U, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_change_xattr", 1526, tmp___4->pid); dump_stack(); } else { } tmp___7 = mutex_is_locked(& host_ui->ui_mutex); tmp___8 = ldv__builtin_expect(tmp___7 == 0, 0L); if (tmp___8 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_jnl_change_xattr", 1527, tmp___6->pid); dump_stack(); } else { } len1 = (int )((unsigned int )host_ui->data_len + 160U); tmp___9 = ubifs_inode(inode); len2 = (int )((unsigned int )tmp___9->data_len + 160U); aligned_len1 = (len1 + 7) & -8; aligned_len = ((len2 + 7) & -8) + aligned_len1; tmp___10 = kmalloc((size_t )aligned_len, 80U); ino = (struct ubifs_ino_node *)tmp___10; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { return (-12); } else { } err = make_reservation(c, 1, aligned_len); if (err != 0) { goto out_free; } else { } pack_inode(c, ino, host, 0); pack_inode(c, ino + (unsigned long )aligned_len1, inode, 1); err = write_head(c, 1, (void *)ino, aligned_len, & lnum, & offs, 0); if (sync == 0 && err == 0) { wbuf = & (c->jheads + 1UL)->wbuf; ubifs_wbuf_add_ino_nolock(wbuf, host->i_ino); ubifs_wbuf_add_ino_nolock(wbuf, inode->i_ino); } else { } release_head(c, 1); if (err != 0) { goto out_ro; } else { } ino_key_init((struct ubifs_info const *)c, & key, host->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs, len1); if (err != 0) { goto out_ro; } else { } ino_key_init((struct ubifs_info const *)c, & key, inode->i_ino); err = ubifs_tnc_add(c, (union ubifs_key const *)(& key), lnum, offs + aligned_len1, len2); if (err != 0) { goto out_ro; } else { } finish_reservation(c); spin_lock(& host_ui->ui_lock); host_ui->synced_i_size = host_ui->ui_size; spin_unlock(& host_ui->ui_lock); mark_inode_clean(c, host_ui); kfree((void const *)ino); return (0); out_ro: ubifs_ro_mode(c, err); finish_reservation(c); out_free: kfree((void const *)ino); return (err); } } void ldv_mutex_lock_37(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_38(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_39(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_40(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_41(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_42(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_43(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_44(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_45(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_46(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_47(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_48(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_49(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_50(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_51(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_write_reserve_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_52(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_write_reserve_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_53(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_write_reserve_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void set_bit(unsigned int nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void clear_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } __inline static int test_and_set_bit(int nr , unsigned long volatile *addr ) { int oldbit ; { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; bts %2,%1\n\tsbb %0,%0": "=r" (oldbit), "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return (oldbit); } } __inline static int test_and_set_bit_lock(int nr , unsigned long volatile *addr ) { int tmp ; { tmp = test_and_set_bit(nr, addr); return (tmp); } } __inline static void atomic64_inc(atomic64_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; incq %0": "=m" (v->counter): "m" (v->counter)); return; } } __inline static void atomic64_dec(atomic64_t *v ) { { __asm__ volatile (".pushsection .smp_locks,\"a\"\n.balign 4\n.long 671f - .\n.popsection\n671:\n\tlock; decq %0": "=m" (v->counter): "m" (v->counter)); return; } } __inline static void atomic_long_inc(atomic_long_t *l ) { atomic64_t *v ; { v = l; atomic64_inc(v); return; } } __inline static void atomic_long_dec(atomic_long_t *l ) { atomic64_t *v ; { v = l; atomic64_dec(v); return; } } void ldv_mutex_lock_nested_75(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; int ldv_mutex_trylock_85(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_trylock_86(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_72(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_74(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_78(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_82(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_83(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_84(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_87(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_88(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_90(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_92(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_94(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_98(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_71(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_73(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_77(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_79(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_80(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_81(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_91(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_93(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_95(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_97(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_trylock_bu_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_bu_mutex(struct mutex *lock ) ; void ldv_mutex_lock_i_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_i_mutex(struct mutex *lock ) ; void ldv_mutex_lock_ui_mutex(struct mutex *lock ) ; int ldv_mutex_trylock_ui_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_ui_mutex(struct mutex *lock ) ; extern unsigned long kernel_stack ; __inline static struct thread_info *current_thread_info(void) { struct thread_info *ti ; unsigned long pfo_ret__ ; { switch (8UL) { case 1UL: __asm__ ("movb %%gs:%P1,%0": "=q" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6486; case 2UL: __asm__ ("movw %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6486; case 4UL: __asm__ ("movl %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6486; case 8UL: __asm__ ("movq %%gs:%P1,%0": "=r" (pfo_ret__): "p" (& kernel_stack)); goto ldv_6486; default: __bad_percpu_size(); } ldv_6486: ti = (struct thread_info *)(pfo_ret__ - 8152UL); return (ti); } } __inline static int timespec_equal(struct timespec const *a , struct timespec const *b ) { { return ((long )a->tv_sec == (long )b->tv_sec && (long )a->tv_nsec == (long )b->tv_nsec); } } extern struct timespec timespec_trunc(struct timespec , unsigned int ) ; extern bool capable(int ) ; __inline static loff_t i_size_read(struct inode const *inode ) { { return ((loff_t )inode->i_size); } } __inline static void i_size_write(struct inode *inode , loff_t i_size ) { { inode->i_size = i_size; return; } } extern struct timespec current_fs_time(struct super_block * ) ; extern void __mark_inode_dirty(struct inode * , int ) ; __inline static void mark_inode_dirty_sync(struct inode *inode ) { { __mark_inode_dirty(inode, 1); return; } } extern int filemap_write_and_wait_range(struct address_space * , loff_t , loff_t ) ; extern int generic_file_mmap(struct file * , struct vm_area_struct * ) ; extern int generic_file_remap_pages(struct vm_area_struct * , unsigned long , unsigned long , unsigned long ) ; extern ssize_t generic_file_aio_read(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; extern ssize_t generic_file_aio_write(struct kiocb * , struct iovec const * , unsigned long , loff_t ) ; extern ssize_t do_sync_read(struct file * , char * , size_t , loff_t * ) ; extern ssize_t do_sync_write(struct file * , char const * , size_t , loff_t * ) ; extern ssize_t generic_file_splice_read(struct file * , loff_t * , struct pipe_inode_info * , size_t , unsigned int ) ; extern ssize_t generic_file_splice_write(struct pipe_inode_info * , struct file * , loff_t * , size_t , unsigned int ) ; extern loff_t generic_file_llseek(struct file * , loff_t , int ) ; extern int generic_readlink(struct dentry * , char * , int ) ; extern int inode_change_ok(struct inode const * , struct iattr * ) ; extern int in_group_p(kgid_t ) ; __inline static void SetPageError(struct page *page ) { { set_bit(1U, (unsigned long volatile *)(& page->flags)); return; } } __inline static void ClearPageError(struct page *page ) { { clear_bit(1, (unsigned long volatile *)(& page->flags)); return; } } __inline static int PageDirty(struct page const *page ) { int tmp ; { tmp = constant_test_bit(4U, (unsigned long const volatile *)(& page->flags)); return (tmp); } } __inline static int PageChecked(struct page const *page ) { int tmp ; { tmp = constant_test_bit(8U, (unsigned long const volatile *)(& page->flags)); return (tmp); } } __inline static void SetPageChecked(struct page *page ) { { set_bit(8U, (unsigned long volatile *)(& page->flags)); return; } } __inline static void ClearPageChecked(struct page *page ) { { clear_bit(8, (unsigned long volatile *)(& page->flags)); return; } } __inline static int PagePrivate(struct page const *page ) { int tmp ; { tmp = constant_test_bit(11U, (unsigned long const volatile *)(& page->flags)); return (tmp); } } __inline static void SetPagePrivate(struct page *page ) { { set_bit(11U, (unsigned long volatile *)(& page->flags)); return; } } __inline static void ClearPagePrivate(struct page *page ) { { clear_bit(11, (unsigned long volatile *)(& page->flags)); return; } } __inline static int PageWriteback(struct page const *page ) { int tmp ; { tmp = constant_test_bit(13U, (unsigned long const volatile *)(& page->flags)); return (tmp); } } __inline static int PageUptodate(struct page *page ) { int ret ; int tmp ; { tmp = constant_test_bit(3U, (unsigned long const volatile *)(& page->flags)); ret = tmp; if (ret != 0) { __asm__ volatile ("": : : "memory"); } else { } return (ret); } } __inline static void SetPageUptodate(struct page *page ) { { __asm__ volatile ("": : : "memory"); set_bit(3U, (unsigned long volatile *)(& page->flags)); return; } } __inline static void ClearPageUptodate(struct page *page ) { { clear_bit(3, (unsigned long volatile *)(& page->flags)); return; } } extern int test_set_page_writeback(struct page * ) ; __inline static void set_page_writeback(struct page *page ) { { test_set_page_writeback(page); return; } } extern void put_page(struct page * ) ; __inline static void *lowmem_page_address(struct page const *page ) { { return ((void *)((unsigned long )((unsigned long long )(((long )page + 24189255811072L) / 80L) << 12) + 0xffff880000000000UL)); } } extern void truncate_setsize(struct inode * , loff_t ) ; extern int __set_page_dirty_nobuffers(struct page * ) ; extern int clear_page_dirty_for_io(struct page * ) ; extern int filemap_fault(struct vm_area_struct * , struct vm_fault * ) ; __inline static void pagefault_disable(void) { struct thread_info *tmp ; { tmp = current_thread_info(); tmp->preempt_count = tmp->preempt_count + 1; __asm__ volatile ("": : : "memory"); return; } } __inline static void pagefault_enable(void) { struct thread_info *tmp ; { __asm__ volatile ("": : : "memory"); tmp = current_thread_info(); tmp->preempt_count = tmp->preempt_count + -1; __asm__ volatile ("": : : "memory"); return; } } __inline static void *kmap(struct page *page ) { void *tmp ; { __might_sleep("include/linux/highmem.h", 58, 0); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void kunmap(struct page *page ) { { return; } } __inline static void *kmap_atomic(struct page *page ) { void *tmp ; { pagefault_disable(); tmp = lowmem_page_address((struct page const *)page); return (tmp); } } __inline static void __kunmap_atomic(void *addr ) { { pagefault_enable(); return; } } extern struct page *find_lock_page(struct address_space * , unsigned long ) ; extern struct page *find_or_create_page(struct address_space * , unsigned long , gfp_t ) ; extern struct page *grab_cache_page_write_begin(struct address_space * , unsigned long , unsigned int ) ; __inline static loff_t page_offset(struct page *page ) { { return ((long long )page->ldv_15613.ldv_15597.index << 12); } } extern void __lock_page(struct page * ) ; extern void unlock_page(struct page * ) ; __inline static int trylock_page(struct page *page ) { int tmp ; long tmp___0 ; { tmp = test_and_set_bit_lock(0, (unsigned long volatile *)(& page->flags)); tmp___0 = ldv__builtin_expect(tmp == 0, 1L); return ((int )tmp___0); } } __inline static void lock_page(struct page *page ) { int tmp ; { __might_sleep("include/linux/pagemap.h", 350, 0); tmp = trylock_page(page); if (tmp == 0) { __lock_page(page); } else { } return; } } extern void end_page_writeback(struct page * ) ; struct address_space_operations const ubifs_file_address_operations ; struct file_operations const ubifs_file_operations ; struct inode_operations const ubifs_file_inode_operations ; struct inode_operations const ubifs_symlink_inode_operations ; int ubifs_sync_wbufs_by_inode(struct ubifs_info *c , struct inode *inode ) ; int ubifs_budget_space(struct ubifs_info *c , struct ubifs_budget_req *req ) ; void ubifs_release_budget(struct ubifs_info *c , struct ubifs_budget_req *req ) ; void ubifs_convert_page_budget(struct ubifs_info *c ) ; int ubifs_tnc_get_bu_keys(struct ubifs_info *c , struct bu_info *bu ) ; int ubifs_tnc_bulk_read(struct ubifs_info *c , struct bu_info *bu ) ; int ubifs_fsync(struct file *file , loff_t start , loff_t end , int datasync ) ; int ubifs_setattr(struct dentry *dentry , struct iattr *attr ) ; int ubifs_getattr(struct vfsmount *mnt , struct dentry *dentry , struct kstat *stat ) ; int ubifs_setxattr(struct dentry *dentry , char const *name , void const *value , size_t size , int flags ) ; ssize_t ubifs_getxattr(struct dentry *dentry , char const *name , void *buf , size_t size ) ; ssize_t ubifs_listxattr(struct dentry *dentry , char *buffer , size_t size ) ; int ubifs_removexattr(struct dentry *dentry , char const *name ) ; long ubifs_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) ; long ubifs_compat_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) ; void ubifs_dump_node(struct ubifs_info const *c , void const *node ) ; int dbg_check_synced_i_size(struct ubifs_info const *c , struct inode *inode ) ; __inline static struct timespec ubifs_current_time(struct inode *inode ) { struct timespec tmp ; struct timespec __constr_expr_0 ; unsigned long tmp___0 ; struct timespec tmp___1 ; { if ((inode->i_sb)->s_time_gran <= 999999999U) { tmp = current_fs_time(inode->i_sb); tmp___1 = tmp; } else { tmp___0 = get_seconds(); __constr_expr_0.tv_sec = (long )tmp___0; __constr_expr_0.tv_nsec = 0L; tmp___1 = __constr_expr_0; } return (tmp___1); } } __inline static void nd_set_link(struct nameidata *nd , char *path ) { { nd->saved_names[nd->depth] = path; return; } } static int read_block(struct inode *inode , void *addr , unsigned int block , struct ubifs_data_node *dn ) { struct ubifs_info *c ; int err ; int len ; int out_len ; union ubifs_key key ; unsigned int dlen ; struct task_struct *tmp ; struct ubifs_inode *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; { c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; data_key_init((struct ubifs_info const *)c, & key, inode->i_ino, block); err = ubifs_tnc_lookup(c, (union ubifs_key const *)(& key), (void *)dn); if (err != 0) { if (err == -2) { memset(addr, 0, 4096UL); } else { } return (err); } else { } tmp___0 = ubifs_inode((struct inode const *)inode); tmp___1 = ldv__builtin_expect(dn->ch.sqnum <= tmp___0->creat_sqnum, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "read_block", 195, tmp->pid); dump_stack(); } else { } len = (int )dn->size; if (len <= 0 || len > 4096) { goto dump; } else { } dlen = dn->ch.len - 48U; out_len = 4096; err = ubifs_decompress((void const *)(& dn->data), (int )dlen, addr, & out_len, (int )dn->compr_type); if (err != 0 || len != out_len) { goto dump; } else { } if (len <= 4095) { memset(addr + (unsigned long )len, 0, (size_t )(4096 - len)); } else { } return (0); dump: tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: bad data node (block %u, inode %lu)\n", tmp___2->pid, "read_block", block, inode->i_ino); ubifs_dump_node((struct ubifs_info const *)c, (void const *)dn); return (-22); } } static int do_readpage(struct page *page ) { void *addr ; int err ; int i ; unsigned int block ; unsigned int beyond ; struct ubifs_data_node *dn ; struct inode *inode ; loff_t i_size ; loff_t tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; void *tmp___8 ; int ret ; int dlen ; int ilen ; struct _ddebug descriptor___0 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; { err = 0; inode = (page->mapping)->host; tmp = i_size_read((struct inode const *)inode); i_size = tmp; descriptor.modname = "ubifs"; descriptor.function = "do_readpage"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, pg %lu, i_size %lld, flags %#lx\n"; descriptor.lineno = 234U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, pg %lu, i_size %lld, flags %#lx\n", tmp___0->pid, inode->i_ino, page->ldv_15613.ldv_15597.index, i_size, page->flags); } else { } tmp___3 = PageChecked((struct page const *)page); tmp___4 = ldv__builtin_expect(tmp___3 != 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_readpage", 235, tmp___2->pid); dump_stack(); } else { } tmp___6 = PagePrivate((struct page const *)page); tmp___7 = ldv__builtin_expect(tmp___6 != 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_readpage", 236, tmp___5->pid); dump_stack(); } else { } addr = kmap(page); block = (unsigned int )page->ldv_15613.ldv_15597.index; beyond = (unsigned int )((i_size + 4095LL) >> 12); if (block >= beyond) { SetPageChecked(page); memset(addr, 0, 4096UL); goto out; } else { } tmp___8 = kmalloc(4144UL, 80U); dn = (struct ubifs_data_node *)tmp___8; if ((unsigned long )dn == (unsigned long )((struct ubifs_data_node *)0)) { err = -12; goto error; } else { } i = 0; ldv_27727: ; if (block >= beyond) { err = -2; memset(addr, 0, 4096UL); } else { ret = read_block(inode, addr, block, dn); if (ret != 0) { err = ret; if (err != -2) { goto ldv_27724; } else { } } else if (block + 1U == beyond) { dlen = (int )dn->size; ilen = (int )i_size & 4095; if (ilen != 0 && ilen < dlen) { memset(addr + (unsigned long )ilen, 0, (size_t )(dlen - ilen)); } else { } } else { } } i = i + 1; if (i != 0) { goto ldv_27724; } else { } block = block + 1U; addr = addr + 4096UL; goto ldv_27727; ldv_27724: ; if (err != 0) { if (err == -2) { SetPageChecked(page); descriptor___0.modname = "ubifs"; descriptor___0.function = "do_readpage"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): hole\n"; descriptor___0.lineno = 286U; descriptor___0.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): hole\n", tmp___9->pid); } else { } goto out_free; } else { } tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read page %lu of inode %lu, error %d\n", tmp___11->pid, "do_readpage", page->ldv_15613.ldv_15597.index, inode->i_ino, err); goto error; } else { } out_free: kfree((void const *)dn); out: SetPageUptodate(page); ClearPageError(page); kunmap(page); return (0); error: kfree((void const *)dn); ClearPageUptodate(page); SetPageError(page); kunmap(page); return (err); } } static void release_new_page_budget(struct ubifs_info *c ) { struct ubifs_budget_req req ; { req.fast = (unsigned char)0; req.recalculate = 1U; req.new_page = 1U; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = (unsigned char)0; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; ubifs_release_budget(c, & req); return; } } static void release_existing_page_budget(struct ubifs_info *c ) { struct ubifs_budget_req req ; { req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = (unsigned char)0; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = c->bi.page_budget; ubifs_release_budget(c, & req); return; } } static int write_begin_slow(struct address_space *mapping , loff_t pos , unsigned int len , struct page **pagep , unsigned int flags ) { struct inode *inode ; struct ubifs_info *c ; unsigned long index ; struct ubifs_budget_req req ; int err ; int appending ; struct page *page ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; int tmp___3 ; int tmp___4 ; int tmp___5 ; struct ubifs_inode *ui ; struct ubifs_inode *tmp___6 ; { inode = mapping->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; index = (unsigned long )(pos >> 12); req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = 1U; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = (unsigned char)0; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; err = err; appending = (loff_t )len + pos > inode->i_size; descriptor.modname = "ubifs"; descriptor.function = "write_begin_slow"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, pos %llu, len %u, i_size %lld\n"; descriptor.lineno = 352U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, pos %llu, len %u, i_size %lld\n", tmp->pid, inode->i_ino, pos, len, inode->i_size); } else { } if (appending != 0) { req.dirtied_ino = 1U; } else { } err = ubifs_budget_space(c, & req); tmp___1 = ldv__builtin_expect(err != 0, 0L); if (tmp___1 != 0L) { return (err); } else { } page = grab_cache_page_write_begin(mapping, index, flags); tmp___2 = ldv__builtin_expect((unsigned long )page == (unsigned long )((struct page *)0), 0L); if (tmp___2 != 0L) { ubifs_release_budget(c, & req); return (-12); } else { } tmp___3 = PageUptodate(page); if (tmp___3 == 0) { if (((unsigned long long )pos & 4095ULL) == 0ULL && len == 4096U) { SetPageChecked(page); } else { err = do_readpage(page); if (err != 0) { unlock_page(page); put_page(page); return (err); } else { } } SetPageUptodate(page); ClearPageError(page); } else { } tmp___5 = PagePrivate((struct page const *)page); if (tmp___5 != 0) { release_new_page_budget(c); } else { tmp___4 = PageChecked((struct page const *)page); if (tmp___4 == 0) { ubifs_convert_page_budget(c); } else { } } if (appending != 0) { tmp___6 = ubifs_inode((struct inode const *)inode); ui = tmp___6; ldv_mutex_lock_79(& ui->ui_mutex); if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { ubifs_release_dirty_inode_budget(c, ui); } else { } } else { } *pagep = page; return (0); } } static int allocate_budget(struct ubifs_info *c , struct page *page , struct ubifs_inode *ui , int appending ) { struct ubifs_budget_req req ; int tmp ; int tmp___0 ; int tmp___1 ; { req.fast = 1U; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = (unsigned char)0; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; tmp___0 = PagePrivate((struct page const *)page); if (tmp___0 != 0) { if (appending == 0) { return (0); } else { } ldv_mutex_lock_80(& ui->ui_mutex); if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { return (0); } else { } req.dirtied_ino = 1U; } else { tmp = PageChecked((struct page const *)page); if (tmp != 0) { req.new_page = 1U; } else { req.dirtied_page = 1U; } if (appending != 0) { ldv_mutex_lock_81(& ui->ui_mutex); if ((unsigned int )*((unsigned char *)ui + 1060UL) == 0U) { req.dirtied_ino = 1U; } else { } } else { } } tmp___1 = ubifs_budget_space(c, & req); return (tmp___1); } } static int ubifs_write_begin(struct file *file , struct address_space *mapping , loff_t pos , unsigned int len , unsigned int flags , struct page **pagep , void **fsdata ) { struct inode *inode ; struct ubifs_info *c ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; unsigned long index ; int err ; int appending ; int skipped_read ; struct page *page ; struct task_struct *tmp___0 ; struct ubifs_inode *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; int tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; int tmp___12 ; long tmp___13 ; int tmp___14 ; long tmp___15 ; { inode = mapping->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; index = (unsigned long )(pos >> 12); err = err; appending = (loff_t )len + pos > inode->i_size; skipped_read = 0; tmp___1 = ubifs_inode((struct inode const *)inode); tmp___2 = ldv__builtin_expect(tmp___1->ui_size != inode->i_size, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_begin", 555, tmp___0->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_begin", 556, tmp___3->pid); dump_stack(); } else { tmp___5 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_begin", 556, tmp___3->pid); dump_stack(); } else { } } tmp___6 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___6 != 0L) { return (-30); } else { } page = grab_cache_page_write_begin(mapping, index, flags); tmp___7 = ldv__builtin_expect((unsigned long )page == (unsigned long )((struct page *)0), 0L); if (tmp___7 != 0L) { return (-12); } else { } tmp___8 = PageUptodate(page); if (tmp___8 == 0) { if (((unsigned long long )pos & 4095ULL) == 0ULL && len == 4096U) { SetPageChecked(page); skipped_read = 1; } else { err = do_readpage(page); if (err != 0) { unlock_page(page); put_page(page); return (err); } else { } } SetPageUptodate(page); ClearPageError(page); } else { } err = allocate_budget(c, page, ui, appending); tmp___15 = ldv__builtin_expect(err != 0, 0L); if (tmp___15 != 0L) { tmp___10 = ldv__builtin_expect(err != -28, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_begin", 595, tmp___9->pid); dump_stack(); } else { } if (skipped_read != 0) { ClearPageChecked(page); ClearPageUptodate(page); } else { } if (appending != 0) { tmp___12 = mutex_is_locked(& ui->ui_mutex); tmp___13 = ldv__builtin_expect(tmp___12 == 0, 0L); if (tmp___13 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_begin", 612, tmp___11->pid); dump_stack(); } else { } ldv_mutex_unlock_82(& ui->ui_mutex); } else { } unlock_page(page); put_page(page); tmp___14 = write_begin_slow(mapping, pos, len, pagep, flags); return (tmp___14); } else { } *pagep = page; return (0); } } static void cancel_budget(struct ubifs_info *c , struct page *page , struct ubifs_inode *ui , int appending ) { int tmp ; int tmp___0 ; { if (appending != 0) { if ((unsigned int )*((unsigned char *)ui + 1060UL) == 0U) { ubifs_release_dirty_inode_budget(c, ui); } else { } ldv_mutex_unlock_83(& ui->ui_mutex); } else { } tmp___0 = PagePrivate((struct page const *)page); if (tmp___0 == 0) { tmp = PageChecked((struct page const *)page); if (tmp != 0) { release_new_page_budget(c); } else { release_existing_page_budget(c); } } else { } return; } } static int ubifs_write_end(struct file *file , struct address_space *mapping , loff_t pos , unsigned int len , unsigned int copied , struct page *page , void *fsdata ) { struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct ubifs_info *c ; loff_t end_pos ; int appending ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; int tmp___7 ; struct task_struct *tmp___8 ; int tmp___9 ; long tmp___10 ; { inode = mapping->host; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; end_pos = (loff_t )len + pos; appending = inode->i_size < end_pos; descriptor.modname = "ubifs"; descriptor.function = "ubifs_write_end"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, pos %llu, pg %lu, len %u, copied %d, i_size %lld\n"; descriptor.lineno = 669U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, pos %llu, pg %lu, len %u, copied %d, i_size %lld\n", tmp___0->pid, inode->i_ino, pos, page->ldv_15613.ldv_15597.index, len, copied, inode->i_size); } else { } tmp___5 = ldv__builtin_expect(copied < len, 0L); if (tmp___5 != 0L) { tmp___6 = ldv__builtin_expect(len == 4096U, 0L); if (tmp___6 != 0L) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_write_end"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): copied %d instead of %d, read page and repeat\n"; descriptor___0.lineno = 682U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): copied %d instead of %d, read page and repeat\n", tmp___2->pid, copied, len); } else { } cancel_budget(c, page, ui, appending); ClearPageChecked(page); tmp___4 = do_readpage(page); copied = (unsigned int )tmp___4; goto out; } else { } } else { } tmp___7 = PagePrivate((struct page const *)page); if (tmp___7 == 0) { SetPagePrivate(page); atomic_long_inc(& c->dirty_pg_cnt); __set_page_dirty_nobuffers(page); } else { } if (appending != 0) { i_size_write(inode, end_pos); ui->ui_size = end_pos; __mark_inode_dirty(inode, 2); tmp___9 = mutex_is_locked(& ui->ui_mutex); tmp___10 = ldv__builtin_expect(tmp___9 == 0, 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_end", 709, tmp___8->pid); dump_stack(); } else { } ldv_mutex_unlock_84(& ui->ui_mutex); } else { } out: unlock_page(page); put_page(page); return ((int )copied); } } static int populate_page(struct ubifs_info *c , struct page *page , struct bu_info *bu , int *n ) { int i ; int nn ; int offs ; int hole ; int read ; struct inode *inode ; loff_t i_size ; loff_t tmp ; unsigned int page_block ; void *addr ; void *zaddr ; unsigned long end_index ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int err ; int len ; int out_len ; int dlen ; struct ubifs_data_node *dn ; struct task_struct *tmp___2 ; struct ubifs_inode *tmp___3 ; long tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; int len___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; { i = 0; nn = *n; offs = bu->zbranch[0].offs; hole = 0; read = 0; inode = (page->mapping)->host; tmp = i_size_read((struct inode const *)inode); i_size = tmp; descriptor.modname = "ubifs"; descriptor.function = "populate_page"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, pg %lu, i_size %lld, flags %#lx\n"; descriptor.lineno = 739U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, pg %lu, i_size %lld, flags %#lx\n", tmp___0->pid, inode->i_ino, page->ldv_15613.ldv_15597.index, i_size, page->flags); } else { } zaddr = kmap(page); addr = zaddr; end_index = (unsigned long )((i_size + -1LL) >> 12); if (i_size == 0LL || page->ldv_15613.ldv_15597.index > end_index) { hole = 1; memset(addr, 0, 4096UL); goto out_hole; } else { } page_block = (unsigned int )page->ldv_15613.ldv_15597.index; ldv_27832: ; if (bu->cnt <= nn) { hole = 1; memset(addr, 0, 4096UL); } else { tmp___6 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& bu->zbranch[nn].key)); if (tmp___6 == page_block) { dn = (struct ubifs_data_node *)bu->buf + (unsigned long )(bu->zbranch[nn].offs - offs); tmp___3 = ubifs_inode((struct inode const *)inode); tmp___4 = ldv__builtin_expect(dn->ch.sqnum <= tmp___3->creat_sqnum, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "populate_page", 763, tmp___2->pid); dump_stack(); } else { } len = (int )dn->size; if (len <= 0 || len > 4096) { goto out_err; } else { } dlen = (int )(dn->ch.len - 48U); out_len = 4096; err = ubifs_decompress((void const *)(& dn->data), dlen, addr, & out_len, (int )dn->compr_type); if (err != 0 || len != out_len) { goto out_err; } else { } if (len <= 4095) { memset(addr + (unsigned long )len, 0, (size_t )(4096 - len)); } else { } nn = nn + 1; read = (i << 12) + len; } else { tmp___5 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& bu->zbranch[nn].key)); if (tmp___5 < page_block) { nn = nn + 1; goto ldv_27830; } else { hole = 1; memset(addr, 0, 4096UL); } } } i = i + 1; if (i != 0) { goto ldv_27831; } else { } addr = addr + 4096UL; page_block = page_block + 1U; ldv_27830: ; goto ldv_27832; ldv_27831: ; if (page->ldv_15613.ldv_15597.index == end_index) { len___0 = (int )i_size & 4095; if (len___0 != 0 && len___0 < read) { memset(zaddr + (unsigned long )len___0, 0, (size_t )(read - len___0)); } else { } } else { } out_hole: ; if (hole != 0) { SetPageChecked(page); descriptor___0.modname = "ubifs"; descriptor___0.function = "populate_page"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): hole\n"; descriptor___0.lineno = 804U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): hole\n", tmp___7->pid); } else { } } else { } SetPageUptodate(page); ClearPageError(page); kunmap(page); *n = nn; return (0); out_err: ClearPageUptodate(page); SetPageError(page); kunmap(page); tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: bad data node (block %u, inode %lu)\n", tmp___9->pid, "populate_page", page_block, inode->i_ino); return (-22); } } static int ubifs_do_bulk_read(struct ubifs_info *c , struct bu_info *bu , struct page *page1 ) { unsigned long offset ; unsigned long end_index ; struct address_space *mapping ; struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; int err ; int page_idx ; int page_cnt ; int ret ; int n ; int allocate ; loff_t isize ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; unsigned long page_offset___0 ; struct page *page ; int tmp___4 ; struct task_struct *tmp___5 ; unsigned char tmp___6 ; { offset = page1->ldv_15613.ldv_15597.index; mapping = page1->mapping; inode = mapping->host; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; ret = 0; n = 0; allocate = (unsigned long )bu->buf == (unsigned long )((void *)0); err = ubifs_tnc_get_bu_keys(c, bu); if (err != 0) { goto out_warn; } else { } if (bu->eof != 0) { ui->read_in_a_row = 1UL; ui->bulk_read = 0U; } else { } page_cnt = bu->blk_cnt; if (page_cnt == 0) { goto out_bu_off; } else { } if (bu->cnt != 0) { if (allocate != 0) { bu->buf_len = (bu->zbranch[bu->cnt + -1].offs + bu->zbranch[bu->cnt + -1].len) - bu->zbranch[0].offs; tmp___1 = ldv__builtin_expect(bu->buf_len <= 0, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_do_bulk_read", 873, tmp___0->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect(bu->buf_len > c->leb_size, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_do_bulk_read", 874, tmp___2->pid); dump_stack(); } else { } bu->buf = kmalloc((size_t )bu->buf_len, 592U); if ((unsigned long )bu->buf == (unsigned long )((void *)0)) { goto out_bu_off; } else { } } else { } err = ubifs_tnc_bulk_read(c, bu); if (err != 0) { goto out_warn; } else { } } else { } err = populate_page(c, page1, bu, & n); if (err != 0) { goto out_warn; } else { } unlock_page(page1); ret = 1; isize = i_size_read((struct inode const *)inode); if (isize == 0LL) { goto out_free; } else { } end_index = (unsigned long )((isize + -1LL) >> 12); page_idx = 1; goto ldv_27860; ldv_27859: page_offset___0 = (unsigned long )page_idx + offset; if (page_offset___0 > end_index) { goto ldv_27858; } else { } page = find_or_create_page(mapping, page_offset___0, 336U); if ((unsigned long )page == (unsigned long )((struct page *)0)) { goto ldv_27858; } else { } tmp___4 = PageUptodate(page); if (tmp___4 == 0) { err = populate_page(c, page, bu, & n); } else { } unlock_page(page); put_page(page); if (err != 0) { goto ldv_27858; } else { } page_idx = page_idx + 1; ldv_27860: ; if (page_idx < page_cnt) { goto ldv_27859; } else { } ldv_27858: ui->last_page_read = ((unsigned long )page_idx + offset) - 1UL; out_free: ; if (allocate != 0) { kfree((void const *)bu->buf); } else { } return (ret); out_warn: tmp___5 = get_current(); printk("\fUBIFS warning (pid %d): %s: ignoring error %d and skipping bulk-read\n", tmp___5->pid, "ubifs_do_bulk_read", err); goto out_free; out_bu_off: tmp___6 = 0U; ui->bulk_read = tmp___6; ui->read_in_a_row = (unsigned long )tmp___6; goto out_free; } } static int ubifs_bulk_read(struct page *page ) { struct inode *inode ; struct ubifs_info *c ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; unsigned long index ; unsigned long last_page_read ; struct bu_info *bu ; int err ; int allocated ; int tmp___0 ; void *tmp___1 ; int tmp___2 ; { inode = (page->mapping)->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; index = page->ldv_15613.ldv_15597.index; last_page_read = ui->last_page_read; err = 0; allocated = 0; ui->last_page_read = index; if ((unsigned int )*((unsigned char *)c + 2048UL) == 0U) { return (0); } else { } tmp___0 = ldv_mutex_trylock_85(& ui->ui_mutex); if (tmp___0 == 0) { return (0); } else { } if (last_page_read + 1UL != index) { ui->read_in_a_row = 1UL; if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { ui->bulk_read = 0U; } else { } goto out_unlock; } else { } if ((unsigned int )*((unsigned char *)ui + 1060UL) == 0U) { ui->read_in_a_row = ui->read_in_a_row + 1UL; if (ui->read_in_a_row <= 2UL) { goto out_unlock; } else { } ui->bulk_read = 1U; } else { } tmp___2 = ldv_mutex_trylock_86(& c->bu_mutex); if (tmp___2 != 0) { bu = & c->bu; } else { tmp___1 = kmalloc(1064UL, 592U); bu = (struct bu_info *)tmp___1; if ((unsigned long )bu == (unsigned long )((struct bu_info *)0)) { goto out_unlock; } else { } bu->buf = 0; allocated = 1; } bu->buf_len = c->max_bu_buf_len; data_key_init((struct ubifs_info const *)c, & bu->key, inode->i_ino, (unsigned int )page->ldv_15613.ldv_15597.index); err = ubifs_do_bulk_read(c, bu, page); if (allocated == 0) { ldv_mutex_unlock_87(& c->bu_mutex); } else { kfree((void const *)bu); } out_unlock: ldv_mutex_unlock_88(& ui->ui_mutex); return (err); } } static int ubifs_readpage(struct file *file , struct page *page ) { int tmp ; { tmp = ubifs_bulk_read(page); if (tmp != 0) { return (0); } else { } do_readpage(page); unlock_page(page); return (0); } } static int do_writepage(struct page *page , int len ) { int err ; int i ; int blen ; unsigned int block ; void *addr ; union ubifs_key key ; struct inode *inode ; struct ubifs_info *c ; int __min1 ; int __min2 ; struct task_struct *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long tmp___2 ; int tmp___3 ; { err = 0; inode = (page->mapping)->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; set_page_writeback(page); addr = kmap(page); block = (unsigned int )page->ldv_15613.ldv_15597.index; i = 0; goto ldv_27894; ldv_27893: __min1 = len; __min2 = 4096; blen = __min1 < __min2 ? __min1 : __min2; data_key_init((struct ubifs_info const *)c, & key, inode->i_ino, block); err = ubifs_jnl_write_data(c, (struct inode const *)inode, (union ubifs_key const *)(& key), (void const *)addr, blen); if (err != 0) { goto ldv_27892; } else { } i = i + 1; if (i != 0) { goto ldv_27892; } else { } block = block + 1U; addr = addr + (unsigned long )blen; len = len - blen; ldv_27894: ; if (len != 0) { goto ldv_27893; } else { } ldv_27892: ; if (err != 0) { SetPageError(page); tmp = get_current(); printk("\vUBIFS error (pid %d): %s: cannot write page %lu of inode %lu, error %d\n", tmp->pid, "do_writepage", page->ldv_15613.ldv_15597.index, inode->i_ino, err); ubifs_ro_mode(c, err); } else { } tmp___1 = PagePrivate((struct page const *)page); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_writepage", 1055, tmp___0->pid); dump_stack(); } else { } tmp___3 = PageChecked((struct page const *)page); if (tmp___3 != 0) { release_new_page_budget(c); } else { release_existing_page_budget(c); } atomic_long_dec(& c->dirty_pg_cnt); ClearPagePrivate(page); ClearPageChecked(page); kunmap(page); unlock_page(page); end_page_writeback(page); return (err); } } static int ubifs_writepage(struct page *page , struct writeback_control *wbc ) { struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; loff_t i_size ; loff_t tmp___0 ; loff_t synced_i_size ; unsigned long end_index ; int err ; int len ; void *kaddr ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; int tmp___6 ; int tmp___7 ; { inode = (page->mapping)->host; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; tmp___0 = i_size_read((struct inode const *)inode); i_size = tmp___0; end_index = (unsigned long )(i_size >> 12); len = (int )i_size & 4095; descriptor.modname = "ubifs"; descriptor.function = "ubifs_writepage"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, pg %lu, pg flags %#lx\n"; descriptor.lineno = 1127U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, pg %lu, pg flags %#lx\n", tmp___1->pid, inode->i_ino, page->ldv_15613.ldv_15597.index, page->flags); } else { } tmp___4 = PagePrivate((struct page const *)page); tmp___5 = ldv__builtin_expect(tmp___4 == 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_writepage", 1128, tmp___3->pid); dump_stack(); } else { } if (page->ldv_15613.ldv_15597.index > end_index || (page->ldv_15613.ldv_15597.index == end_index && len == 0)) { err = 0; goto out_unlock; } else { } spin_lock(& ui->ui_lock); synced_i_size = ui->synced_i_size; spin_unlock(& ui->ui_lock); if (page->ldv_15613.ldv_15597.index < end_index) { if ((unsigned long long )page->ldv_15613.ldv_15597.index >= (unsigned long long )(synced_i_size >> 12)) { err = (*(((inode->i_sb)->s_op)->write_inode))(inode, 0); if (err != 0) { goto out_unlock; } else { } } else { } tmp___6 = do_writepage(page, 4096); return (tmp___6); } else { } kaddr = kmap_atomic(page); memset(kaddr + (unsigned long )len, 0, 4096UL - (unsigned long )len); __kunmap_atomic(kaddr); if (i_size > synced_i_size) { err = (*(((inode->i_sb)->s_op)->write_inode))(inode, 0); if (err != 0) { goto out_unlock; } else { } } else { } tmp___7 = do_writepage(page, len); return (tmp___7); out_unlock: unlock_page(page); return (err); } } static void do_attr_changes(struct inode *inode , struct iattr const *attr ) { umode_t mode ; int tmp ; bool tmp___0 ; int tmp___1 ; { if (((unsigned int )attr->ia_valid & 2U) != 0U) { inode->i_uid = attr->ia_uid; } else { } if (((unsigned int )attr->ia_valid & 4U) != 0U) { inode->i_gid = attr->ia_gid; } else { } if (((unsigned int )attr->ia_valid & 16U) != 0U) { inode->i_atime = timespec_trunc(attr->ia_atime, (inode->i_sb)->s_time_gran); } else { } if (((unsigned int )attr->ia_valid & 32U) != 0U) { inode->i_mtime = timespec_trunc(attr->ia_mtime, (inode->i_sb)->s_time_gran); } else { } if (((unsigned int )attr->ia_valid & 64U) != 0U) { inode->i_ctime = timespec_trunc(attr->ia_ctime, (inode->i_sb)->s_time_gran); } else { } if ((int )attr->ia_valid & 1) { mode = attr->ia_mode; tmp = in_group_p(inode->i_gid); if (tmp == 0) { tmp___0 = capable(4); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { mode = (unsigned int )mode & 64511U; } else { } } else { } inode->i_mode = mode; } else { } return; } } static int do_truncation(struct ubifs_info *c , struct inode *inode , struct iattr const *attr ) { int err ; struct ubifs_budget_req req ; loff_t old_size ; loff_t new_size ; int offset ; int budgeted ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; unsigned long index ; struct page *page ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; struct timespec tmp___6 ; unsigned char tmp___7 ; { old_size = inode->i_size; new_size = attr->ia_size; offset = (int )new_size & 4095; budgeted = 1; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; descriptor.modname = "ubifs"; descriptor.function = "do_truncation"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, size %lld -> %lld\n"; descriptor.lineno = 1231U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, size %lld -> %lld\n", tmp___0->pid, inode->i_ino, old_size, new_size); } else { } memset((void *)(& req), 0, 20UL); if ((new_size & 4095LL) != 0LL) { req.dirtied_page = 1U; } else { } req.dirtied_ino = 1U; req.dirtied_ino_d = 56U; err = ubifs_budget_space(c, & req); if (err != 0) { if (new_size != 0LL || err != -28) { return (err); } else { } budgeted = 0; } else { } truncate_setsize(inode, new_size); if (offset != 0) { index = (unsigned long )(new_size >> 12); page = find_lock_page(inode->i_mapping, index); if ((unsigned long )page != (unsigned long )((struct page *)0)) { tmp___5 = PageDirty((struct page const *)page); if (tmp___5 != 0) { tmp___3 = PagePrivate((struct page const *)page); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_truncation", 1273, tmp___2->pid); dump_stack(); } else { } clear_page_dirty_for_io(page); err = do_writepage(page, offset); put_page(page); if (err != 0) { goto out_budg; } else { } } else { unlock_page(page); put_page(page); } } else { } } else { } ldv_mutex_lock_89(& ui->ui_mutex); ui->ui_size = inode->i_size; tmp___6 = ubifs_current_time(inode); inode->i_ctime = tmp___6; inode->i_mtime = tmp___6; do_attr_changes(inode, attr); err = ubifs_jnl_truncate(c, (struct inode const *)inode, old_size, new_size); ldv_mutex_unlock_90(& ui->ui_mutex); out_budg: ; if (budgeted != 0) { ubifs_release_budget(c, & req); } else { tmp___7 = 0U; c->bi.nospace_rp = tmp___7; c->bi.nospace = tmp___7; __asm__ volatile ("": : : "memory"); } return (err); } } static int do_setattr(struct ubifs_info *c , struct inode *inode , struct iattr const *attr ) { int err ; int release ; loff_t new_size ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct ubifs_budget_req req ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct timespec tmp___2 ; { new_size = attr->ia_size; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )ui->data_len) + 7U)) & 32760U; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } if (((unsigned int )attr->ia_valid & 8U) != 0U) { descriptor.modname = "ubifs"; descriptor.function = "do_setattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): size %lld -> %lld\n"; descriptor.lineno = 1342U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): size %lld -> %lld\n", tmp___0->pid, inode->i_size, new_size); } else { } truncate_setsize(inode, new_size); } else { } ldv_mutex_lock_91(& ui->ui_mutex); if (((unsigned int )attr->ia_valid & 8U) != 0U) { tmp___2 = ubifs_current_time(inode); inode->i_ctime = tmp___2; inode->i_mtime = tmp___2; ui->ui_size = inode->i_size; } else { } do_attr_changes(inode, attr); release = (int )ui->dirty; if (((unsigned int )attr->ia_valid & 8U) != 0U) { __mark_inode_dirty(inode, 3); } else { mark_inode_dirty_sync(inode); } ldv_mutex_unlock_92(& ui->ui_mutex); if (release != 0) { ubifs_release_budget(c, & req); } else { } if (((inode->i_sb)->s_flags & 16UL) != 0UL || (int )inode->i_flags & 1) { err = (*(((inode->i_sb)->s_op)->write_inode))(inode, 0); } else { } return (err); } } int ubifs_setattr(struct dentry *dentry , struct iattr *attr ) { int err ; struct inode *inode ; struct ubifs_info *c ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { inode = dentry->d_inode; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; descriptor.modname = "ubifs"; descriptor.function = "ubifs_setattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, mode %#x, ia_valid %#x\n"; descriptor.lineno = 1381U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, mode %#x, ia_valid %#x\n", tmp->pid, inode->i_ino, (int )inode->i_mode, attr->ia_valid); } else { } err = inode_change_ok((struct inode const *)inode, attr); if (err != 0) { return (err); } else { } err = dbg_check_synced_i_size((struct ubifs_info const *)c, inode); if (err != 0) { return (err); } else { } if ((attr->ia_valid & 8U) != 0U && attr->ia_size < inode->i_size) { err = do_truncation(c, inode, (struct iattr const *)attr); } else { err = do_setattr(c, inode, (struct iattr const *)attr); } return (err); } } static void ubifs_invalidatepage(struct page *page , unsigned long offset ) { struct inode *inode ; struct ubifs_info *c ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; { inode = (page->mapping)->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; tmp___0 = PagePrivate((struct page const *)page); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_invalidatepage", 1404, tmp->pid); dump_stack(); } else { } if (offset != 0UL) { return; } else { } tmp___2 = PageChecked((struct page const *)page); if (tmp___2 != 0) { release_new_page_budget(c); } else { release_existing_page_budget(c); } atomic_long_dec(& c->dirty_pg_cnt); ClearPagePrivate(page); ClearPageChecked(page); return; } } static void *ubifs_follow_link(struct dentry *dentry , struct nameidata *nd ) { struct ubifs_inode *ui ; struct ubifs_inode *tmp ; { tmp = ubifs_inode((struct inode const *)dentry->d_inode); ui = tmp; nd_set_link(nd, (char *)ui->data); return (0); } } int ubifs_fsync(struct file *file , loff_t start , loff_t end , int datasync ) { struct inode *inode ; struct ubifs_info *c ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { inode = (file->f_mapping)->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; descriptor.modname = "ubifs"; descriptor.function = "ubifs_fsync"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): syncing inode %lu\n"; descriptor.lineno = 1433U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): syncing inode %lu\n", tmp->pid, inode->i_ino); } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (0); } else { } err = filemap_write_and_wait_range(inode->i_mapping, start, end); if (err != 0) { return (err); } else { } ldv_mutex_lock_93(& inode->i_mutex); if (datasync == 0 || (inode->i_state & 2UL) != 0UL) { err = (*(((inode->i_sb)->s_op)->write_inode))(inode, 0); if (err != 0) { goto out; } else { } } else { } err = ubifs_sync_wbufs_by_inode(c, inode); out: ldv_mutex_unlock_94(& inode->i_mutex); return (err); } } __inline static int mctime_update_needed(struct inode const *inode , struct timespec const *now ) { int tmp ; int tmp___0 ; { tmp = timespec_equal(& inode->i_mtime, now); if (tmp == 0) { return (1); } else { tmp___0 = timespec_equal(& inode->i_ctime, now); if (tmp___0 == 0) { return (1); } else { } } return (0); } } static int update_mctime(struct ubifs_info *c , struct inode *inode ) { struct timespec now ; struct timespec tmp ; struct ubifs_inode *ui ; struct ubifs_inode *tmp___0 ; int err ; int release ; struct ubifs_budget_req req ; struct timespec tmp___1 ; int tmp___2 ; { tmp = ubifs_current_time(inode); now = tmp; tmp___0 = ubifs_inode((struct inode const *)inode); ui = tmp___0; tmp___2 = mctime_update_needed((struct inode const *)inode, (struct timespec const *)(& now)); if (tmp___2 != 0) { req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )ui->data_len) + 7U)) & 32760U; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } ldv_mutex_lock_95(& ui->ui_mutex); tmp___1 = ubifs_current_time(inode); inode->i_ctime = tmp___1; inode->i_mtime = tmp___1; release = (int )ui->dirty; mark_inode_dirty_sync(inode); ldv_mutex_unlock_96(& ui->ui_mutex); if (release != 0) { ubifs_release_budget(c, & req); } else { } } else { } return (0); } } static ssize_t ubifs_aio_write(struct kiocb *iocb , struct iovec const *iov , unsigned long nr_segs , loff_t pos ) { int err ; struct inode *inode ; struct ubifs_info *c ; ssize_t tmp ; { inode = ((iocb->ki_filp)->f_mapping)->host; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; err = update_mctime(c, inode); if (err != 0) { return ((ssize_t )err); } else { } tmp = generic_file_aio_write(iocb, iov, nr_segs, pos); return (tmp); } } static int ubifs_set_page_dirty(struct page *page ) { int ret ; struct task_struct *tmp ; long tmp___0 ; { ret = __set_page_dirty_nobuffers(page); tmp___0 = ldv__builtin_expect(ret != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_set_page_dirty", 1540, tmp->pid); dump_stack(); } else { } return (ret); } } static int ubifs_releasepage(struct page *page , gfp_t unused_gfp_flags ) { int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; { tmp = PageWriteback((struct page const *)page); if (tmp != 0) { return (0); } else { } tmp___1 = PagePrivate((struct page const *)page); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_releasepage", 1552, tmp___0->pid); dump_stack(); } else { } tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_releasepage", 1553, tmp___3->pid); dump_stack(); ClearPagePrivate(page); ClearPageChecked(page); return (1); } } static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma , struct vm_fault *vmf ) { struct page *page ; struct inode *inode ; struct ubifs_info *c ; struct timespec now ; struct timespec tmp ; struct ubifs_budget_req req ; int err ; int update_time ; struct _ddebug descriptor ; loff_t tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; loff_t tmp___10 ; loff_t tmp___11 ; long tmp___12 ; int tmp___13 ; int tmp___14 ; int release ; struct ubifs_inode *ui ; struct ubifs_inode *tmp___15 ; struct timespec tmp___16 ; { page = vmf->page; inode = ((vma->vm_file)->f_path.dentry)->d_inode; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; tmp = ubifs_current_time(inode); now = tmp; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = 1U; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = (unsigned char)0; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_vm_page_mkwrite"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/file.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu, pg %lu, i_size %lld\n"; descriptor.lineno = 1574U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = i_size_read((struct inode const *)inode); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu, pg %lu, i_size %lld\n", tmp___1->pid, inode->i_ino, page->ldv_15613.ldv_15597.index, tmp___0); } else { } tmp___4 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_vm_page_mkwrite", 1575, tmp___3->pid); dump_stack(); } else { tmp___5 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_vm_page_mkwrite", 1575, tmp___3->pid); dump_stack(); } else { } } tmp___6 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___6 != 0L) { return (2); } else { } update_time = mctime_update_needed((struct inode const *)inode, (struct timespec const *)(& now)); if (update_time != 0) { req.dirtied_ino = 1U; } else { } err = ubifs_budget_space(c, & req); tmp___8 = ldv__builtin_expect(err != 0, 0L); if (tmp___8 != 0L) { if (err == -28) { tmp___7 = get_current(); printk("\fUBIFS warning (pid %d): %s: out of space for mmapped file (inode number %lu)\n", tmp___7->pid, "ubifs_vm_page_mkwrite", inode->i_ino); } else { } return (2); } else { } lock_page(page); tmp___9 = ldv__builtin_expect((unsigned long )page->mapping != (unsigned long )inode->i_mapping, 0L); if (tmp___9 != 0L) { err = -22; goto out_unlock; } else { tmp___10 = page_offset(page); tmp___11 = i_size_read((struct inode const *)inode); tmp___12 = ldv__builtin_expect(tmp___10 > tmp___11, 0L); if (tmp___12 != 0L) { err = -22; goto out_unlock; } else { } } tmp___14 = PagePrivate((struct page const *)page); if (tmp___14 != 0) { release_new_page_budget(c); } else { tmp___13 = PageChecked((struct page const *)page); if (tmp___13 == 0) { ubifs_convert_page_budget(c); } else { } SetPagePrivate(page); atomic_long_inc(& c->dirty_pg_cnt); __set_page_dirty_nobuffers(page); } if (update_time != 0) { tmp___15 = ubifs_inode((struct inode const *)inode); ui = tmp___15; ldv_mutex_lock_97(& ui->ui_mutex); tmp___16 = ubifs_current_time(inode); inode->i_ctime = tmp___16; inode->i_mtime = tmp___16; release = (int )ui->dirty; mark_inode_dirty_sync(inode); ldv_mutex_unlock_98(& ui->ui_mutex); if (release != 0) { ubifs_release_dirty_inode_budget(c, ui); } else { } } else { } unlock_page(page); return (0); out_unlock: unlock_page(page); ubifs_release_budget(c, & req); if (err != 0) { err = 2; } else { } return (err); } } static struct vm_operations_struct const ubifs_file_vm_ops = {0, 0, & filemap_fault, & ubifs_vm_page_mkwrite, 0, 0, 0, 0, & generic_file_remap_pages}; static int ubifs_file_mmap(struct file *file , struct vm_area_struct *vma ) { int err ; { err = generic_file_mmap(file, vma); if (err != 0) { return (err); } else { } vma->vm_ops = & ubifs_file_vm_ops; return (0); } } struct address_space_operations const ubifs_file_address_operations = {& ubifs_writepage, & ubifs_readpage, 0, & ubifs_set_page_dirty, 0, & ubifs_write_begin, & ubifs_write_end, 0, & ubifs_invalidatepage, & ubifs_releasepage, 0, 0, 0, 0, 0, 0, 0, 0, 0}; struct inode_operations const ubifs_file_inode_operations = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ubifs_setattr, & ubifs_getattr, & ubifs_setxattr, & ubifs_getxattr, & ubifs_listxattr, & ubifs_removexattr, 0, 0, 0}; struct inode_operations const ubifs_symlink_inode_operations = {0, & ubifs_follow_link, 0, 0, & generic_readlink, 0, 0, 0, 0, 0, 0, 0, 0, 0, & ubifs_setattr, & ubifs_getattr, 0, 0, 0, 0, 0, 0, 0}; struct file_operations const ubifs_file_operations = {0, & generic_file_llseek, & do_sync_read, & do_sync_write, & generic_file_aio_read, & ubifs_aio_write, 0, 0, & ubifs_ioctl, & ubifs_compat_ioctl, & ubifs_file_mmap, 0, 0, 0, & ubifs_fsync, 0, 0, 0, 0, 0, 0, 0, & generic_file_splice_write, & generic_file_splice_read, 0, 0, 0}; void ldv_check_final_state(void) ; void ldv_initialize(void) ; extern void ldv_handler_precall(void) ; extern int __VERIFIER_nondet_int(void) ; int LDV_IN_INTERRUPT ; void ldv_main2_sequence_infinite_withcheck_stateful(void) { struct vm_area_struct *var_group1 ; struct vm_fault *var_group2 ; struct file *var_group3 ; struct page *var_group4 ; struct writeback_control *var_group5 ; struct address_space *var_group6 ; loff_t var_ubifs_write_begin_6_p2 ; unsigned int var_ubifs_write_begin_6_p3 ; unsigned int var_ubifs_write_begin_6_p4 ; struct page **var_ubifs_write_begin_6_p5 ; void **var_ubifs_write_begin_6_p6 ; loff_t var_ubifs_write_end_8_p2 ; unsigned int var_ubifs_write_end_8_p3 ; unsigned int var_ubifs_write_end_8_p4 ; struct page *var_ubifs_write_end_8_p5 ; void *var_ubifs_write_end_8_p6 ; unsigned long var_ubifs_invalidatepage_19_p1 ; gfp_t var_ubifs_releasepage_26_p1 ; struct dentry *var_group7 ; struct iattr *var_group8 ; struct nameidata *var_group9 ; struct kiocb *var_group10 ; struct iovec const *var_ubifs_aio_write_24_p1 ; unsigned long var_ubifs_aio_write_24_p2 ; loff_t var_ubifs_aio_write_24_p3 ; loff_t var_ubifs_fsync_21_p1 ; loff_t var_ubifs_fsync_21_p2 ; int var_ubifs_fsync_21_p3 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_28097; ldv_28096: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); ubifs_vm_page_mkwrite(var_group1, var_group2); goto ldv_28081; case 1: ldv_handler_precall(); ubifs_readpage(var_group3, var_group4); goto ldv_28081; case 2: ldv_handler_precall(); ubifs_writepage(var_group4, var_group5); goto ldv_28081; case 3: ldv_handler_precall(); ubifs_write_begin(var_group3, var_group6, var_ubifs_write_begin_6_p2, var_ubifs_write_begin_6_p3, var_ubifs_write_begin_6_p4, var_ubifs_write_begin_6_p5, var_ubifs_write_begin_6_p6); goto ldv_28081; case 4: ldv_handler_precall(); ubifs_write_end(var_group3, var_group6, var_ubifs_write_end_8_p2, var_ubifs_write_end_8_p3, var_ubifs_write_end_8_p4, var_ubifs_write_end_8_p5, var_ubifs_write_end_8_p6); goto ldv_28081; case 5: ldv_handler_precall(); ubifs_invalidatepage(var_group4, var_ubifs_invalidatepage_19_p1); goto ldv_28081; case 6: ldv_handler_precall(); ubifs_set_page_dirty(var_group4); goto ldv_28081; case 7: ldv_handler_precall(); ubifs_releasepage(var_group4, var_ubifs_releasepage_26_p1); goto ldv_28081; case 8: ldv_handler_precall(); ubifs_setattr(var_group7, var_group8); goto ldv_28081; case 9: ldv_handler_precall(); ubifs_follow_link(var_group7, var_group9); goto ldv_28081; case 10: ldv_handler_precall(); ubifs_setattr(var_group7, var_group8); goto ldv_28081; case 11: ldv_handler_precall(); ubifs_aio_write(var_group10, var_ubifs_aio_write_24_p1, var_ubifs_aio_write_24_p2, var_ubifs_aio_write_24_p3); goto ldv_28081; case 12: ldv_handler_precall(); ubifs_file_mmap(var_group3, var_group1); goto ldv_28081; case 13: ldv_handler_precall(); ubifs_fsync(var_group3, var_ubifs_fsync_21_p1, var_ubifs_fsync_21_p2, var_ubifs_fsync_21_p3); goto ldv_28081; default: ; goto ldv_28081; } ldv_28081: ; ldv_28097: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_28096; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_71(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_72(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_73(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_74(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_75(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_76(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_77(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_78(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_79(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_lock_80(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_lock_81(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_82(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_83(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_84(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } int ldv_mutex_trylock_85(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___13 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_ui_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } int ldv_mutex_trylock_86(struct mutex *ldv_func_arg1 ) { ldv_func_ret_type___14 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_trylock(ldv_func_arg1); ldv_func_res = tmp; tmp___0 = ldv_mutex_trylock_bu_mutex(ldv_func_arg1); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_unlock_87(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_bu_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_88(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_89(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_90(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_91(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_92(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_93(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_i_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_94(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_i_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_95(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_96(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_97(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_98(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern int memcmp(void const * , void const * , size_t ) ; extern size_t strlen(char const * ) ; __inline static void *ERR_PTR(long error ) { { return ((void *)error); } } __inline static long PTR_ERR(void const *ptr ) { { return ((long )ptr); } } __inline static long IS_ERR(void const *ptr ) { long tmp ; { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); return (tmp); } } void ldv_mutex_lock_nested_131(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_138(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_139(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_151(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_152(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_153(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_128(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_130(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_132(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_134(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_136(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_137(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_140(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_141(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_143(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_147(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_149(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_150(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_154(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_155(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_156(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_158(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_160(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_127(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_129(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_133(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_135(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_142(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_148(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_157(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_159(struct mutex *ldv_func_arg1 ) ; __inline static int new_valid_dev(dev_t dev ) { { return (1); } } __inline static u32 new_encode_dev(dev_t dev ) { unsigned int major ; unsigned int minor ; { major = dev >> 20; minor = dev & 1048575U; return (((minor & 255U) | (major << 8)) | ((minor & 4294967040U) << 12)); } } __inline static u64 huge_encode_dev(dev_t dev ) { u32 tmp ; { tmp = new_encode_dev(dev); return ((u64 )tmp); } } extern void d_instantiate(struct dentry * , struct inode * ) ; extern void d_rehash(struct dentry * ) ; __inline static void d_add(struct dentry *entry , struct inode *inode ) { { d_instantiate(entry, inode); d_rehash(entry); return; } } extern void inode_init_owner(struct inode * , struct inode const * , umode_t ) ; extern void inc_nlink(struct inode * ) ; extern void drop_nlink(struct inode * ) ; extern void clear_nlink(struct inode * ) ; extern void set_nlink(struct inode * , unsigned int ) ; extern void init_special_inode(struct inode * , umode_t , dev_t ) ; extern void make_bad_inode(struct inode * ) ; extern void ihold(struct inode * ) ; extern void iput(struct inode * ) ; extern struct inode *new_inode(struct super_block * ) ; extern void __insert_inode_hash(struct inode * , unsigned long ) ; __inline static void insert_inode_hash(struct inode *inode ) { { __insert_inode_hash(inode, inode->i_ino); return; } } extern void generic_fillattr(struct inode * , struct kstat * ) ; extern ssize_t generic_read_dir(struct file * , char * , size_t , loff_t * ) ; __inline static ino_t parent_ino(struct dentry *dentry ) { ino_t res ; { spin_lock(& dentry->d_lock); res = ((dentry->d_parent)->d_inode)->i_ino; spin_unlock(& dentry->d_lock); return (res); } } struct file_operations const ubifs_dir_operations ; struct inode_operations const ubifs_dir_inode_operations ; int ubifs_tnc_lookup_nm(struct ubifs_info *c , union ubifs_key const *key , void *node , struct qstr const *nm ) ; struct ubifs_dent_node *ubifs_tnc_next_ent(struct ubifs_info *c , union ubifs_key *key , struct qstr const *nm ) ; struct inode *ubifs_new_inode(struct ubifs_info *c , struct inode const *dir , umode_t mode ) ; struct inode *ubifs_iget(struct super_block *sb , unsigned long inum ) ; void ubifs_set_inode_flags(struct inode *inode ) ; struct ubifs_global_debug_info ubifs_dbg ; __inline static int dbg_is_chk_gen(struct ubifs_info const *c ) { { return ((unsigned int )*((unsigned char *)(& ubifs_dbg) + 0UL) != 0U || (unsigned int )*((unsigned char *)c->dbg + 244UL) != 0U); } } __inline static int ubifs_encode_dev(union ubifs_dev_desc *dev , dev_t rdev ) { int tmp ; { tmp = new_valid_dev(rdev); if (tmp != 0) { dev->new = new_encode_dev(rdev); return (4); } else { dev->huge = huge_encode_dev(rdev); return (8); } } } __inline static void dent_key_init_hash(struct ubifs_info const *c , union ubifs_key *key , ino_t inum , uint32_t hash ) { struct task_struct *tmp ; long tmp___0 ; { tmp___0 = ldv__builtin_expect((hash & 3758096384U) != 0U, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dent_key_init_hash", 175, tmp->pid); dump_stack(); } else { } key->u32[0] = (uint32_t )inum; key->u32[1] = hash | 1073741824U; return; } } __inline static void lowest_dent_key(struct ubifs_info const *c , union ubifs_key *key , ino_t inum ) { { key->u32[0] = (uint32_t )inum; key->u32[1] = 1073741824U; return; } } __inline static uint32_t key_hash_flash(struct ubifs_info const *c , void const *k ) { union ubifs_key const *key ; { key = (union ubifs_key const *)k; return (key->j32[1] & 536870911U); } } __inline static void key_read(struct ubifs_info const *c , void const *from , union ubifs_key *to ) { union ubifs_key const *f ; { f = (union ubifs_key const *)from; to->u32[0] = f->j32[0]; to->u32[1] = f->j32[1]; return; } } static int inherit_flags(struct inode const *dir , umode_t mode ) { int flags ; struct ubifs_inode const *ui ; struct ubifs_inode *tmp ; { tmp = ubifs_inode(dir); ui = (struct ubifs_inode const *)tmp; if (((int )dir->i_mode & 61440) != 16384) { return (0); } else { } flags = (int )ui->flags & 19; if (((int )mode & 61440) != 16384) { flags = flags & -17; } else { } return (flags); } } struct inode *ubifs_new_inode(struct ubifs_info *c , struct inode const *dir , umode_t mode ) { struct inode *inode ; struct ubifs_inode *ui ; void *tmp ; struct timespec tmp___0 ; struct timespec tmp___1 ; loff_t tmp___2 ; struct task_struct *tmp___3 ; void *tmp___4 ; struct task_struct *tmp___5 ; { inode = new_inode(c->vfs_sb); ui = ubifs_inode((struct inode const *)inode); if ((unsigned long )inode == (unsigned long )((struct inode *)0)) { tmp = ERR_PTR(-12L); return ((struct inode *)tmp); } else { } inode->i_flags = inode->i_flags | 128U; inode_init_owner(inode, dir, (int )mode); tmp___1 = ubifs_current_time(inode); inode->i_ctime = tmp___1; tmp___0 = tmp___1; inode->i_atime = tmp___0; inode->i_mtime = tmp___0; (inode->i_mapping)->nrpages = 0UL; (inode->i_mapping)->backing_dev_info = & c->bdi; switch ((int )mode & 61440) { case 32768: (inode->i_mapping)->a_ops = & ubifs_file_address_operations; inode->i_op = & ubifs_file_inode_operations; inode->i_fop = & ubifs_file_operations; goto ldv_27614; case 16384: inode->i_op = & ubifs_dir_inode_operations; inode->i_fop = & ubifs_dir_operations; tmp___2 = 160LL; ui->ui_size = tmp___2; inode->i_size = tmp___2; goto ldv_27614; case 40960: inode->i_op = & ubifs_symlink_inode_operations; goto ldv_27614; case 49152: ; case 4096: ; case 24576: ; case 8192: inode->i_op = & ubifs_file_inode_operations; goto ldv_27614; default: __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"), "i" (255), "i" (12UL)); ldv_27622: ; goto ldv_27622; } ldv_27614: ui->flags = inherit_flags(dir, (int )mode); ubifs_set_inode_flags(inode); if (((int )mode & 61440) == 32768) { ui->compr_type = c->default_compr; } else { ui->compr_type = 0U; } ui->synced_i_size = 0LL; spin_lock(& c->cnt_lock); if (c->highest_inum > 4293918719UL) { if (c->highest_inum > 4294967039UL) { spin_unlock(& c->cnt_lock); tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: out of inode numbers\n", tmp___3->pid, "ubifs_new_inode"); make_bad_inode(inode); iput(inode); tmp___4 = ERR_PTR(-22L); return ((struct inode *)tmp___4); } else { } tmp___5 = get_current(); printk("\fUBIFS warning (pid %d): %s: running out of inode numbers (current %lu, max %d)\n", tmp___5->pid, "ubifs_new_inode", c->highest_inum, 4294967040U); } else { } c->highest_inum = c->highest_inum + 1UL; inode->i_ino = c->highest_inum; c->max_sqnum = c->max_sqnum + 1ULL; ui->creat_sqnum = c->max_sqnum; spin_unlock(& c->cnt_lock); return (inode); } } static int dbg_check_name(struct ubifs_info const *c , struct ubifs_dent_node const *dent , struct qstr const *nm ) { int tmp ; int tmp___0 ; { tmp = dbg_is_chk_gen(c); if (tmp == 0) { return (0); } else { } if ((unsigned int )dent->nlen != (unsigned int )nm->ldv_7607.ldv_7605.len) { return (-22); } else { } tmp___0 = memcmp((void const *)(& dent->name), (void const *)nm->name, (size_t )nm->ldv_7607.ldv_7605.len); if (tmp___0 != 0) { return (-22); } else { } return (0); } } static struct dentry *ubifs_lookup(struct inode *dir , struct dentry *dentry , unsigned int flags ) { int err ; union ubifs_key key ; struct inode *inode ; struct ubifs_dent_node *dent ; struct ubifs_info *c ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; int tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; void *tmp___10 ; { inode = 0; c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; descriptor.modname = "ubifs"; descriptor.function = "ubifs_lookup"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): \'%.*s\' in dir ino %lu\n"; descriptor.lineno = 316U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): \'%.*s\' in dir ino %lu\n", tmp->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, dir->i_ino); } else { } if (dentry->d_name.ldv_7607.ldv_7605.len > 255U) { tmp___1 = ERR_PTR(-36L); return ((struct dentry *)tmp___1); } else { } tmp___2 = kmalloc(312UL, 80U); dent = (struct ubifs_dent_node *)tmp___2; if ((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0)) { tmp___3 = ERR_PTR(-12L); return ((struct dentry *)tmp___3); } else { } dent_key_init((struct ubifs_info const *)c, & key, dir->i_ino, (struct qstr const *)(& dentry->d_name)); err = ubifs_tnc_lookup_nm(c, (union ubifs_key const *)(& key), (void *)dent, (struct qstr const *)(& dentry->d_name)); if (err != 0) { if (err == -2) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_lookup"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): not found\n"; descriptor___0.lineno = 330U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): not found\n", tmp___4->pid); } else { } goto done; } else { } goto out; } else { } tmp___6 = dbg_check_name((struct ubifs_info const *)c, (struct ubifs_dent_node const *)dent, (struct qstr const *)(& dentry->d_name)); if (tmp___6 != 0) { err = -22; goto out; } else { } inode = ubifs_iget(dir->i_sb, (unsigned long )dent->inum); tmp___9 = IS_ERR((void const *)inode); if (tmp___9 != 0L) { tmp___7 = PTR_ERR((void const *)inode); err = (int )tmp___7; tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: dead directory entry \'%.*s\', error %d\n", tmp___8->pid, "ubifs_lookup", dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, err); ubifs_ro_mode(c, err); goto out; } else { } done: kfree((void const *)dent); d_add(dentry, inode); return (0); out: kfree((void const *)dent); tmp___10 = ERR_PTR((long )err); return ((struct dentry *)tmp___10); } } static int ubifs_create(struct inode *dir , struct dentry *dentry , umode_t mode , bool excl ) { struct inode *inode ; struct ubifs_info *c ; int err ; int sz_change ; struct ubifs_budget_req req ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct timespec tmp___4 ; struct task_struct *tmp___5 ; { c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = (unsigned char)0; req.new_ino = 1U; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; tmp = ubifs_inode((struct inode const *)dir); dir_ui = tmp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_create"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\', mode %#hx in dir ino %lu\n"; descriptor.lineno = 384U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\', mode %#hx in dir ino %lu\n", tmp___0->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, (int )mode, dir->i_ino); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } inode = ubifs_new_inode(c, (struct inode const *)dir, (int )mode); tmp___3 = IS_ERR((void const *)inode); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)inode); err = (int )tmp___2; goto out_budg; } else { } ldv_mutex_lock_135(& dir_ui->ui_mutex); dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___4 = inode->i_ctime; dir->i_ctime = tmp___4; dir->i_mtime = tmp___4; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 0, 0); if (err != 0) { goto out_cancel; } else { } ldv_mutex_unlock_136(& dir_ui->ui_mutex); ubifs_release_budget(c, & req); insert_inode_hash(inode); d_instantiate(dentry, inode); return (0); out_cancel: dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; ldv_mutex_unlock_137(& dir_ui->ui_mutex); make_bad_inode(inode); iput(inode); out_budg: ubifs_release_budget(c, & req); tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot create regular file, error %d\n", tmp___5->pid, "ubifs_create", err); return (err); } } static unsigned int vfs_dent_type(uint8_t type ) { { switch ((int )type) { case 0: ; return (8U); case 1: ; return (4U); case 2: ; return (10U); case 3: ; return (6U); case 4: ; return (2U); case 5: ; return (1U); case 6: ; return (12U); default: __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"), "i" (447), "i" (12UL)); ldv_27671: ; goto ldv_27671; } return (0U); } } static int ubifs_readdir(struct file *file , void *dirent , int (*filldir)(void * , char const * , int , loff_t , u64 , unsigned int ) ) { int err ; int over ; struct qstr nm ; union ubifs_key key ; struct ubifs_dent_node *dent ; struct inode *dir ; struct ubifs_info *c ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; ino_t tmp___5 ; long tmp___6 ; long tmp___7 ; uint32_t tmp___8 ; long tmp___9 ; long tmp___10 ; uint32_t tmp___11 ; struct _ddebug descriptor___0 ; uint32_t tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; struct task_struct *tmp___15 ; struct ubifs_inode *tmp___16 ; long tmp___17 ; unsigned int tmp___18 ; long tmp___19 ; long tmp___20 ; uint32_t tmp___21 ; struct task_struct *tmp___22 ; { over = 0; dir = (file->f_path.dentry)->d_inode; c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; descriptor.modname = "ubifs"; descriptor.function = "ubifs_readdir"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dir ino %lu, f_pos %#llx\n"; descriptor.lineno = 478U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dir ino %lu, f_pos %#llx\n", tmp->pid, dir->i_ino, file->f_pos); } else { } if (file->f_pos > 536870911LL || file->f_pos == 2LL) { return (0); } else { } if (file->f_pos == 0LL) { tmp___2 = ldv__builtin_expect((unsigned long )file->private_data != (unsigned long )((void *)0), 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_readdir", 489, tmp___1->pid); dump_stack(); } else { } over = (*filldir)(dirent, ".", 1, 0LL, (u64 )dir->i_ino, 4U); if (over != 0) { return (0); } else { } file->f_pos = 1LL; } else { } if (file->f_pos == 1LL) { tmp___4 = ldv__builtin_expect((unsigned long )file->private_data != (unsigned long )((void *)0), 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_readdir", 497, tmp___3->pid); dump_stack(); } else { } tmp___5 = parent_ino(file->f_path.dentry); over = (*filldir)(dirent, "..", 2, 1LL, (u64 )tmp___5, 4U); if (over != 0) { return (0); } else { } lowest_dent_key((struct ubifs_info const *)c, & key, dir->i_ino); nm.name = 0; dent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___7 = IS_ERR((void const *)dent); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)dent); err = (int )tmp___6; goto out; } else { } tmp___8 = key_hash_flash((struct ubifs_info const *)c, (void const *)(& dent->key)); file->f_pos = (loff_t )tmp___8; file->private_data = (void *)dent; } else { } dent = (struct ubifs_dent_node *)file->private_data; if ((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0)) { dent_key_init_hash((struct ubifs_info const *)c, & key, dir->i_ino, (uint32_t )file->f_pos); nm.name = 0; dent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___10 = IS_ERR((void const *)dent); if (tmp___10 != 0L) { tmp___9 = PTR_ERR((void const *)dent); err = (int )tmp___9; goto out; } else { } tmp___11 = key_hash_flash((struct ubifs_info const *)c, (void const *)(& dent->key)); file->f_pos = (loff_t )tmp___11; file->private_data = (void *)dent; } else { } ldv_27689: descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_readdir"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): feed \'%s\', ino %llu, new f_pos %#x\n"; descriptor___0.lineno = 537U; descriptor___0.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___14 != 0L) { tmp___12 = key_hash_flash((struct ubifs_info const *)c, (void const *)(& dent->key)); tmp___13 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): feed \'%s\', ino %llu, new f_pos %#x\n", tmp___13->pid, (__u8 *)(& dent->name), dent->inum, tmp___12); } else { } tmp___16 = ubifs_inode((struct inode const *)dir); tmp___17 = ldv__builtin_expect(dent->ch.sqnum <= tmp___16->creat_sqnum, 0L); if (tmp___17 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_readdir", 539, tmp___15->pid); dump_stack(); } else { } nm.ldv_7607.ldv_7605.len = (u32 )dent->nlen; tmp___18 = vfs_dent_type((int )dent->type); over = (*filldir)(dirent, (char const *)(& dent->name), (int )nm.ldv_7607.ldv_7605.len, file->f_pos, dent->inum, tmp___18); if (over != 0) { return (0); } else { } key_read((struct ubifs_info const *)c, (void const *)(& dent->key), & key); nm.name = (unsigned char const *)(& dent->name); dent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___20 = IS_ERR((void const *)dent); if (tmp___20 != 0L) { tmp___19 = PTR_ERR((void const *)dent); err = (int )tmp___19; goto out; } else { } kfree((void const *)file->private_data); tmp___21 = key_hash_flash((struct ubifs_info const *)c, (void const *)(& dent->key)); file->f_pos = (loff_t )tmp___21; file->private_data = (void *)dent; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared", 560, 0); _cond_resched(); goto ldv_27689; out: ; if (err != -2) { tmp___22 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot find next direntry, error %d\n", tmp___22->pid, "ubifs_readdir", err); return (err); } else { } kfree((void const *)file->private_data); file->private_data = 0; file->f_pos = 2LL; return (0); } } static loff_t ubifs_dir_llseek(struct file *file , loff_t offset , int whence ) { loff_t tmp ; { kfree((void const *)file->private_data); file->private_data = 0; tmp = generic_file_llseek(file, offset, whence); return (tmp); } } static int ubifs_dir_release(struct inode *dir , struct file *file ) { { kfree((void const *)file->private_data); file->private_data = 0; return (0); } } static void lock_2_inodes(struct inode *inode1 , struct inode *inode2 ) { struct ubifs_inode *tmp ; struct ubifs_inode *tmp___0 ; { tmp = ubifs_inode((struct inode const *)inode1); ldv_mutex_lock_nested_138(& tmp->ui_mutex, 0U); tmp___0 = ubifs_inode((struct inode const *)inode2); ldv_mutex_lock_nested_139(& tmp___0->ui_mutex, 1U); return; } } static void unlock_2_inodes(struct inode *inode1 , struct inode *inode2 ) { struct ubifs_inode *tmp ; struct ubifs_inode *tmp___0 ; { tmp = ubifs_inode((struct inode const *)inode2); ldv_mutex_unlock_140(& tmp->ui_mutex); tmp___0 = ubifs_inode((struct inode const *)inode1); ldv_mutex_unlock_141(& tmp___0->ui_mutex); return; } } static int ubifs_link(struct dentry *old_dentry , struct inode *dir , struct dentry *dentry ) { struct ubifs_info *c ; struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp___0 ; int err ; int sz_change ; struct ubifs_budget_req req ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; long tmp___8 ; struct timespec tmp___9 ; { c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; inode = old_dentry->d_inode; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; tmp___0 = ubifs_inode((struct inode const *)dir); dir_ui = tmp___0; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 2U; req.dirtied_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )ui->data_len) + 7U)) & 32760U; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_link"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\' to ino %lu (nlink %d) in dir ino %lu\n"; descriptor.lineno = 635U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\' to ino %lu (nlink %d) in dir ino %lu\n", tmp___1->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, inode->i_ino, inode->ldv_13285.i_nlink, dir->i_ino); } else { } tmp___4 = mutex_is_locked(& dir->i_mutex); tmp___5 = ldv__builtin_expect(tmp___4 == 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_link", 636, tmp___3->pid); dump_stack(); } else { } tmp___7 = mutex_is_locked(& inode->i_mutex); tmp___8 = ldv__builtin_expect(tmp___7 == 0, 0L); if (tmp___8 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_link", 637, tmp___6->pid); dump_stack(); } else { } err = dbg_check_synced_i_size((struct ubifs_info const *)c, inode); if (err != 0) { return (err); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } lock_2_inodes(dir, inode); inc_nlink(inode); ihold(inode); inode->i_ctime = ubifs_current_time(inode); dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___9 = inode->i_ctime; dir->i_ctime = tmp___9; dir->i_mtime = tmp___9; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 0, 0); if (err != 0) { goto out_cancel; } else { } unlock_2_inodes(dir, inode); ubifs_release_budget(c, & req); d_instantiate(dentry, inode); return (0); out_cancel: dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; drop_nlink(inode); unlock_2_inodes(dir, inode); ubifs_release_budget(c, & req); iput(inode); return (err); } } static int ubifs_unlink(struct inode *dir , struct dentry *dentry ) { struct ubifs_info *c ; struct inode *inode ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp ; int sz_change ; int err ; int budgeted ; struct ubifs_budget_req req ; unsigned int saved_nlink ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; struct timespec tmp___8 ; unsigned char tmp___9 ; { c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; inode = dentry->d_inode; tmp = ubifs_inode((struct inode const *)dir); dir_ui = tmp; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; budgeted = 1; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = 1U; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 2U; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; saved_nlink = inode->ldv_13285.i_nlink; descriptor.modname = "ubifs"; descriptor.function = "ubifs_unlink"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\' from ino %lu (nlink %d) in dir ino %lu\n"; descriptor.lineno = 692U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\' from ino %lu (nlink %d) in dir ino %lu\n", tmp___0->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, inode->i_ino, inode->ldv_13285.i_nlink, dir->i_ino); } else { } tmp___3 = mutex_is_locked(& dir->i_mutex); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unlink", 693, tmp___2->pid); dump_stack(); } else { } tmp___6 = mutex_is_locked(& inode->i_mutex); tmp___7 = ldv__builtin_expect(tmp___6 == 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unlink", 694, tmp___5->pid); dump_stack(); } else { } err = dbg_check_synced_i_size((struct ubifs_info const *)c, inode); if (err != 0) { return (err); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { if (err != -28) { return (err); } else { } budgeted = 0; } else { } lock_2_inodes(dir, inode); inode->i_ctime = ubifs_current_time(dir); drop_nlink(inode); dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___8 = inode->i_ctime; dir->i_ctime = tmp___8; dir->i_mtime = tmp___8; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 1, 0); if (err != 0) { goto out_cancel; } else { } unlock_2_inodes(dir, inode); if (budgeted != 0) { ubifs_release_budget(c, & req); } else { tmp___9 = 0U; c->bi.nospace_rp = tmp___9; c->bi.nospace = tmp___9; __asm__ volatile ("": : : "memory"); } return (0); out_cancel: dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; set_nlink(inode, saved_nlink); unlock_2_inodes(dir, inode); if (budgeted != 0) { ubifs_release_budget(c, & req); } else { } return (err); } } static int check_dir_empty(struct ubifs_info *c , struct inode *dir ) { struct qstr nm ; struct ubifs_dent_node *dent ; union ubifs_key key ; int err ; long tmp ; long tmp___0 ; { nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = 0U; nm.name = 0; lowest_dent_key((struct ubifs_info const *)c, & key, dir->i_ino); dent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___0 = IS_ERR((void const *)dent); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)dent); err = (int )tmp; if (err == -2) { err = 0; } else { } } else { kfree((void const *)dent); err = -39; } return (err); } } static int ubifs_rmdir(struct inode *dir , struct dentry *dentry ) { struct ubifs_info *c ; struct inode *inode ; int sz_change ; int err ; int budgeted ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp ; struct ubifs_budget_req req ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; struct timespec tmp___8 ; unsigned char tmp___9 ; { c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; inode = dentry->d_inode; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; budgeted = 1; tmp = ubifs_inode((struct inode const *)dir); dir_ui = tmp; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = 1U; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 2U; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_rmdir"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): directory \'%.*s\', ino %lu in dir ino %lu\n"; descriptor.lineno = 781U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): directory \'%.*s\', ino %lu in dir ino %lu\n", tmp___0->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, inode->i_ino, dir->i_ino); } else { } tmp___3 = mutex_is_locked(& dir->i_mutex); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rmdir", 782, tmp___2->pid); dump_stack(); } else { } tmp___6 = mutex_is_locked(& inode->i_mutex); tmp___7 = ldv__builtin_expect(tmp___6 == 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rmdir", 783, tmp___5->pid); dump_stack(); } else { } err = check_dir_empty(c, dentry->d_inode); if (err != 0) { return (err); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { if (err != -28) { return (err); } else { } budgeted = 0; } else { } lock_2_inodes(dir, inode); inode->i_ctime = ubifs_current_time(dir); clear_nlink(inode); drop_nlink(dir); dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___8 = inode->i_ctime; dir->i_ctime = tmp___8; dir->i_mtime = tmp___8; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 1, 0); if (err != 0) { goto out_cancel; } else { } unlock_2_inodes(dir, inode); if (budgeted != 0) { ubifs_release_budget(c, & req); } else { tmp___9 = 0U; c->bi.nospace_rp = tmp___9; c->bi.nospace = tmp___9; __asm__ volatile ("": : : "memory"); } return (0); out_cancel: dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; inc_nlink(dir); set_nlink(inode, 2U); unlock_2_inodes(dir, inode); if (budgeted != 0) { ubifs_release_budget(c, & req); } else { } return (err); } } static int ubifs_mkdir(struct inode *dir , struct dentry *dentry , umode_t mode ) { struct inode *inode ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp ; struct ubifs_info *c ; int err ; int sz_change ; struct ubifs_budget_req req ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct timespec tmp___4 ; struct task_struct *tmp___5 ; { tmp = ubifs_inode((struct inode const *)dir); dir_ui = tmp; c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = (unsigned char)0; req.new_ino = 1U; req.new_ino_d = (unsigned short)0; req.dirtied_ino = (unsigned char)0; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_mkdir"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\', mode %#hx in dir ino %lu\n"; descriptor.lineno = 841U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\', mode %#hx in dir ino %lu\n", tmp___0->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, (int )mode, dir->i_ino); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } inode = ubifs_new_inode(c, (struct inode const *)dir, (int )((unsigned int )mode | 16384U)); tmp___3 = IS_ERR((void const *)inode); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)inode); err = (int )tmp___2; goto out_budg; } else { } ldv_mutex_lock_142(& dir_ui->ui_mutex); insert_inode_hash(inode); inc_nlink(inode); inc_nlink(dir); dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___4 = inode->i_ctime; dir->i_ctime = tmp___4; dir->i_mtime = tmp___4; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 0, 0); if (err != 0) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot create directory, error %d\n", tmp___5->pid, "ubifs_mkdir", err); goto out_cancel; } else { } ldv_mutex_unlock_143(& dir_ui->ui_mutex); ubifs_release_budget(c, & req); d_instantiate(dentry, inode); return (0); out_cancel: dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; drop_nlink(dir); ldv_mutex_unlock_144(& dir_ui->ui_mutex); make_bad_inode(inode); iput(inode); out_budg: ubifs_release_budget(c, & req); return (err); } } static int ubifs_mknod(struct inode *dir , struct dentry *dentry , umode_t mode , dev_t rdev ) { struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp ; struct ubifs_info *c ; union ubifs_dev_desc *dev ; int sz_change ; int err ; int devlen ; struct ubifs_budget_req req ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; void *tmp___3 ; long tmp___4 ; long tmp___5 ; struct ubifs_inode *tmp___6 ; loff_t tmp___7 ; struct timespec tmp___8 ; { tmp = ubifs_inode((struct inode const *)dir); dir_ui = tmp; c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; dev = 0; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; devlen = 0; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = (unsigned char)0; req.new_ino = 1U; req.new_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )devlen) + 7U)) & 8184U; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_mknod"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\' in dir ino %lu\n"; descriptor.lineno = 903U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\' in dir ino %lu\n", tmp___0->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, dir->i_ino); } else { } tmp___2 = new_valid_dev(rdev); if (tmp___2 == 0) { return (-22); } else { } if (((int )mode & 61440) == 24576 || ((int )mode & 61440) == 8192) { tmp___3 = kmalloc(8UL, 80U); dev = (union ubifs_dev_desc *)tmp___3; if ((unsigned long )dev == (unsigned long )((union ubifs_dev_desc *)0)) { return (-12); } else { } devlen = ubifs_encode_dev(dev, rdev); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { kfree((void const *)dev); return (err); } else { } inode = ubifs_new_inode(c, (struct inode const *)dir, (int )mode); tmp___5 = IS_ERR((void const *)inode); if (tmp___5 != 0L) { kfree((void const *)dev); tmp___4 = PTR_ERR((void const *)inode); err = (int )tmp___4; goto out_budg; } else { } init_special_inode(inode, (int )inode->i_mode, rdev); tmp___6 = ubifs_inode((struct inode const *)inode); tmp___7 = (loff_t )devlen; tmp___6->ui_size = tmp___7; inode->i_size = tmp___7; ui = ubifs_inode((struct inode const *)inode); ui->data = (void *)dev; ui->data_len = devlen; ldv_mutex_lock_145(& dir_ui->ui_mutex); dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___8 = inode->i_ctime; dir->i_ctime = tmp___8; dir->i_mtime = tmp___8; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 0, 0); if (err != 0) { goto out_cancel; } else { } ldv_mutex_unlock_146(& dir_ui->ui_mutex); ubifs_release_budget(c, & req); insert_inode_hash(inode); d_instantiate(dentry, inode); return (0); out_cancel: dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; ldv_mutex_unlock_147(& dir_ui->ui_mutex); make_bad_inode(inode); iput(inode); out_budg: ubifs_release_budget(c, & req); return (err); } } static int ubifs_symlink(struct inode *dir , struct dentry *dentry , char const *symname ) { struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *dir_ui ; struct ubifs_inode *tmp ; struct ubifs_info *c ; int err ; int len ; size_t tmp___0 ; int sz_change ; struct ubifs_budget_req req ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; size_t __len ; void *__ret ; struct ubifs_inode *tmp___5 ; loff_t tmp___6 ; struct timespec tmp___7 ; { tmp = ubifs_inode((struct inode const *)dir); dir_ui = tmp; c = (struct ubifs_info *)(dir->i_sb)->s_fs_info; tmp___0 = strlen(symname); len = (int )tmp___0; sz_change = (int )(dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = (unsigned char)0; req.new_ino = 1U; req.new_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )len) + 7U)) & 8184U; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_symlink"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\', target \'%s\' in dir ino %lu\n"; descriptor.lineno = 978U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\', target \'%s\' in dir ino %lu\n", tmp___1->pid, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, symname, dir->i_ino); } else { } if (len > 4096) { return (-36); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } inode = ubifs_new_inode(c, (struct inode const *)dir, 41471); tmp___4 = IS_ERR((void const *)inode); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)inode); err = (int )tmp___3; goto out_budg; } else { } ui = ubifs_inode((struct inode const *)inode); ui->data = kmalloc((size_t )(len + 1), 80U); if ((unsigned long )ui->data == (unsigned long )((void *)0)) { err = -12; goto out_inode; } else { } __len = (size_t )len; __ret = memcpy(ui->data, (void const *)symname, __len); *((char *)ui->data + (unsigned long )len) = 0; ui->data_len = len; tmp___5 = ubifs_inode((struct inode const *)inode); tmp___6 = (loff_t )len; tmp___5->ui_size = tmp___6; inode->i_size = tmp___6; ldv_mutex_lock_148(& dir_ui->ui_mutex); dir->i_size = dir->i_size + (loff_t )sz_change; dir_ui->ui_size = dir->i_size; tmp___7 = inode->i_ctime; dir->i_ctime = tmp___7; dir->i_mtime = tmp___7; err = ubifs_jnl_update(c, (struct inode const *)dir, (struct qstr const *)(& dentry->d_name), (struct inode const *)inode, 0, 0); if (err != 0) { goto out_cancel; } else { } ldv_mutex_unlock_149(& dir_ui->ui_mutex); ubifs_release_budget(c, & req); insert_inode_hash(inode); d_instantiate(dentry, inode); return (0); out_cancel: dir->i_size = dir->i_size - (loff_t )sz_change; dir_ui->ui_size = dir->i_size; ldv_mutex_unlock_150(& dir_ui->ui_mutex); out_inode: make_bad_inode(inode); iput(inode); out_budg: ubifs_release_budget(c, & req); return (err); } } static void lock_3_inodes(struct inode *inode1 , struct inode *inode2 , struct inode *inode3 ) { struct ubifs_inode *tmp ; struct ubifs_inode *tmp___0 ; struct ubifs_inode *tmp___1 ; { tmp = ubifs_inode((struct inode const *)inode1); ldv_mutex_lock_nested_151(& tmp->ui_mutex, 0U); if ((unsigned long )inode2 != (unsigned long )inode1) { tmp___0 = ubifs_inode((struct inode const *)inode2); ldv_mutex_lock_nested_152(& tmp___0->ui_mutex, 1U); } else { } if ((unsigned long )inode3 != (unsigned long )((struct inode *)0)) { tmp___1 = ubifs_inode((struct inode const *)inode3); ldv_mutex_lock_nested_153(& tmp___1->ui_mutex, 2U); } else { } return; } } static void unlock_3_inodes(struct inode *inode1 , struct inode *inode2 , struct inode *inode3 ) { struct ubifs_inode *tmp ; struct ubifs_inode *tmp___0 ; struct ubifs_inode *tmp___1 ; { if ((unsigned long )inode3 != (unsigned long )((struct inode *)0)) { tmp = ubifs_inode((struct inode const *)inode3); ldv_mutex_unlock_154(& tmp->ui_mutex); } else { } if ((unsigned long )inode1 != (unsigned long )inode2) { tmp___0 = ubifs_inode((struct inode const *)inode2); ldv_mutex_unlock_155(& tmp___0->ui_mutex); } else { } tmp___1 = ubifs_inode((struct inode const *)inode1); ldv_mutex_unlock_156(& tmp___1->ui_mutex); return; } } static int ubifs_rename(struct inode *old_dir , struct dentry *old_dentry , struct inode *new_dir , struct dentry *new_dentry ) { struct ubifs_info *c ; struct inode *old_inode ; struct inode *new_inode___0 ; struct ubifs_inode *old_inode_ui ; struct ubifs_inode *tmp ; int err ; int release ; int sync ; int move ; int is_dir ; int unlink ; int new_sz ; int old_sz ; struct ubifs_budget_req req ; struct ubifs_budget_req ino_req ; struct timespec time ; unsigned int saved_nlink ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; int tmp___9 ; long tmp___10 ; struct ubifs_inode *tmp___11 ; struct timespec tmp___12 ; struct timespec tmp___13 ; struct ubifs_inode *tmp___14 ; struct ubifs_inode *tmp___15 ; struct ubifs_inode *tmp___16 ; { c = (struct ubifs_info *)(old_dir->i_sb)->s_fs_info; old_inode = old_dentry->d_inode; new_inode___0 = new_dentry->d_inode; tmp = ubifs_inode((struct inode const *)old_inode); old_inode_ui = tmp; sync = 0; move = (unsigned long )new_dir != (unsigned long )old_dir; is_dir = ((int )old_inode->i_mode & 61440) == 16384; unlink = (unsigned long )new_inode___0 != (unsigned long )((struct inode *)0); new_sz = (int )(new_dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; old_sz = (int )(old_dentry->d_name.ldv_7607.ldv_7605.len + 64U) & -8; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = 1U; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 3U; req.dirtied_ino_d = (unsigned short)0; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; ino_req.fast = (unsigned char)0; ino_req.recalculate = (unsigned char)0; ino_req.new_page = (unsigned char)0; ino_req.dirtied_page = (unsigned char)0; ino_req.new_dent = (unsigned char)0; ino_req.mod_dent = (unsigned char)0; ino_req.new_ino = (unsigned char)0; ino_req.new_ino_d = (unsigned short)0; ino_req.dirtied_ino = 1U; ino_req.dirtied_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )old_inode_ui->data_len) + 7U)) & 32760U; ino_req.idx_growth = 0; ino_req.data_growth = 0; ino_req.dd_growth = 0; saved_nlink = saved_nlink; descriptor.modname = "ubifs"; descriptor.function = "ubifs_rename"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/dir.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): dent \'%.*s\' ino %lu in dir ino %lu to dent \'%.*s\' in dir ino %lu\n"; descriptor.lineno = 1106U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): dent \'%.*s\' ino %lu in dir ino %lu to dent \'%.*s\' in dir ino %lu\n", tmp___0->pid, old_dentry->d_name.ldv_7607.ldv_7605.len, old_dentry->d_name.name, old_inode->i_ino, old_dir->i_ino, new_dentry->d_name.ldv_7607.ldv_7605.len, new_dentry->d_name.name, new_dir->i_ino); } else { } tmp___3 = mutex_is_locked(& old_dir->i_mutex); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rename", 1107, tmp___2->pid); dump_stack(); } else { } tmp___6 = mutex_is_locked(& new_dir->i_mutex); tmp___7 = ldv__builtin_expect(tmp___6 == 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rename", 1108, tmp___5->pid); dump_stack(); } else { } if (unlink != 0) { tmp___9 = mutex_is_locked(& new_inode___0->i_mutex); tmp___10 = ldv__builtin_expect(tmp___9 == 0, 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rename", 1110, tmp___8->pid); dump_stack(); } else { } } else { } if (unlink != 0 && is_dir != 0) { err = check_dir_empty(c, new_inode___0); if (err != 0) { return (err); } else { } } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } err = ubifs_budget_space(c, & ino_req); if (err != 0) { ubifs_release_budget(c, & req); return (err); } else { } lock_3_inodes(old_dir, new_dir, new_inode___0); time = ubifs_current_time(old_dir); old_inode->i_ctime = time; if (is_dir != 0) { if (move != 0) { drop_nlink(old_dir); if (unlink == 0) { inc_nlink(new_dir); } else { } } else if (unlink != 0) { drop_nlink(old_dir); } else { } } else { } old_dir->i_size = old_dir->i_size - (loff_t )old_sz; tmp___11 = ubifs_inode((struct inode const *)old_dir); tmp___11->ui_size = old_dir->i_size; tmp___12 = time; old_dir->i_ctime = tmp___12; old_dir->i_mtime = tmp___12; tmp___13 = time; new_dir->i_ctime = tmp___13; new_dir->i_mtime = tmp___13; if (unlink != 0) { saved_nlink = new_inode___0->ldv_13285.i_nlink; if (is_dir != 0) { clear_nlink(new_inode___0); } else { drop_nlink(new_inode___0); } new_inode___0->i_ctime = time; } else { new_dir->i_size = new_dir->i_size + (loff_t )new_sz; tmp___14 = ubifs_inode((struct inode const *)new_dir); tmp___14->ui_size = new_dir->i_size; } if (((old_inode->i_sb)->s_flags & 16UL) != 0UL || (int )old_inode->i_flags & 1) { sync = (((old_dir->i_sb)->s_flags & 144UL) != 0UL || (old_dir->i_flags & 65U) != 0U) || (((new_dir->i_sb)->s_flags & 144UL) != 0UL || (new_dir->i_flags & 65U) != 0U); if (unlink != 0 && (((new_inode___0->i_sb)->s_flags & 16UL) != 0UL || (int )new_inode___0->i_flags & 1)) { sync = 1; } else { } } else { } err = ubifs_jnl_rename(c, (struct inode const *)old_dir, (struct dentry const *)old_dentry, (struct inode const *)new_dir, (struct dentry const *)new_dentry, sync); if (err != 0) { goto out_cancel; } else { } unlock_3_inodes(old_dir, new_dir, new_inode___0); ubifs_release_budget(c, & req); ldv_mutex_lock_157(& old_inode_ui->ui_mutex); release = (int )old_inode_ui->dirty; mark_inode_dirty_sync(old_inode); ldv_mutex_unlock_158(& old_inode_ui->ui_mutex); if (release != 0) { ubifs_release_budget(c, & ino_req); } else { } if (((old_inode->i_sb)->s_flags & 16UL) != 0UL || (int )old_inode->i_flags & 1) { err = (*(((old_inode->i_sb)->s_op)->write_inode))(old_inode, 0); } else { } return (err); out_cancel: ; if (unlink != 0) { set_nlink(new_inode___0, saved_nlink); } else { new_dir->i_size = new_dir->i_size - (loff_t )new_sz; tmp___15 = ubifs_inode((struct inode const *)new_dir); tmp___15->ui_size = new_dir->i_size; } old_dir->i_size = old_dir->i_size + (loff_t )old_sz; tmp___16 = ubifs_inode((struct inode const *)old_dir); tmp___16->ui_size = old_dir->i_size; if (is_dir != 0) { if (move != 0) { inc_nlink(old_dir); if (unlink == 0) { drop_nlink(new_dir); } else { } } else if (unlink != 0) { inc_nlink(old_dir); } else { } } else { } unlock_3_inodes(old_dir, new_dir, new_inode___0); ubifs_release_budget(c, & ino_req); ubifs_release_budget(c, & req); return (err); } } int ubifs_getattr(struct vfsmount *mnt , struct dentry *dentry , struct kstat *stat ) { loff_t size ; struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; { inode = dentry->d_inode; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; ldv_mutex_lock_159(& ui->ui_mutex); generic_fillattr(inode, stat); stat->blksize = 4096UL; stat->size = ui->ui_size; if (((int )inode->i_mode & 61440) == 32768) { size = (loff_t )ui->xattr_size; size = stat->size + size; size = (size + 4095LL) & -4096LL; stat->blocks = (unsigned long long )(size >> 9); } else { stat->blocks = 0ULL; } ldv_mutex_unlock_160(& ui->ui_mutex); return (0); } } struct inode_operations const ubifs_dir_inode_operations = {& ubifs_lookup, 0, 0, 0, 0, 0, & ubifs_create, & ubifs_link, & ubifs_unlink, & ubifs_symlink, & ubifs_mkdir, & ubifs_rmdir, & ubifs_mknod, & ubifs_rename, & ubifs_setattr, & ubifs_getattr, & ubifs_setxattr, & ubifs_getxattr, & ubifs_listxattr, & ubifs_removexattr, 0, 0, 0}; struct file_operations const ubifs_dir_operations = {0, & ubifs_dir_llseek, & generic_read_dir, 0, 0, 0, & ubifs_readdir, 0, & ubifs_ioctl, & ubifs_compat_ioctl, 0, 0, 0, & ubifs_dir_release, & ubifs_fsync, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int main(void) { struct inode *var_group1 ; struct dentry *var_group2 ; unsigned int var_ubifs_lookup_3_p2 ; umode_t var_ubifs_create_4_p2 ; bool var_ubifs_create_4_p3 ; struct dentry *var_ubifs_link_11_p2 ; char const *var_ubifs_symlink_17_p2 ; umode_t var_ubifs_mkdir_15_p2 ; umode_t var_ubifs_mknod_16_p2 ; dev_t var_ubifs_mknod_16_p3 ; struct inode *var_ubifs_rename_20_p2 ; struct dentry *var_ubifs_rename_20_p3 ; struct vfsmount *var_group3 ; struct kstat *var_ubifs_getattr_21_p2 ; struct file *var_group4 ; loff_t var_ubifs_dir_llseek_7_p1 ; int var_ubifs_dir_llseek_7_p2 ; void *var_ubifs_readdir_6_p1 ; int (*var_ubifs_readdir_6_p2)(void * , char const * , int , loff_t , u64 , unsigned int ) ; int ldv_s_ubifs_dir_operations_file_operations ; int tmp ; int tmp___0 ; { ldv_s_ubifs_dir_operations_file_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_27911; ldv_27910: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); ubifs_lookup(var_group1, var_group2, var_ubifs_lookup_3_p2); goto ldv_27896; case 1: ldv_handler_precall(); ubifs_create(var_group1, var_group2, (int )var_ubifs_create_4_p2, (int )var_ubifs_create_4_p3); goto ldv_27896; case 2: ldv_handler_precall(); ubifs_link(var_group2, var_group1, var_ubifs_link_11_p2); goto ldv_27896; case 3: ldv_handler_precall(); ubifs_symlink(var_group1, var_group2, var_ubifs_symlink_17_p2); goto ldv_27896; case 4: ldv_handler_precall(); ubifs_unlink(var_group1, var_group2); goto ldv_27896; case 5: ldv_handler_precall(); ubifs_mkdir(var_group1, var_group2, (int )var_ubifs_mkdir_15_p2); goto ldv_27896; case 6: ldv_handler_precall(); ubifs_rmdir(var_group1, var_group2); goto ldv_27896; case 7: ldv_handler_precall(); ubifs_mknod(var_group1, var_group2, (int )var_ubifs_mknod_16_p2, var_ubifs_mknod_16_p3); goto ldv_27896; case 8: ldv_handler_precall(); ubifs_rename(var_group1, var_group2, var_ubifs_rename_20_p2, var_ubifs_rename_20_p3); goto ldv_27896; case 9: ldv_handler_precall(); ubifs_getattr(var_group3, var_group2, var_ubifs_getattr_21_p2); goto ldv_27896; case 10: ; if (ldv_s_ubifs_dir_operations_file_operations == 0) { ldv_handler_precall(); ubifs_dir_llseek(var_group4, var_ubifs_dir_llseek_7_p1, var_ubifs_dir_llseek_7_p2); ldv_s_ubifs_dir_operations_file_operations = ldv_s_ubifs_dir_operations_file_operations + 1; } else { } goto ldv_27896; case 11: ; if (ldv_s_ubifs_dir_operations_file_operations == 1) { ldv_handler_precall(); ubifs_dir_release(var_group1, var_group4); ldv_s_ubifs_dir_operations_file_operations = 0; } else { } goto ldv_27896; case 12: ldv_handler_precall(); ubifs_readdir(var_group4, var_ubifs_readdir_6_p1, var_ubifs_readdir_6_p2); goto ldv_27896; default: ; goto ldv_27896; } ldv_27896: ; ldv_27911: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0 || ldv_s_ubifs_dir_operations_file_operations != 0) { goto ldv_27910; } else { } ldv_check_final_state(); return 0; } } void ldv_mutex_lock_127(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_128(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_129(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_130(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_131(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_132(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_133(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_134(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_135(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_136(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_137(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_138(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_lock_nested_139(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_140(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_141(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_142(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_143(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_144(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_145(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_146(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_147(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_148(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_149(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_150(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_151(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_lock_nested_152(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_lock_nested_153(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_154(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_155(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_156(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_157(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_158(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_159(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_160(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int fls(int x ) { int r ; { __asm__ ("bsrl %1,%0": "=r" (r): "rm" (x), "0" (-1)); return (r + 1); } } __inline static bool is_power_of_2(unsigned long n ) { { return ((bool )(n != 0UL && ((n - 1UL) & n) == 0UL)); } } extern unsigned long simple_strtoul(char const * , char ** , unsigned int ) ; extern int sprintf(char * , char const * , ...) ; __inline static void INIT_LIST_HEAD(struct list_head *list ) { { list->next = list; list->prev = list; return; } } extern void list_del(struct list_head * ) ; __inline static int list_empty(struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)head->next) == (unsigned long )head); } } extern int strcmp(char const * , char const * ) ; extern char *strsep(char ** , char const * ) ; __inline static u64 div_u64_rem(u64 dividend , u32 divisor , u32 *remainder ) { { *remainder = (u32 )(dividend % (u64 )divisor); return (dividend / (u64 )divisor); } } __inline static u64 div_u64(u64 dividend , u32 divisor ) { u32 remainder ; u64 tmp ; { tmp = div_u64_rem(dividend, divisor, & remainder); return (tmp); } } __inline static void *ERR_CAST(void const *ptr ) { { return ((void *)ptr); } } extern void __mutex_init(struct mutex * , char const * , struct lock_class_key * ) ; void ldv_mutex_lock_nested_199(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_196(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_198(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_200(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_202(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_204(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_205(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_207(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_208(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_210(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_212(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_214(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_215(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_195(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_197(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_201(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_203(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_206(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_209(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_211(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_213(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_umount_mutex(struct mutex *lock ) ; extern void __raw_spin_lock_init(raw_spinlock_t * , char const * , struct lock_class_key * ) ; __inline static raw_spinlock_t *spinlock_check(spinlock_t *lock ) { { return (& lock->ldv_5961.rlock); } } extern void __init_waitqueue_head(wait_queue_head_t * , char const * , struct lock_class_key * ) ; extern void __init_rwsem(struct rw_semaphore * , char const * , struct lock_class_key * ) ; extern void call_rcu_sched(struct callback_head * , void (*)(struct callback_head * ) ) ; extern void rcu_barrier(void) ; extern void *vmalloc(unsigned long ) ; extern void vfree(void const * ) ; extern void kmem_cache_destroy(struct kmem_cache * ) ; extern void kmem_cache_free(struct kmem_cache * , void * ) ; extern void *kmem_cache_alloc(struct kmem_cache * , gfp_t ) ; void *ldv_zalloc(size_t size ) ; __inline static void *kzalloc(size_t size , gfp_t flags ) { void *tmp ; { tmp = kmalloc(size, flags | 32768U); return (tmp); } } __inline static kuid_t make_kuid(struct user_namespace *from , uid_t uid ) { { return (uid); } } __inline static kgid_t make_kgid(struct user_namespace *from , gid_t gid ) { { return (gid); } } extern struct module __this_module ; extern unsigned char const _ctype[] ; extern int hrtimer_cancel(struct hrtimer * ) ; extern int wake_up_process(struct task_struct * ) ; extern struct task_struct *kthread_create_on_node(int (*)(void * ) , void * , int , char const * , ...) ; extern int kthread_stop(struct task_struct * ) ; extern int match_token(char * , struct match_token const * , substring_t * ) ; extern char *match_strdup(substring_t const * ) ; extern int seq_printf(struct seq_file * , char const * , ...) ; __inline static dev_t new_decode_dev(u32 dev ) { unsigned int major ; unsigned int minor ; { major = (dev & 1048320U) >> 8; minor = (dev & 255U) | ((dev >> 12) & 1048320U); return ((major << 20) | minor); } } __inline static dev_t huge_decode_dev(u64 dev ) { dev_t tmp ; { tmp = new_decode_dev((u32 )dev); return (tmp); } } extern struct dentry *d_make_root(struct inode * ) ; __inline static struct dentry *dget_dlock(struct dentry *dentry ) { { if ((unsigned long )dentry != (unsigned long )((struct dentry *)0)) { dentry->d_count = dentry->d_count + 1U; } else { } return (dentry); } } __inline static struct dentry *dget(struct dentry *dentry ) { { if ((unsigned long )dentry != (unsigned long )((struct dentry *)0)) { spin_lock(& dentry->d_lock); dget_dlock(dentry); spin_unlock(& dentry->d_lock); } else { } return (dentry); } } extern void unregister_shrinker(struct shrinker * ) ; __inline static void i_uid_write(struct inode *inode , uid_t uid ) { { inode->i_uid = make_kuid(& init_user_ns, uid); return; } } __inline static void i_gid_write(struct inode *inode , gid_t gid ) { { inode->i_gid = make_kgid(& init_user_ns, gid); return; } } extern void kill_anon_super(struct super_block * ) ; extern void deactivate_locked_super(struct super_block * ) ; extern int set_anon_super(struct super_block * , void * ) ; extern struct super_block *sget(struct file_system_type * , int (*)(struct super_block * , void * ) , int (*)(struct super_block * , void * ) , int , void * ) ; extern int unregister_filesystem(struct file_system_type * ) ; extern int is_bad_inode(struct inode * ) ; extern struct inode *iget_locked(struct super_block * , unsigned long ) ; extern void unlock_new_inode(struct inode * ) ; extern void iget_failed(struct inode * ) ; extern void clear_inode(struct inode * ) ; extern int ubi_get_device_info(int , struct ubi_device_info * ) ; extern void ubi_get_volume_info(struct ubi_volume_desc * , struct ubi_volume_info * ) ; extern struct ubi_volume_desc *ubi_open_volume(int , int , int ) ; extern struct ubi_volume_desc *ubi_open_volume_nm(int , char const * , int ) ; extern struct ubi_volume_desc *ubi_open_volume_path(char const * , int ) ; extern void ubi_close_volume(struct ubi_volume_desc * ) ; extern int ubi_sync(int ) ; extern void truncate_inode_pages(struct address_space * , loff_t ) ; extern int bdi_init(struct backing_dev_info * ) ; extern void bdi_destroy(struct backing_dev_info * ) ; extern int bdi_register(struct backing_dev_info * , struct device * , char const * , ...) ; struct kmem_cache *ubifs_inode_slab ; struct super_operations const ubifs_super_operations ; struct ubifs_compressor *ubifs_compressors[3U] ; int ubifs_leb_unmap(struct ubifs_info *c , int lnum ) ; int ubifs_is_mapped(struct ubifs_info const *c , int lnum ) ; int ubifs_wbuf_init(struct ubifs_info *c , struct ubifs_wbuf *wbuf ) ; int ubifs_consolidate_log(struct ubifs_info *c ) ; long long ubifs_get_free_space(struct ubifs_info *c ) ; int ubifs_calc_min_idx_lebs(struct ubifs_info *c ) ; long long ubifs_reported_space(struct ubifs_info const *c , long long free ) ; void ubifs_tnc_close(struct ubifs_info *c ) ; int ubifs_bg_thread(void *info ) ; int ubifs_read_master(struct ubifs_info *c ) ; int ubifs_write_master(struct ubifs_info *c ) ; int ubifs_read_superblock(struct ubifs_info *c ) ; struct ubifs_sb_node *ubifs_read_sb_node(struct ubifs_info *c ) ; int ubifs_write_sb_node(struct ubifs_info *c , struct ubifs_sb_node *sup ) ; int ubifs_fixup_free_space(struct ubifs_info *c ) ; int ubifs_replay_journal(struct ubifs_info *c ) ; void ubifs_destroy_idx_gc(struct ubifs_info *c ) ; int ubifs_mount_orphans(struct ubifs_info *c , int unclean , int read_only ) ; int ubifs_clear_orphans(struct ubifs_info *c ) ; int ubifs_calc_lpt_geom(struct ubifs_info *c ) ; int ubifs_lpt_init(struct ubifs_info *c , int rd , int wr ) ; void ubifs_lpt_free(struct ubifs_info *c , int wr_only ) ; int ubifs_write_rcvrd_mst_node(struct ubifs_info *c ) ; int ubifs_recover_inl_heads(struct ubifs_info *c , void *sbuf ) ; int ubifs_clean_lebs(struct ubifs_info *c , void *sbuf ) ; int ubifs_rcvry_gc_commit(struct ubifs_info *c ) ; int ubifs_recover_size(struct ubifs_info *c ) ; void ubifs_destroy_size_tree(struct ubifs_info *c ) ; void ubifs_compressors_exit(void) ; int ubifs_debugging_init(struct ubifs_info *c ) ; void ubifs_debugging_exit(struct ubifs_info *c ) ; void ubifs_dump_inode(struct ubifs_info *c , struct inode const *inode ) ; void dbg_save_space_info(struct ubifs_info *c ) ; int dbg_check_space_info(struct ubifs_info *c ) ; int dbg_check_dir(struct ubifs_info *c , struct inode const *dir ) ; int dbg_check_idx_size(struct ubifs_info *c , long long idx_size ) ; int dbg_check_filesystem(struct ubifs_info *c ) ; int dbg_check_inode_size(struct ubifs_info *c , struct inode const *inode , loff_t size ) ; void dbg_debugfs_exit(void) ; int dbg_debugfs_init_fs(struct ubifs_info *c ) ; void dbg_debugfs_exit_fs(struct ubifs_info *c ) ; __inline static int ubifs_compr_present(int compr_type ) { struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; { tmp___0 = ldv__builtin_expect(compr_type < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_compr_present", 114, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(compr_type > 2, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_compr_present", 114, tmp->pid); dump_stack(); } else { } } return ((unsigned long )(ubifs_compressors[compr_type])->capi_name != (unsigned long )((char const *)0)); } } __inline static char const *ubifs_compr_name(int compr_type ) { struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; { tmp___0 = ldv__builtin_expect(compr_type < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_compr_name", 126, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(compr_type > 2, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_compr_name", 126, tmp->pid); dump_stack(); } else { } } return ((ubifs_compressors[compr_type])->name); } } __inline static int ubifs_wbuf_sync(struct ubifs_wbuf *wbuf ) { int err ; { ldv_mutex_lock_nested_199(& wbuf->io_mutex, (unsigned int )wbuf->jhead); err = ubifs_wbuf_sync_nolock(wbuf); ldv_mutex_unlock_200(& wbuf->io_mutex); return (err); } } __inline static int ubifs_idx_node_sz(struct ubifs_info const *c , int child_cnt ) { { return ((int )((unsigned int )((unsigned long )c->key_len + 12UL) * (unsigned int )((unsigned long )child_cnt) + 28U)); } } __inline static unsigned long long key_max_inode_size(struct ubifs_info const *c ) { { switch (c->key_fmt) { case 0: ; return (2199023255552ULL); default: ; return (0ULL); } } } static struct shrinker ubifs_shrinker_info = {& ubifs_shrinker, 2, 0L, {0, 0}, {0L}}; static int validate_inode(struct ubifs_info *c , struct inode const *inode ) { int err ; struct ubifs_inode const *ui ; struct ubifs_inode *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; char const *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; { tmp = ubifs_inode(inode); ui = (struct ubifs_inode const *)tmp; if ((long long )inode->i_size > c->max_inode_sz) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: inode is too large (%lld)\n", tmp___0->pid, "validate_inode", inode->i_size); return (1); } else { } if ((int )ui->compr_type < 0 || (int )ui->compr_type > 2) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: unknown compression type %d\n", tmp___1->pid, "validate_inode", (int )ui->compr_type); return (2); } else { } if ((unsigned int )ui->xattr_names + (unsigned int )ui->xattr_cnt > 65536U) { return (3); } else { } if ((int )ui->data_len < 0 || (int )ui->data_len > 4096) { return (4); } else { } if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U && ((int )inode->i_mode & 61440) != 32768) { return (5); } else { } tmp___4 = ubifs_compr_present((int )ui->compr_type); if (tmp___4 == 0) { tmp___2 = ubifs_compr_name((int )ui->compr_type); tmp___3 = get_current(); printk("\fUBIFS warning (pid %d): %s: inode %lu uses \'%s\' compression, but it was not compiled in\n", tmp___3->pid, "validate_inode", inode->i_ino, tmp___2); } else { } err = dbg_check_dir(c, inode); return (err); } } struct inode *ubifs_iget(struct super_block *sb , unsigned long inum ) { int err ; union ubifs_key key ; struct ubifs_ino_node *ino ; struct ubifs_info *c ; struct inode *inode ; struct ubifs_inode *ui ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; loff_t tmp___3 ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; dev_t rdev ; union ubifs_dev_desc *dev ; size_t __len___1 ; void *__ret___1 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; void *tmp___6 ; { c = (struct ubifs_info *)sb->s_fs_info; descriptor.modname = "ubifs"; descriptor.function = "ubifs_iget"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): inode %lu\n"; descriptor.lineno = 229U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): inode %lu\n", tmp->pid, inum); } else { } inode = iget_locked(sb, inum); if ((unsigned long )inode == (unsigned long )((struct inode *)0)) { tmp___1 = ERR_PTR(-12L); return ((struct inode *)tmp___1); } else { } if ((inode->i_state & 8UL) == 0UL) { return (inode); } else { } ui = ubifs_inode((struct inode const *)inode); tmp___2 = kmalloc(4256UL, 80U); ino = (struct ubifs_ino_node *)tmp___2; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { err = -12; goto out; } else { } ino_key_init((struct ubifs_info const *)c, & key, inode->i_ino); err = ubifs_tnc_lookup(c, (union ubifs_key const *)(& key), (void *)ino); if (err != 0) { goto out_ino; } else { } inode->i_flags = inode->i_flags | 130U; set_nlink(inode, ino->nlink); i_uid_write(inode, ino->uid); i_gid_write(inode, ino->gid); inode->i_atime.tv_sec = (__kernel_time_t )ino->atime_sec; inode->i_atime.tv_nsec = (long )ino->atime_nsec; inode->i_mtime.tv_sec = (__kernel_time_t )ino->mtime_sec; inode->i_mtime.tv_nsec = (long )ino->mtime_nsec; inode->i_ctime.tv_sec = (__kernel_time_t )ino->ctime_sec; inode->i_ctime.tv_nsec = (long )ino->ctime_nsec; inode->i_mode = (umode_t )ino->mode; inode->i_size = (loff_t )ino->size; ui->data_len = (int )ino->data_len; ui->flags = (int )ino->flags; ui->compr_type = (unsigned char )ino->compr_type; ui->creat_sqnum = ino->creat_sqnum; ui->xattr_cnt = ino->xattr_cnt; ui->xattr_size = ino->xattr_size; ui->xattr_names = ino->xattr_names; tmp___3 = inode->i_size; ui->ui_size = tmp___3; ui->synced_i_size = tmp___3; ui->xattr = (ui->flags & 32) != 0; err = validate_inode(c, (struct inode const *)inode); if (err != 0) { goto out_invalid; } else { } (inode->i_mapping)->backing_dev_info = & c->bdi; switch ((int )inode->i_mode & 61440) { case 32768: (inode->i_mapping)->a_ops = & ubifs_file_address_operations; inode->i_op = & ubifs_file_inode_operations; inode->i_fop = & ubifs_file_operations; if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { ui->data = kmalloc((size_t )(ui->data_len + 1), 80U); if ((unsigned long )ui->data == (unsigned long )((void *)0)) { err = -12; goto out_ino; } else { } __len = (size_t )ui->data_len; __ret = memcpy(ui->data, (void const *)(& ino->data), __len); *((char *)ui->data + (unsigned long )ui->data_len) = 0; } else if (ui->data_len != 0) { err = 10; goto out_invalid; } else { } goto ldv_28711; case 16384: inode->i_op = & ubifs_dir_inode_operations; inode->i_fop = & ubifs_dir_operations; if (ui->data_len != 0) { err = 11; goto out_invalid; } else { } goto ldv_28711; case 40960: inode->i_op = & ubifs_symlink_inode_operations; if (ui->data_len <= 0 || ui->data_len > 4096) { err = 12; goto out_invalid; } else { } ui->data = kmalloc((size_t )(ui->data_len + 1), 80U); if ((unsigned long )ui->data == (unsigned long )((void *)0)) { err = -12; goto out_ino; } else { } __len___0 = (size_t )ui->data_len; __ret___0 = memcpy(ui->data, (void const *)(& ino->data), __len___0); *((char *)ui->data + (unsigned long )ui->data_len) = 0; goto ldv_28711; case 24576: ; case 8192: ui->data = kmalloc(8UL, 80U); if ((unsigned long )ui->data == (unsigned long )((void *)0)) { err = -12; goto out_ino; } else { } dev = (union ubifs_dev_desc *)(& ino->data); if (ui->data_len == 4) { rdev = new_decode_dev(dev->new); } else if (ui->data_len == 8) { rdev = huge_decode_dev(dev->huge); } else { err = 13; goto out_invalid; } __len___1 = (size_t )ui->data_len; __ret___1 = memcpy(ui->data, (void const *)(& ino->data), __len___1); inode->i_op = & ubifs_file_inode_operations; init_special_inode(inode, (int )inode->i_mode, rdev); goto ldv_28711; case 49152: ; case 4096: inode->i_op = & ubifs_file_inode_operations; init_special_inode(inode, (int )inode->i_mode, 0U); if (ui->data_len != 0) { err = 14; goto out_invalid; } else { } goto ldv_28711; default: err = 15; goto out_invalid; } ldv_28711: kfree((void const *)ino); ubifs_set_inode_flags(inode); unlock_new_inode(inode); return (inode); out_invalid: tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu validation failed, error %d\n", tmp___4->pid, "ubifs_iget", inode->i_ino, err); ubifs_dump_node((struct ubifs_info const *)c, (void const *)ino); ubifs_dump_inode(c, (struct inode const *)inode); err = -22; out_ino: kfree((void const *)ino); out: tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: failed to read inode %lu, error %d\n", tmp___5->pid, "ubifs_iget", inode->i_ino, err); iget_failed(inode); tmp___6 = ERR_PTR((long )err); return ((struct inode *)tmp___6); } } static struct inode *ubifs_alloc_inode(struct super_block *sb ) { struct ubifs_inode *ui ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; { tmp = kmem_cache_alloc(ubifs_inode_slab, 80U); ui = (struct ubifs_inode *)tmp; if ((unsigned long )ui == (unsigned long )((struct ubifs_inode *)0)) { return (0); } else { } memset((void *)ui + 1032UL, 0, 328UL); __mutex_init(& ui->ui_mutex, "&ui->ui_mutex", & __key); spinlock_check(& ui->ui_lock); __raw_spin_lock_init(& ui->ui_lock.ldv_5961.rlock, "&(&ui->ui_lock)->rlock", & __key___0); return (& ui->vfs_inode); } } static void ubifs_i_callback(struct callback_head *head ) { struct inode *inode ; struct callback_head const *__mptr ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; { __mptr = (struct callback_head const *)head; inode = (struct inode *)__mptr + 0xfffffffffffffe28UL; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; kmem_cache_free(ubifs_inode_slab, (void *)ui); return; } } static void ubifs_destroy_inode(struct inode *inode ) { struct ubifs_inode *ui ; struct ubifs_inode *tmp ; { tmp = ubifs_inode((struct inode const *)inode); ui = tmp; kfree((void const *)ui->data); call_rcu_sched(& inode->ldv_13305.i_rcu, & ubifs_i_callback); return; } } static int ubifs_write_inode(struct inode *inode , struct writeback_control *wbc ) { int err ; struct ubifs_info *c ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; struct _ddebug descriptor ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; { err = 0; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)ui + 1060UL) != 0U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_inode", 418, tmp___0->pid); dump_stack(); } else { } tmp___2 = is_bad_inode(inode); if (tmp___2 != 0) { return (0); } else { } ldv_mutex_lock_203(& ui->ui_mutex); if ((unsigned int )*((unsigned char *)ui + 1060UL) == 0U) { ldv_mutex_unlock_204(& ui->ui_mutex); return (0); } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_write_inode"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): inode %lu, mode %#x, nlink %u\n"; descriptor.lineno = 440U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): inode %lu, mode %#x, nlink %u\n", tmp___3->pid, inode->i_ino, (int )inode->i_mode, inode->ldv_13285.i_nlink); } else { } if ((unsigned int )inode->ldv_13285.i_nlink != 0U) { err = ubifs_jnl_write_inode(c, (struct inode const *)inode); if (err != 0) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: can\'t write inode %lu, error %d\n", tmp___5->pid, "ubifs_write_inode", inode->i_ino, err); } else { err = dbg_check_inode_size(c, (struct inode const *)inode, ui->ui_size); } } else { } ui->dirty = 0U; ldv_mutex_unlock_205(& ui->ui_mutex); ubifs_release_dirty_inode_budget(c, ui); return (err); } } static void ubifs_evict_inode(struct inode *inode ) { int err ; struct ubifs_info *c ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; loff_t tmp___6 ; struct task_struct *tmp___7 ; unsigned char tmp___8 ; { c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { goto out; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_evict_inode"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): inode %lu, mode %#x\n"; descriptor.lineno = 470U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): inode %lu, mode %#x\n", tmp___0->pid, inode->i_ino, (int )inode->i_mode); } else { } tmp___3 = atomic_read((atomic_t const *)(& inode->i_count)); tmp___4 = ldv__builtin_expect(tmp___3 != 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_evict_inode", 471, tmp___2->pid); dump_stack(); } else { } truncate_inode_pages(& inode->i_data, 0LL); if ((unsigned int )inode->ldv_13285.i_nlink != 0U) { goto done; } else { } tmp___5 = is_bad_inode(inode); if (tmp___5 != 0) { goto out; } else { } tmp___6 = 0LL; inode->i_size = tmp___6; ui->ui_size = tmp___6; err = ubifs_jnl_delete_inode(c, (struct inode const *)inode); if (err != 0) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: can\'t delete inode %lu, error %d\n", tmp___7->pid, "ubifs_evict_inode", inode->i_ino, err); } else { } out: ; if ((unsigned int )*((unsigned char *)ui + 1060UL) != 0U) { ubifs_release_dirty_inode_budget(c, ui); } else { tmp___8 = 0U; c->bi.nospace_rp = tmp___8; c->bi.nospace = tmp___8; __asm__ volatile ("": : : "memory"); } done: clear_inode(inode); return; } } static void ubifs_dirty_inode(struct inode *inode , int flags ) { struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long tmp___2 ; struct _ddebug descriptor ; struct task_struct *tmp___3 ; long tmp___4 ; { tmp = ubifs_inode((struct inode const *)inode); ui = tmp; tmp___1 = mutex_is_locked(& ui->ui_mutex); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_dirty_inode", 507, tmp___0->pid); dump_stack(); } else { } if ((unsigned int )*((unsigned char *)ui + 1060UL) == 0U) { ui->dirty = 1U; descriptor.modname = "ubifs"; descriptor.function = "ubifs_dirty_inode"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): inode %lu\n"; descriptor.lineno = 510U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): inode %lu\n", tmp___3->pid, inode->i_ino); } else { } } else { } return; } } static int ubifs_statfs(struct dentry *dentry , struct kstatfs *buf ) { struct ubifs_info *c ; unsigned long long free ; __le32 *uuid ; long long tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; { c = (struct ubifs_info *)(dentry->d_sb)->s_fs_info; uuid = (__le32 *)(& c->uuid); tmp = ubifs_get_free_space(c); free = (unsigned long long )tmp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_statfs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): free space %lld bytes (%lld blocks)\n"; descriptor.lineno = 522U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): free space %lld bytes (%lld blocks)\n", tmp___0->pid, free, free >> 12); } else { } buf->f_type = 604313861L; buf->f_bsize = 4096L; buf->f_blocks = (u64 )c->block_cnt; buf->f_bfree = free >> 12; if ((unsigned long long )c->report_rp_size < free) { buf->f_bavail = (free - (unsigned long long )c->report_rp_size) >> 12; } else { buf->f_bavail = 0ULL; } buf->f_files = 0ULL; buf->f_ffree = 0ULL; buf->f_namelen = 255L; buf->f_fsid.val[0] = (int )(*uuid ^ *(uuid + 2UL)); buf->f_fsid.val[1] = (int )(*(uuid + 1UL) ^ *(uuid + 3UL)); tmp___3 = ldv__builtin_expect(buf->f_bfree > (u64 )c->block_cnt, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_statfs", 537, tmp___2->pid); dump_stack(); } else { } return (0); } } static int ubifs_show_options(struct seq_file *s , struct dentry *root ) { struct ubifs_info *c ; char const *tmp ; { c = (struct ubifs_info *)(root->d_sb)->s_fs_info; if ((unsigned int )*((unsigned char *)c + 5616UL) == 2U) { seq_printf(s, ",fast_unmount"); } else if ((unsigned int )*((unsigned char *)c + 5616UL) == 1U) { seq_printf(s, ",norm_unmount"); } else { } if ((unsigned int )*((unsigned char *)c + 5616UL) == 8U) { seq_printf(s, ",bulk_read"); } else if ((unsigned int )*((unsigned char *)c + 5616UL) == 4U) { seq_printf(s, ",no_bulk_read"); } else { } if ((unsigned int )*((unsigned char *)c + 5616UL) == 32U) { seq_printf(s, ",chk_data_crc"); } else if ((unsigned int )*((unsigned char *)c + 5616UL) == 16U) { seq_printf(s, ",no_chk_data_crc"); } else { } if ((unsigned int )*((unsigned char *)c + 5616UL) != 0U) { tmp = ubifs_compr_name((int )c->mount_opts.compr_type); seq_printf(s, ",compr=%s", tmp); } else { } return (0); } } static int ubifs_sync_fs(struct super_block *sb , int wait ) { int i ; int err ; struct ubifs_info *c ; int tmp ; { c = (struct ubifs_info *)sb->s_fs_info; if (wait == 0) { return (0); } else { } i = 0; goto ldv_28792; ldv_28791: err = ubifs_wbuf_sync(& (c->jheads + (unsigned long )i)->wbuf); if (err != 0) { return (err); } else { } i = i + 1; ldv_28792: ; if (c->jhead_cnt > i) { goto ldv_28791; } else { } err = ubifs_run_commit(c); if (err != 0) { return (err); } else { } tmp = ubi_sync(c->vi.ubi_num); return (tmp); } } static int init_constants_early(struct ubifs_info *c ) { struct task_struct *tmp ; int tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; bool tmp___5 ; int tmp___6 ; struct task_struct *tmp___7 ; bool tmp___8 ; int tmp___9 ; { if (c->vi.corrupted != 0) { tmp = get_current(); printk("\fUBIFS warning (pid %d): %s: UBI volume is corrupted - read-only mode\n", tmp->pid, "init_constants_early"); c->ro_media = 1U; } else { } if (c->di.ro_mode != 0) { printk("\rUBIFS: read-only UBI device\n"); c->ro_media = 1U; } else { } if (c->vi.vol_type == 4) { printk("\rUBIFS: static UBI volume - read-only mode\n"); c->ro_media = 1U; } else { } c->leb_cnt = c->vi.size; c->leb_size = c->vi.usable_leb_size; c->leb_start = c->di.leb_start; c->half_leb_size = c->leb_size / 2; c->min_io_size = c->di.min_io_size; tmp___0 = fls(c->min_io_size); c->min_io_shift = tmp___0 + -1; c->max_write_size = c->di.max_write_size; tmp___1 = fls(c->max_write_size); c->max_write_shift = tmp___1 + -1; if (c->leb_size <= 15359) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: too small LEBs (%d bytes), min. is %d bytes\n", tmp___2->pid, "init_constants_early", c->leb_size, 15360); return (-22); } else { } if (c->leb_cnt <= 16) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: too few LEBs (%d), min. is %d\n", tmp___3->pid, "init_constants_early", c->leb_cnt, 17); return (-22); } else { } tmp___5 = is_power_of_2((unsigned long )c->min_io_size); if (tmp___5) { tmp___6 = 0; } else { tmp___6 = 1; } if (tmp___6) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: bad min. I/O size %d\n", tmp___4->pid, "init_constants_early", c->min_io_size); return (-22); } else { } if (c->max_write_size < c->min_io_size || c->max_write_size % c->min_io_size != 0) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: bad write buffer size %d for %d min. I/O unit\n", tmp___7->pid, "init_constants_early", c->max_write_size, c->min_io_size); return (-22); } else { tmp___8 = is_power_of_2((unsigned long )c->max_write_size); if (tmp___8) { tmp___9 = 0; } else { tmp___9 = 1; } if (tmp___9) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: bad write buffer size %d for %d min. I/O unit\n", tmp___7->pid, "init_constants_early", c->max_write_size, c->min_io_size); return (-22); } else { } } if (c->min_io_size <= 7) { c->min_io_size = 8; c->min_io_shift = 3; if (c->max_write_size < c->min_io_size) { c->max_write_size = c->min_io_size; c->max_write_shift = c->min_io_shift; } else { } } else { } c->ref_node_alsz = (int )(((unsigned int )c->min_io_size + 63U) & - ((unsigned int )c->min_io_size)); c->mst_node_alsz = (int )(((unsigned int )c->min_io_size + 511U) & - ((unsigned int )c->min_io_size)); c->ranges[5].ldv_26105.len = 28; c->ranges[6].ldv_26105.len = 4096; c->ranges[7].ldv_26105.len = 512; c->ranges[8].ldv_26105.len = 64; c->ranges[4].ldv_26105.len = 56; c->ranges[10].ldv_26105.len = 32; c->ranges[0].ldv_26105.min_len = 160; c->ranges[0].max_len = 4256; c->ranges[11].ldv_26105.min_len = 40; c->ranges[11].max_len = c->leb_size; c->ranges[2].ldv_26105.min_len = 56; c->ranges[2].max_len = 312; c->ranges[3].ldv_26105.min_len = 56; c->ranges[3].max_len = 312; c->ranges[1].ldv_26105.min_len = 48; c->ranges[1].max_len = 4144; c->ranges[9].ldv_26105.min_len = 40; c->ranges[9].max_len = 2147483647; c->dead_wm = (int )(((unsigned int )c->min_io_size + 55U) & - ((unsigned int )c->min_io_size)); c->dark_wm = (int )(((unsigned int )c->min_io_size + 4255U) & - ((unsigned int )c->min_io_size)); c->leb_overhead = (int )((unsigned long )c->leb_size % 4144UL); c->max_bu_buf_len = 132608; if (c->max_bu_buf_len > c->leb_size) { c->max_bu_buf_len = c->leb_size; } else { } return (0); } } static int bud_wbuf_callback(struct ubifs_info *c , int lnum , int free , int pad ) { int tmp ; { tmp = ubifs_update_one_lp(c, lnum, free, pad, 0, 0); return (tmp); } } static int init_constants_sb(struct ubifs_info *c ) { int tmp ; int err ; long long tmp64 ; struct task_struct *tmp___0 ; u64 tmp___1 ; struct task_struct *tmp___2 ; { c->main_bytes = (long long )c->main_lebs * (long long )c->leb_size; c->max_znode_sz = (int )((unsigned int )((unsigned long )c->fanout + 2UL) * 32U); tmp = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); c->ranges[9].ldv_26105.min_len = tmp; c->min_idx_node_sz = (tmp + 7) & -8; tmp = ubifs_idx_node_sz((struct ubifs_info const *)c, c->fanout); c->ranges[9].max_len = tmp; c->max_idx_node_sz = (tmp + 7) & -8; tmp = (int )((unsigned int )((unsigned long )c->jhead_cnt) * 64U + 32U); tmp = ((c->min_io_size + -1) + tmp) & - c->min_io_size; if (c->leb_size < tmp) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: too small LEB size %d, at least %d needed\n", tmp___0->pid, "init_constants_sb", c->leb_size, tmp); return (-22); } else { } tmp64 = (c->max_bud_bytes + (long long )c->leb_size) + -1LL; tmp___1 = div_u64((u64 )tmp64, (u32 )c->leb_size); c->max_bud_cnt = (int )tmp___1; tmp = (c->ref_node_alsz * c->max_bud_cnt + c->leb_size) + -1; tmp = tmp / c->leb_size; tmp = tmp + 1; if (c->log_lebs < tmp) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: too small log %d LEBs, required min. %d LEBs\n", tmp___2->pid, "init_constants_sb", c->log_lebs, tmp); return (-22); } else { } c->bi.page_budget = 4144; c->bi.inode_budget = 160; c->bi.dent_budget = 312; c->bg_bud_bytes = c->max_bud_bytes * 13LL >> 4; tmp64 = (long long )(c->jhead_cnt + 1) * (long long )c->leb_size + 1LL; if (c->bg_bud_bytes < tmp64) { c->bg_bud_bytes = tmp64; } else { } if (c->max_bud_bytes < (long long )c->leb_size + tmp64) { c->max_bud_bytes = (long long )c->leb_size + tmp64; } else { } err = ubifs_calc_lpt_geom(c); if (err != 0) { return (err); } else { } c->idx_leb_size = c->leb_size - c->max_idx_node_sz; return (0); } } static void init_constants_master(struct ubifs_info *c ) { long long tmp64 ; { c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); c->report_rp_size = ubifs_reported_space((struct ubifs_info const *)c, c->rp_size); tmp64 = (long long )(((c->main_lebs + -4) - c->jhead_cnt) + 1); tmp64 = ((long long )c->leb_size - (long long )c->leb_overhead) * tmp64; tmp64 = ubifs_reported_space((struct ubifs_info const *)c, tmp64); c->block_cnt = (int )(tmp64 >> 12); return; } } static int take_gc_lnum(struct ubifs_info *c ) { int err ; struct task_struct *tmp ; { if (c->gc_lnum == -1) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: no LEB for GC\n", tmp->pid, "take_gc_lnum"); return (-22); } else { } err = ubifs_change_one_lp(c, c->gc_lnum, c->leb_size, 0, 16, 0, 0); return (err); } } static int alloc_wbufs(struct ubifs_info *c ) { int i ; int err ; void *tmp ; { tmp = kzalloc((unsigned long )c->jhead_cnt * 440UL, 208U); c->jheads = (struct ubifs_jhead *)tmp; if ((unsigned long )c->jheads == (unsigned long )((struct ubifs_jhead *)0)) { return (-12); } else { } i = 0; goto ldv_28826; ldv_28825: INIT_LIST_HEAD(& (c->jheads + (unsigned long )i)->buds_list); err = ubifs_wbuf_init(c, & (c->jheads + (unsigned long )i)->wbuf); if (err != 0) { return (err); } else { } (c->jheads + (unsigned long )i)->wbuf.sync_callback = & bud_wbuf_callback; (c->jheads + (unsigned long )i)->wbuf.jhead = i; (c->jheads + (unsigned long )i)->grouped = 1U; i = i + 1; ldv_28826: ; if (c->jhead_cnt > i) { goto ldv_28825; } else { } (c->jheads)->wbuf.no_timer = 1U; (c->jheads)->grouped = 0U; return (0); } } static void free_wbufs(struct ubifs_info *c ) { int i ; { if ((unsigned long )c->jheads != (unsigned long )((struct ubifs_jhead *)0)) { i = 0; goto ldv_28833; ldv_28832: kfree((void const *)(c->jheads + (unsigned long )i)->wbuf.buf); kfree((void const *)(c->jheads + (unsigned long )i)->wbuf.inodes); i = i + 1; ldv_28833: ; if (c->jhead_cnt > i) { goto ldv_28832; } else { } kfree((void const *)c->jheads); c->jheads = 0; } else { } return; } } static void free_orphans(struct ubifs_info *c ) { struct ubifs_orphan *orph ; struct list_head const *__mptr ; struct task_struct *tmp ; int tmp___0 ; { goto ldv_28840; ldv_28839: orph = c->orph_dnext; c->orph_dnext = orph->dnext; list_del(& orph->list); kfree((void const *)orph); ldv_28840: ; if ((unsigned long )c->orph_dnext != (unsigned long )((struct ubifs_orphan *)0)) { goto ldv_28839; } else { } goto ldv_28846; ldv_28845: __mptr = (struct list_head const *)c->orph_list.next; orph = (struct ubifs_orphan *)__mptr + 0xffffffffffffffe8UL; list_del(& orph->list); kfree((void const *)orph); tmp = get_current(); printk("\vUBIFS error (pid %d): %s: orphan list not empty at unmount\n", tmp->pid, "free_orphans"); ldv_28846: tmp___0 = list_empty((struct list_head const *)(& c->orph_list)); if (tmp___0 == 0) { goto ldv_28845; } else { } vfree((void const *)c->orph_buf); c->orph_buf = 0; return; } } static void free_buds(struct ubifs_info *c ) { struct rb_node *this ; struct ubifs_bud *bud ; struct rb_node const *__mptr ; { this = c->buds.rb_node; goto ldv_28856; ldv_28855: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; } else { __mptr = (struct rb_node const *)this; bud = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& bud->rb)) { this->rb_left = 0; } else { this->rb_right = 0; } } else { } kfree((void const *)bud); } ldv_28856: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_28855; } else { } return; } } static int check_volume_empty(struct ubifs_info *c ) { int lnum ; int err ; long tmp ; { c->empty = 1U; lnum = 0; goto ldv_28866; ldv_28865: err = ubifs_is_mapped((struct ubifs_info const *)c, lnum); tmp = ldv__builtin_expect(err < 0, 0L); if (tmp != 0L) { return (err); } else { } if (err == 1) { c->empty = 0U; goto ldv_28863; } else { } __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared", 1040, 0); _cond_resched(); lnum = lnum + 1; ldv_28866: ; if (c->leb_cnt > lnum) { goto ldv_28865; } else { } ldv_28863: ; return (0); } } static struct match_token const tokens[8U] = { {0, "fast_unmount"}, {1, "norm_unmount"}, {2, "bulk_read"}, {3, "no_bulk_read"}, {4, "chk_data_crc"}, {5, "no_chk_data_crc"}, {6, "compr=%s"}, {7, 0}}; static int parse_standard_option(char const *option ) { int tmp ; { printk("\rUBIFS: parse %s\n", option); tmp = strcmp(option, "sync"); if (tmp == 0) { return (16); } else { } return (0); } } static int ubifs_parse_options(struct ubifs_info *c , char *options , int is_remount ) { char *p ; substring_t args[3U] ; int token ; char *name ; char *tmp ; struct task_struct *tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; unsigned long flag ; struct super_block *sb ; int tmp___4 ; struct task_struct *tmp___5 ; { if ((unsigned long )options == (unsigned long )((char *)0)) { return (0); } else { } goto ldv_28888; ldv_28902: ; if ((int )((signed char )*p) == 0) { goto ldv_28888; } else { } token = match_token(p, (struct match_token const *)(& tokens), (substring_t *)(& args)); switch (token) { case 0: c->mount_opts.unmount_mode = 2U; goto ldv_28890; case 1: c->mount_opts.unmount_mode = 1U; goto ldv_28890; case 2: c->mount_opts.bulk_read = 2U; c->bulk_read = 1U; goto ldv_28890; case 3: c->mount_opts.bulk_read = 1U; c->bulk_read = 0U; goto ldv_28890; case 4: c->mount_opts.chk_data_crc = 2U; c->no_chk_data_crc = 0U; goto ldv_28890; case 5: c->mount_opts.chk_data_crc = 1U; c->no_chk_data_crc = 1U; goto ldv_28890; case 6: tmp = match_strdup((substring_t const *)(& args)); name = tmp; if ((unsigned long )name == (unsigned long )((char *)0)) { return (-12); } else { } tmp___3 = strcmp((char const *)name, "none"); if (tmp___3 == 0) { c->mount_opts.compr_type = 0U; } else { tmp___2 = strcmp((char const *)name, "lzo"); if (tmp___2 == 0) { c->mount_opts.compr_type = 1U; } else { tmp___1 = strcmp((char const *)name, "zlib"); if (tmp___1 == 0) { c->mount_opts.compr_type = 2U; } else { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: unknown compressor \"%s\"\n", tmp___0->pid, "ubifs_parse_options", name); kfree((void const *)name); return (-22); } } } kfree((void const *)name); c->mount_opts.override_compr = 1U; c->default_compr = c->mount_opts.compr_type; goto ldv_28890; default: sb = c->vfs_sb; tmp___4 = parse_standard_option((char const *)p); flag = (unsigned long )tmp___4; if (flag == 0UL) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: unrecognized mount option \"%s\" or missing value\n", tmp___5->pid, "ubifs_parse_options", p); return (-22); } else { } sb->s_flags = sb->s_flags | flag; goto ldv_28890; } ldv_28890: ; ldv_28888: p = strsep(& options, ","); if ((unsigned long )p != (unsigned long )((char *)0)) { goto ldv_28902; } else { } return (0); } } static void destroy_journal(struct ubifs_info *c ) { struct ubifs_unclean_leb *ucleb ; struct list_head const *__mptr ; int tmp ; struct ubifs_bud *bud ; struct list_head const *__mptr___0 ; int tmp___0 ; { goto ldv_28911; ldv_28910: __mptr = (struct list_head const *)c->unclean_leb_list.next; ucleb = (struct ubifs_unclean_leb *)__mptr; list_del(& ucleb->list); kfree((void const *)ucleb); ldv_28911: tmp = list_empty((struct list_head const *)(& c->unclean_leb_list)); if (tmp == 0) { goto ldv_28910; } else { } goto ldv_28917; ldv_28916: __mptr___0 = (struct list_head const *)c->old_buds.next; bud = (struct ubifs_bud *)__mptr___0 + 0xfffffffffffffff0UL; list_del(& bud->list); kfree((void const *)bud); ldv_28917: tmp___0 = list_empty((struct list_head const *)(& c->old_buds)); if (tmp___0 == 0) { goto ldv_28916; } else { } ubifs_destroy_idx_gc(c); ubifs_destroy_size_tree(c); ubifs_tnc_close(c); free_buds(c); return; } } static void bu_init(struct ubifs_info *c ) { struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; { tmp___0 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 2048UL) == 0U, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "bu_init", 1232, tmp->pid); dump_stack(); } else { } if ((unsigned long )c->bu.buf != (unsigned long )((void *)0)) { return; } else { } again: c->bu.buf = kmalloc((size_t )c->max_bu_buf_len, 720U); if ((unsigned long )c->bu.buf == (unsigned long )((void *)0)) { if (c->max_bu_buf_len > 131072) { c->max_bu_buf_len = 131072; goto again; } else { } tmp___1 = get_current(); printk("\fUBIFS warning (pid %d): %s: cannot allocate %d bytes of memory for bulk-read, disabling it\n", tmp___1->pid, "bu_init", c->max_bu_buf_len); c->mount_opts.bulk_read = 1U; c->bulk_read = 0U; return; } else { } return; } } static int check_free_space(struct ubifs_info *c ) { struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; { tmp___0 = ldv__builtin_expect(c->dark_wm <= 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "check_free_space", 1263, tmp->pid); dump_stack(); } else { } if (c->lst.total_free + c->lst.total_dirty < (long long )c->dark_wm) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: insufficient free space to mount in R/W mode\n", tmp___1->pid, "check_free_space"); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); ubifs_dump_lprops(c); return (-28); } else { } return (0); } } static int mount_ubifs(struct ubifs_info *c ) { int err ; long long x ; long long y ; size_t sz ; struct task_struct *tmp ; struct task_struct *tmp___0 ; void *tmp___1 ; char const *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; int lnum ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; struct _ddebug descriptor ; char const *tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___15 ; long tmp___16 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___17 ; long tmp___18 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___19 ; long tmp___20 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___21 ; long tmp___22 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___23 ; long tmp___24 ; struct _ddebug descriptor___5 ; struct task_struct *tmp___25 ; long tmp___26 ; struct _ddebug descriptor___6 ; struct task_struct *tmp___27 ; long tmp___28 ; struct _ddebug descriptor___7 ; struct task_struct *tmp___29 ; long tmp___30 ; struct _ddebug descriptor___8 ; struct task_struct *tmp___31 ; long tmp___32 ; struct _ddebug descriptor___9 ; struct task_struct *tmp___33 ; long tmp___34 ; struct _ddebug descriptor___10 ; struct task_struct *tmp___35 ; long tmp___36 ; struct _ddebug descriptor___11 ; struct task_struct *tmp___37 ; long tmp___38 ; struct _ddebug descriptor___12 ; struct task_struct *tmp___39 ; long tmp___40 ; struct _ddebug descriptor___13 ; struct task_struct *tmp___41 ; long tmp___42 ; struct _ddebug descriptor___14 ; struct task_struct *tmp___43 ; long tmp___44 ; struct _ddebug descriptor___15 ; int tmp___45 ; struct task_struct *tmp___46 ; long tmp___47 ; struct _ddebug descriptor___16 ; struct task_struct *tmp___48 ; long tmp___49 ; struct _ddebug descriptor___17 ; struct task_struct *tmp___50 ; long tmp___51 ; struct _ddebug descriptor___18 ; struct task_struct *tmp___52 ; long tmp___53 ; struct _ddebug descriptor___19 ; struct task_struct *tmp___54 ; long tmp___55 ; struct _ddebug descriptor___20 ; struct task_struct *tmp___56 ; long tmp___57 ; struct _ddebug descriptor___21 ; struct task_struct *tmp___58 ; long tmp___59 ; struct _ddebug descriptor___22 ; struct task_struct *tmp___60 ; long tmp___61 ; struct _ddebug descriptor___23 ; struct task_struct *tmp___62 ; long tmp___63 ; struct _ddebug descriptor___24 ; struct task_struct *tmp___64 ; long tmp___65 ; { c->ro_mount = (unsigned int )((unsigned char )(c->vfs_sb)->s_flags) & 1U; err = init_constants_early(c); if (err != 0) { return (err); } else { } err = ubifs_debugging_init(c); if (err != 0) { return (err); } else { } err = check_volume_empty(c); if (err != 0) { goto out_free; } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U && ((unsigned int )*((unsigned char *)c + 4080UL) != 0U || (unsigned int )*((unsigned char *)c + 4080UL) != 0U)) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: can\'t format empty UBI volume: read-only %s\n", tmp->pid, "mount_ubifs", (unsigned int )*((unsigned char *)c + 4080UL) != 0U ? (char *)"UBI volume" : (char *)"mount"); err = -30; goto out_free; } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U && (unsigned int )*((unsigned char *)c + 4080UL) == 0U) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot mount read-write - read-only media\n", tmp___0->pid, "mount_ubifs"); err = -30; goto out_free; } else { } err = -12; tmp___1 = kmalloc(256UL, 208U); c->bottom_up_buf = (int *)tmp___1; if ((unsigned long )c->bottom_up_buf == (unsigned long )((int *)0)) { goto out_free; } else { } c->sbuf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )c->sbuf == (unsigned long )((void *)0)) { goto out_free; } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { c->ileb_buf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )c->ileb_buf == (unsigned long )((void *)0)) { goto out_free; } else { } } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { bu_init(c); } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { c->write_reserve_buf = kmalloc(8240UL, 208U); if ((unsigned long )c->write_reserve_buf == (unsigned long )((void *)0)) { goto out_free; } else { } } else { } c->mounting = 1U; err = ubifs_read_superblock(c); if (err != 0) { goto out_free; } else { } tmp___4 = ubifs_compr_present((int )c->default_compr); if (tmp___4 == 0) { tmp___2 = ubifs_compr_name((int )c->default_compr); tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: \'compressor \"%s\" is not compiled in\n", tmp___3->pid, "mount_ubifs", tmp___2); err = -524; goto out_free; } else { } err = init_constants_sb(c); if (err != 0) { goto out_free; } else { } sz = (size_t )((c->max_idx_node_sz + (c->min_io_size + -1)) & - c->min_io_size); sz = ((((size_t )c->max_idx_node_sz + sz) + (unsigned long )c->min_io_size) - 1UL) & - ((unsigned long )c->min_io_size); c->cbuf = kmalloc(sz, 80U); if ((unsigned long )c->cbuf == (unsigned long )((void *)0)) { err = -12; goto out_free; } else { } err = alloc_wbufs(c); if (err != 0) { goto out_cbuf; } else { } sprintf((char *)(& c->bgt_name), "ubifs_bgt%d_%d", c->vi.ubi_num, c->vi.vol_id); if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { c->bgt = kthread_create_on_node(& ubifs_bg_thread, (void *)c, -1, "%s", (char *)(& c->bgt_name)); tmp___7 = IS_ERR((void const *)c->bgt); if (tmp___7 != 0L) { tmp___5 = PTR_ERR((void const *)c->bgt); err = (int )tmp___5; c->bgt = 0; tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot spawn \"%s\", error %d\n", tmp___6->pid, "mount_ubifs", (char *)(& c->bgt_name), err); goto out_wbufs; } else { } wake_up_process(c->bgt); } else { } err = ubifs_read_master(c); if (err != 0) { goto out_master; } else { } init_constants_master(c); if ((int )(c->mst_node)->flags & 1) { printk("\rUBIFS: recovery needed\n"); c->need_recovery = 1U; } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U && (unsigned int )*((unsigned char *)c + 4080UL) == 0U) { err = ubifs_recover_inl_heads(c, c->sbuf); if (err != 0) { goto out_master; } else { } } else { } err = ubifs_lpt_init(c, 1, (unsigned int )*((unsigned char *)c + 4080UL) == 0U); if (err != 0) { goto out_master; } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U && (unsigned int )*((unsigned char *)c + 2048UL) != 0U) { err = ubifs_fixup_free_space(c); if (err != 0) { goto out_lpt; } else { } } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { (c->mst_node)->flags = (c->mst_node)->flags | 1U; err = ubifs_write_master(c); if (err != 0) { goto out_lpt; } else { } } else { } err = dbg_check_idx_size(c, (long long )c->bi.old_idx_sz); if (err != 0) { goto out_lpt; } else { } err = ubifs_replay_journal(c); if (err != 0) { goto out_journal; } else { } c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); err = ubifs_mount_orphans(c, (int )c->need_recovery, (int )c->ro_mount); if (err != 0) { goto out_orphans; } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { err = check_free_space(c); if (err != 0) { goto out_orphans; } else { } lnum = c->lhead_lnum + 1; if (c->log_lebs + 3 <= lnum) { lnum = 3; } else { } if (c->ltail_lnum == lnum) { err = ubifs_consolidate_log(c); if (err != 0) { goto out_orphans; } else { } } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { err = ubifs_recover_size(c); if (err != 0) { goto out_orphans; } else { } err = ubifs_rcvry_gc_commit(c); if (err != 0) { goto out_orphans; } else { } } else { err = take_gc_lnum(c); if (err != 0) { goto out_orphans; } else { } err = ubifs_leb_unmap(c, c->gc_lnum); if (err != 0) { goto out_orphans; } else { } } err = dbg_check_lprops(c); if (err != 0) { goto out_orphans; } else { } } else if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { err = ubifs_recover_size(c); if (err != 0) { goto out_orphans; } else { } } else { err = take_gc_lnum(c); if (err != 0) { goto out_orphans; } else { } } spin_lock(& ubifs_infos_lock); list_add_tail(& c->infos_list, & ubifs_infos); spin_unlock(& ubifs_infos_lock); if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { printk("\rUBIFS: recovery deferred\n"); } else { c->need_recovery = 0U; printk("\rUBIFS: recovery completed\n"); tmp___9 = ldv__builtin_expect(c->lst.taken_empty_lebs <= 0, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "mount_ubifs", 1518, tmp___8->pid); dump_stack(); } else { } } } else { tmp___11 = ldv__builtin_expect(c->lst.taken_empty_lebs <= 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "mount_ubifs", 1521, tmp___10->pid); dump_stack(); } else { } } err = dbg_check_filesystem(c); if (err != 0) { goto out_infos; } else { } err = dbg_debugfs_init_fs(c); if (err != 0) { goto out_infos; } else { } c->mounting = 0U; printk("\rUBIFS: mounted UBI device %d, volume %d, name \"%s\"%s\n", c->vi.ubi_num, c->vi.vol_id, c->vi.name, (unsigned int )*((unsigned char *)c + 4080UL) != 0U ? (char *)", R/O mode" : 0); x = (long long )c->main_lebs * (long long )c->leb_size; y = (long long )c->log_lebs * (long long )c->leb_size + c->max_bud_bytes; printk("\rUBIFS: LEB size: %d bytes (%d KiB), min./max. I/O unit sizes: %d bytes/%d bytes\n", c->leb_size, c->leb_size >> 10, c->min_io_size, c->max_write_size); printk("\rUBIFS: FS size: %lld bytes (%lld MiB, %d LEBs), journal size %lld bytes (%lld MiB, %d LEBs)\n", x, x >> 20, c->main_lebs, y, y >> 20, c->log_lebs + c->max_bud_cnt); printk("\rUBIFS: reserved for root: %llu bytes (%llu KiB)\n", c->report_rp_size, c->report_rp_size >> 10); printk("\rUBIFS: media format: w%d/r%d (latest is w%d/r%d), UUID %pUB%s\n", c->fmt_version, c->ro_compat_version, 4, 0, (unsigned char *)(& c->uuid), (unsigned int )*((unsigned char *)c + 2048UL) != 0U ? (char *)", big LPT model" : (char *)", small LPT model"); descriptor.modname = "ubifs"; descriptor.function = "mount_ubifs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): default compressor: %s\n"; descriptor.lineno = 1551U; descriptor.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___14 != 0L) { tmp___12 = ubifs_compr_name((int )c->default_compr); tmp___13 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): default compressor: %s\n", tmp___13->pid, tmp___12); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "mount_ubifs"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): data journal heads: %d\n"; descriptor___0.lineno = 1553U; descriptor___0.flags = 0U; tmp___16 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): data journal heads: %d\n", tmp___15->pid, c->jhead_cnt + -2); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "mount_ubifs"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___1.format = "UBIFS DBG gen (pid %d): log LEBs: %d (%d - %d)\n"; descriptor___1.lineno = 1555U; descriptor___1.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gen (pid %d): log LEBs: %d (%d - %d)\n", tmp___17->pid, c->log_lebs, 3, c->log_last); } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "mount_ubifs"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___2.format = "UBIFS DBG gen (pid %d): LPT area LEBs: %d (%d - %d)\n"; descriptor___2.lineno = 1557U; descriptor___2.flags = 0U; tmp___20 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___20 != 0L) { tmp___19 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG gen (pid %d): LPT area LEBs: %d (%d - %d)\n", tmp___19->pid, c->lpt_lebs, c->lpt_first, c->lpt_last); } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "mount_ubifs"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___3.format = "UBIFS DBG gen (pid %d): orphan area LEBs: %d (%d - %d)\n"; descriptor___3.lineno = 1559U; descriptor___3.flags = 0U; tmp___22 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___22 != 0L) { tmp___21 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG gen (pid %d): orphan area LEBs: %d (%d - %d)\n", tmp___21->pid, c->orph_lebs, c->orph_first, c->orph_last); } else { } descriptor___4.modname = "ubifs"; descriptor___4.function = "mount_ubifs"; descriptor___4.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___4.format = "UBIFS DBG gen (pid %d): main area LEBs: %d (%d - %d)\n"; descriptor___4.lineno = 1561U; descriptor___4.flags = 0U; tmp___24 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___24 != 0L) { tmp___23 = get_current(); __dynamic_pr_debug(& descriptor___4, "UBIFS DBG gen (pid %d): main area LEBs: %d (%d - %d)\n", tmp___23->pid, c->main_lebs, c->main_first, c->leb_cnt + -1); } else { } descriptor___5.modname = "ubifs"; descriptor___5.function = "mount_ubifs"; descriptor___5.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___5.format = "UBIFS DBG gen (pid %d): index LEBs: %d\n"; descriptor___5.lineno = 1562U; descriptor___5.flags = 0U; tmp___26 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); if (tmp___26 != 0L) { tmp___25 = get_current(); __dynamic_pr_debug(& descriptor___5, "UBIFS DBG gen (pid %d): index LEBs: %d\n", tmp___25->pid, c->lst.idx_lebs); } else { } descriptor___6.modname = "ubifs"; descriptor___6.function = "mount_ubifs"; descriptor___6.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___6.format = "UBIFS DBG gen (pid %d): total index bytes: %lld (%lld KiB, %lld MiB)\n"; descriptor___6.lineno = 1565U; descriptor___6.flags = 0U; tmp___28 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); if (tmp___28 != 0L) { tmp___27 = get_current(); __dynamic_pr_debug(& descriptor___6, "UBIFS DBG gen (pid %d): total index bytes: %lld (%lld KiB, %lld MiB)\n", tmp___27->pid, c->bi.old_idx_sz, c->bi.old_idx_sz >> 10, c->bi.old_idx_sz >> 20); } else { } descriptor___7.modname = "ubifs"; descriptor___7.function = "mount_ubifs"; descriptor___7.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___7.format = "UBIFS DBG gen (pid %d): key hash type: %d\n"; descriptor___7.lineno = 1566U; descriptor___7.flags = 0U; tmp___30 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); if (tmp___30 != 0L) { tmp___29 = get_current(); __dynamic_pr_debug(& descriptor___7, "UBIFS DBG gen (pid %d): key hash type: %d\n", tmp___29->pid, (int )c->key_hash_type); } else { } descriptor___8.modname = "ubifs"; descriptor___8.function = "mount_ubifs"; descriptor___8.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___8.format = "UBIFS DBG gen (pid %d): tree fanout: %d\n"; descriptor___8.lineno = 1567U; descriptor___8.flags = 0U; tmp___32 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); if (tmp___32 != 0L) { tmp___31 = get_current(); __dynamic_pr_debug(& descriptor___8, "UBIFS DBG gen (pid %d): tree fanout: %d\n", tmp___31->pid, c->fanout); } else { } descriptor___9.modname = "ubifs"; descriptor___9.function = "mount_ubifs"; descriptor___9.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___9.format = "UBIFS DBG gen (pid %d): reserved GC LEB: %d\n"; descriptor___9.lineno = 1568U; descriptor___9.flags = 0U; tmp___34 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); if (tmp___34 != 0L) { tmp___33 = get_current(); __dynamic_pr_debug(& descriptor___9, "UBIFS DBG gen (pid %d): reserved GC LEB: %d\n", tmp___33->pid, c->gc_lnum); } else { } descriptor___10.modname = "ubifs"; descriptor___10.function = "mount_ubifs"; descriptor___10.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___10.format = "UBIFS DBG gen (pid %d): max. znode size %d\n"; descriptor___10.lineno = 1569U; descriptor___10.flags = 0U; tmp___36 = ldv__builtin_expect((long )descriptor___10.flags & 1L, 0L); if (tmp___36 != 0L) { tmp___35 = get_current(); __dynamic_pr_debug(& descriptor___10, "UBIFS DBG gen (pid %d): max. znode size %d\n", tmp___35->pid, c->max_znode_sz); } else { } descriptor___11.modname = "ubifs"; descriptor___11.function = "mount_ubifs"; descriptor___11.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___11.format = "UBIFS DBG gen (pid %d): max. index node size %d\n"; descriptor___11.lineno = 1570U; descriptor___11.flags = 0U; tmp___38 = ldv__builtin_expect((long )descriptor___11.flags & 1L, 0L); if (tmp___38 != 0L) { tmp___37 = get_current(); __dynamic_pr_debug(& descriptor___11, "UBIFS DBG gen (pid %d): max. index node size %d\n", tmp___37->pid, c->max_idx_node_sz); } else { } descriptor___12.modname = "ubifs"; descriptor___12.function = "mount_ubifs"; descriptor___12.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___12.format = "UBIFS DBG gen (pid %d): node sizes: data %zu, inode %zu, dentry %zu\n"; descriptor___12.lineno = 1572U; descriptor___12.flags = 0U; tmp___40 = ldv__builtin_expect((long )descriptor___12.flags & 1L, 0L); if (tmp___40 != 0L) { tmp___39 = get_current(); __dynamic_pr_debug(& descriptor___12, "UBIFS DBG gen (pid %d): node sizes: data %zu, inode %zu, dentry %zu\n", tmp___39->pid, 48UL, 160UL, 56UL); } else { } descriptor___13.modname = "ubifs"; descriptor___13.function = "mount_ubifs"; descriptor___13.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___13.format = "UBIFS DBG gen (pid %d): node sizes: trun %zu, sb %zu, master %zu\n"; descriptor___13.lineno = 1574U; descriptor___13.flags = 0U; tmp___42 = ldv__builtin_expect((long )descriptor___13.flags & 1L, 0L); if (tmp___42 != 0L) { tmp___41 = get_current(); __dynamic_pr_debug(& descriptor___13, "UBIFS DBG gen (pid %d): node sizes: trun %zu, sb %zu, master %zu\n", tmp___41->pid, 56UL, 4096UL, 512UL); } else { } descriptor___14.modname = "ubifs"; descriptor___14.function = "mount_ubifs"; descriptor___14.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___14.format = "UBIFS DBG gen (pid %d): node sizes: ref %zu, cmt. start %zu, orph %zu\n"; descriptor___14.lineno = 1576U; descriptor___14.flags = 0U; tmp___44 = ldv__builtin_expect((long )descriptor___14.flags & 1L, 0L); if (tmp___44 != 0L) { tmp___43 = get_current(); __dynamic_pr_debug(& descriptor___14, "UBIFS DBG gen (pid %d): node sizes: ref %zu, cmt. start %zu, orph %zu\n", tmp___43->pid, 64UL, 32UL, 32UL); } else { } descriptor___15.modname = "ubifs"; descriptor___15.function = "mount_ubifs"; descriptor___15.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___15.format = "UBIFS DBG gen (pid %d): max. node sizes: data %zu, inode %zu dentry %zu, idx %d\n"; descriptor___15.lineno = 1579U; descriptor___15.flags = 0U; tmp___47 = ldv__builtin_expect((long )descriptor___15.flags & 1L, 0L); if (tmp___47 != 0L) { tmp___45 = ubifs_idx_node_sz((struct ubifs_info const *)c, c->fanout); tmp___46 = get_current(); __dynamic_pr_debug(& descriptor___15, "UBIFS DBG gen (pid %d): max. node sizes: data %zu, inode %zu dentry %zu, idx %d\n", tmp___46->pid, 4144UL, 4256UL, 312UL, tmp___45); } else { } descriptor___16.modname = "ubifs"; descriptor___16.function = "mount_ubifs"; descriptor___16.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___16.format = "UBIFS DBG gen (pid %d): dead watermark: %d\n"; descriptor___16.lineno = 1580U; descriptor___16.flags = 0U; tmp___49 = ldv__builtin_expect((long )descriptor___16.flags & 1L, 0L); if (tmp___49 != 0L) { tmp___48 = get_current(); __dynamic_pr_debug(& descriptor___16, "UBIFS DBG gen (pid %d): dead watermark: %d\n", tmp___48->pid, c->dead_wm); } else { } descriptor___17.modname = "ubifs"; descriptor___17.function = "mount_ubifs"; descriptor___17.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___17.format = "UBIFS DBG gen (pid %d): dark watermark: %d\n"; descriptor___17.lineno = 1581U; descriptor___17.flags = 0U; tmp___51 = ldv__builtin_expect((long )descriptor___17.flags & 1L, 0L); if (tmp___51 != 0L) { tmp___50 = get_current(); __dynamic_pr_debug(& descriptor___17, "UBIFS DBG gen (pid %d): dark watermark: %d\n", tmp___50->pid, c->dark_wm); } else { } descriptor___18.modname = "ubifs"; descriptor___18.function = "mount_ubifs"; descriptor___18.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___18.format = "UBIFS DBG gen (pid %d): LEB overhead: %d\n"; descriptor___18.lineno = 1582U; descriptor___18.flags = 0U; tmp___53 = ldv__builtin_expect((long )descriptor___18.flags & 1L, 0L); if (tmp___53 != 0L) { tmp___52 = get_current(); __dynamic_pr_debug(& descriptor___18, "UBIFS DBG gen (pid %d): LEB overhead: %d\n", tmp___52->pid, c->leb_overhead); } else { } x = (long long )c->main_lebs * (long long )c->dark_wm; descriptor___19.modname = "ubifs"; descriptor___19.function = "mount_ubifs"; descriptor___19.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___19.format = "UBIFS DBG gen (pid %d): max. dark space: %lld (%lld KiB, %lld MiB)\n"; descriptor___19.lineno = 1585U; descriptor___19.flags = 0U; tmp___55 = ldv__builtin_expect((long )descriptor___19.flags & 1L, 0L); if (tmp___55 != 0L) { tmp___54 = get_current(); __dynamic_pr_debug(& descriptor___19, "UBIFS DBG gen (pid %d): max. dark space: %lld (%lld KiB, %lld MiB)\n", tmp___54->pid, x, x >> 10, x >> 20); } else { } descriptor___20.modname = "ubifs"; descriptor___20.function = "mount_ubifs"; descriptor___20.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___20.format = "UBIFS DBG gen (pid %d): maximum bud bytes: %lld (%lld KiB, %lld MiB)\n"; descriptor___20.lineno = 1588U; descriptor___20.flags = 0U; tmp___57 = ldv__builtin_expect((long )descriptor___20.flags & 1L, 0L); if (tmp___57 != 0L) { tmp___56 = get_current(); __dynamic_pr_debug(& descriptor___20, "UBIFS DBG gen (pid %d): maximum bud bytes: %lld (%lld KiB, %lld MiB)\n", tmp___56->pid, c->max_bud_bytes, c->max_bud_bytes >> 10, c->max_bud_bytes >> 20); } else { } descriptor___21.modname = "ubifs"; descriptor___21.function = "mount_ubifs"; descriptor___21.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___21.format = "UBIFS DBG gen (pid %d): BG commit bud bytes: %lld (%lld KiB, %lld MiB)\n"; descriptor___21.lineno = 1591U; descriptor___21.flags = 0U; tmp___59 = ldv__builtin_expect((long )descriptor___21.flags & 1L, 0L); if (tmp___59 != 0L) { tmp___58 = get_current(); __dynamic_pr_debug(& descriptor___21, "UBIFS DBG gen (pid %d): BG commit bud bytes: %lld (%lld KiB, %lld MiB)\n", tmp___58->pid, c->bg_bud_bytes, c->bg_bud_bytes >> 10, c->bg_bud_bytes >> 20); } else { } descriptor___22.modname = "ubifs"; descriptor___22.function = "mount_ubifs"; descriptor___22.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___22.format = "UBIFS DBG gen (pid %d): current bud bytes %lld (%lld KiB, %lld MiB)\n"; descriptor___22.lineno = 1593U; descriptor___22.flags = 0U; tmp___61 = ldv__builtin_expect((long )descriptor___22.flags & 1L, 0L); if (tmp___61 != 0L) { tmp___60 = get_current(); __dynamic_pr_debug(& descriptor___22, "UBIFS DBG gen (pid %d): current bud bytes %lld (%lld KiB, %lld MiB)\n", tmp___60->pid, c->bud_bytes, c->bud_bytes >> 10, c->bud_bytes >> 20); } else { } descriptor___23.modname = "ubifs"; descriptor___23.function = "mount_ubifs"; descriptor___23.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___23.format = "UBIFS DBG gen (pid %d): max. seq. number: %llu\n"; descriptor___23.lineno = 1594U; descriptor___23.flags = 0U; tmp___63 = ldv__builtin_expect((long )descriptor___23.flags & 1L, 0L); if (tmp___63 != 0L) { tmp___62 = get_current(); __dynamic_pr_debug(& descriptor___23, "UBIFS DBG gen (pid %d): max. seq. number: %llu\n", tmp___62->pid, c->max_sqnum); } else { } descriptor___24.modname = "ubifs"; descriptor___24.function = "mount_ubifs"; descriptor___24.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___24.format = "UBIFS DBG gen (pid %d): commit number: %llu\n"; descriptor___24.lineno = 1595U; descriptor___24.flags = 0U; tmp___65 = ldv__builtin_expect((long )descriptor___24.flags & 1L, 0L); if (tmp___65 != 0L) { tmp___64 = get_current(); __dynamic_pr_debug(& descriptor___24, "UBIFS DBG gen (pid %d): commit number: %llu\n", tmp___64->pid, c->cmt_no); } else { } return (0); out_infos: spin_lock(& ubifs_infos_lock); list_del(& c->infos_list); spin_unlock(& ubifs_infos_lock); out_orphans: free_orphans(c); out_journal: destroy_journal(c); out_lpt: ubifs_lpt_free(c, 0); out_master: kfree((void const *)c->mst_node); kfree((void const *)c->rcvrd_mst_node); if ((unsigned long )c->bgt != (unsigned long )((struct task_struct *)0)) { kthread_stop(c->bgt); } else { } out_wbufs: free_wbufs(c); out_cbuf: kfree((void const *)c->cbuf); out_free: kfree((void const *)c->write_reserve_buf); kfree((void const *)c->bu.buf); vfree((void const *)c->ileb_buf); vfree((void const *)c->sbuf); kfree((void const *)c->bottom_up_buf); ubifs_debugging_exit(c); return (err); } } static void ubifs_umount(struct ubifs_info *c ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_umount"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): un-mounting UBI device %d, volume %d\n"; descriptor.lineno = 1640U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): un-mounting UBI device %d, volume %d\n", tmp->pid, c->vi.ubi_num, c->vi.vol_id); } else { } dbg_debugfs_exit_fs(c); spin_lock(& ubifs_infos_lock); list_del(& c->infos_list); spin_unlock(& ubifs_infos_lock); if ((unsigned long )c->bgt != (unsigned long )((struct task_struct *)0)) { kthread_stop(c->bgt); } else { } destroy_journal(c); free_wbufs(c); free_orphans(c); ubifs_lpt_free(c, 0); kfree((void const *)c->cbuf); kfree((void const *)c->rcvrd_mst_node); kfree((void const *)c->mst_node); kfree((void const *)c->write_reserve_buf); kfree((void const *)c->bu.buf); vfree((void const *)c->ileb_buf); vfree((void const *)c->sbuf); kfree((void const *)c->bottom_up_buf); ubifs_debugging_exit(c); return; } } static int ubifs_remount_rw(struct ubifs_info *c ) { int err ; int lnum ; struct task_struct *tmp ; struct ubifs_sb_node *sup ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct _ddebug descriptor ; struct task_struct *tmp___7 ; long tmp___8 ; { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: the file-system is not R/W-compatible\n", tmp->pid, "ubifs_remount_rw"); printk("\rUBIFS: on-flash format version is w%d/r%d, but software only supports up to version w%d/r%d\n", c->fmt_version, c->ro_compat_version, 4, 0); return (-30); } else { } ldv_mutex_lock_206(& c->umount_mutex); dbg_save_space_info(c); c->remounting_rw = 1U; c->ro_mount = 0U; err = check_free_space(c); if (err != 0) { goto out; } else { } if (c->old_leb_cnt != c->leb_cnt) { sup = ubifs_read_sb_node(c); tmp___1 = IS_ERR((void const *)sup); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)sup); err = (int )tmp___0; goto out; } else { } sup->leb_cnt = (unsigned int )c->leb_cnt; err = ubifs_write_sb_node(c, sup); kfree((void const *)sup); if (err != 0) { goto out; } else { } } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { printk("\rUBIFS: completing deferred recovery\n"); err = ubifs_write_rcvrd_mst_node(c); if (err != 0) { goto out; } else { } err = ubifs_recover_size(c); if (err != 0) { goto out; } else { } err = ubifs_clean_lebs(c, c->sbuf); if (err != 0) { goto out; } else { } err = ubifs_recover_inl_heads(c, c->sbuf); if (err != 0) { goto out; } else { } } else { tmp___3 = ldv__builtin_expect(c->tot_orphans != 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remount_rw", 1726, tmp___2->pid); dump_stack(); } else { } err = ubifs_clear_orphans(c); if (err != 0) { goto out; } else { } } if (((c->mst_node)->flags & 1U) == 0U) { (c->mst_node)->flags = (c->mst_node)->flags | 1U; err = ubifs_write_master(c); if (err != 0) { goto out; } else { } } else { } c->ileb_buf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )c->ileb_buf == (unsigned long )((void *)0)) { err = -12; goto out; } else { } c->write_reserve_buf = kmalloc(8240UL, 208U); if ((unsigned long )c->write_reserve_buf == (unsigned long )((void *)0)) { goto out; } else { } err = ubifs_lpt_init(c, 0, 1); if (err != 0) { goto out; } else { } c->bgt = kthread_create_on_node(& ubifs_bg_thread, (void *)c, -1, "%s", (char *)(& c->bgt_name)); tmp___6 = IS_ERR((void const *)c->bgt); if (tmp___6 != 0L) { tmp___4 = PTR_ERR((void const *)c->bgt); err = (int )tmp___4; c->bgt = 0; tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot spawn \"%s\", error %d\n", tmp___5->pid, "ubifs_remount_rw", (char *)(& c->bgt_name), err); goto out; } else { } wake_up_process(c->bgt); c->orph_buf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )c->orph_buf == (unsigned long )((void *)0)) { err = -12; goto out; } else { } lnum = c->lhead_lnum + 1; if (c->log_lebs + 3 <= lnum) { lnum = 3; } else { } if (c->ltail_lnum == lnum) { err = ubifs_consolidate_log(c); if (err != 0) { goto out; } else { } } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { err = ubifs_rcvry_gc_commit(c); } else { err = ubifs_leb_unmap(c, c->gc_lnum); } if (err != 0) { goto out; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_remount_rw"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): re-mounted read-write\n"; descriptor.lineno = 1787U; descriptor.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): re-mounted read-write\n", tmp___7->pid); } else { } c->remounting_rw = 0U; if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { c->need_recovery = 0U; printk("\rUBIFS: deferred recovery completed\n"); } else { err = dbg_check_space_info(c); } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { err = ubifs_fixup_free_space(c); if (err != 0) { goto out; } else { } } else { } ldv_mutex_unlock_207(& c->umount_mutex); return (err); out: c->ro_mount = 1U; vfree((void const *)c->orph_buf); c->orph_buf = 0; if ((unsigned long )c->bgt != (unsigned long )((struct task_struct *)0)) { kthread_stop(c->bgt); c->bgt = 0; } else { } free_wbufs(c); kfree((void const *)c->write_reserve_buf); c->write_reserve_buf = 0; vfree((void const *)c->ileb_buf); c->ileb_buf = 0; ubifs_lpt_free(c, 1); c->remounting_rw = 0U; ldv_mutex_unlock_208(& c->umount_mutex); return (err); } } static void ubifs_remount_ro(struct ubifs_info *c ) { int i ; int err ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { tmp___0 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 5528UL) != 0U, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remount_ro", 1846, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remount_ro", 1847, tmp___1->pid); dump_stack(); } else { } ldv_mutex_lock_209(& c->umount_mutex); if ((unsigned long )c->bgt != (unsigned long )((struct task_struct *)0)) { kthread_stop(c->bgt); c->bgt = 0; } else { } dbg_save_space_info(c); i = 0; goto ldv_28992; ldv_28991: ubifs_wbuf_sync(& (c->jheads + (unsigned long )i)->wbuf); i = i + 1; ldv_28992: ; if (c->jhead_cnt > i) { goto ldv_28991; } else { } (c->mst_node)->flags = (c->mst_node)->flags & 4294967294U; (c->mst_node)->flags = (c->mst_node)->flags | 2U; (c->mst_node)->gc_lnum = (unsigned int )c->gc_lnum; err = ubifs_write_master(c); if (err != 0) { ubifs_ro_mode(c, err); } else { } vfree((void const *)c->orph_buf); c->orph_buf = 0; kfree((void const *)c->write_reserve_buf); c->write_reserve_buf = 0; vfree((void const *)c->ileb_buf); c->ileb_buf = 0; ubifs_lpt_free(c, 1); c->ro_mount = 1U; err = dbg_check_space_info(c); if (err != 0) { ubifs_ro_mode(c, err); } else { } ldv_mutex_unlock_210(& c->umount_mutex); return; } } static void ubifs_put_super(struct super_block *sb ) { int i ; struct ubifs_info *c ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; int err ; struct task_struct *tmp___5 ; { c = (struct ubifs_info *)sb->s_fs_info; printk("\rUBIFS: un-mount UBI device %d, volume %d\n", c->vi.ubi_num, c->vi.vol_id); if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { tmp___0 = ldv__builtin_expect(c->bi.idx_growth != 0LL, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_put_super", 1895, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(c->bi.dd_growth != 0LL, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_put_super", 1896, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(c->bi.data_growth != 0LL, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_put_super", 1897, tmp___3->pid); dump_stack(); } else { } } else { } ldv_mutex_lock_211(& c->umount_mutex); if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { if ((unsigned long )c->bgt != (unsigned long )((struct task_struct *)0)) { kthread_stop(c->bgt); c->bgt = 0; } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { i = 0; goto ldv_29002; ldv_29001: ubifs_wbuf_sync(& (c->jheads + (unsigned long )i)->wbuf); i = i + 1; ldv_29002: ; if (c->jhead_cnt > i) { goto ldv_29001; } else { } (c->mst_node)->flags = (c->mst_node)->flags & 4294967294U; (c->mst_node)->flags = (c->mst_node)->flags | 2U; (c->mst_node)->gc_lnum = (unsigned int )c->gc_lnum; err = ubifs_write_master(c); if (err != 0) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: failed to write master node, error %d\n", tmp___5->pid, "ubifs_put_super", err); } else { } } else { i = 0; goto ldv_29005; ldv_29004: hrtimer_cancel(& (c->jheads + (unsigned long )i)->wbuf.timer); i = i + 1; ldv_29005: ; if (c->jhead_cnt > i) { goto ldv_29004; } else { } } } else { } ubifs_umount(c); bdi_destroy(& c->bdi); ubi_close_volume(c->ubi); ldv_mutex_unlock_212(& c->umount_mutex); return; } } static int ubifs_remount_fs(struct super_block *sb , int *flags , char *data ) { int err ; struct ubifs_info *c ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; { c = (struct ubifs_info *)sb->s_fs_info; descriptor.modname = "ubifs"; descriptor.function = "ubifs_remount_fs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): old flags %#lx, new flags %#x\n"; descriptor.lineno = 1963U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): old flags %#lx, new flags %#x\n", tmp->pid, sb->s_flags, *flags); } else { } err = ubifs_parse_options(c, data, 1); if (err != 0) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: invalid or unknown remount parameter\n", tmp___1->pid, "ubifs_remount_fs"); return (err); } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U && (*flags & 1) == 0) { if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { printk("\rUBIFS: cannot re-mount R/W due to prior errors\n"); return (-30); } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { printk("\rUBIFS: cannot re-mount R/W - UBI volume is R/O\n"); return (-30); } else { } err = ubifs_remount_rw(c); if (err != 0) { return (err); } else { } } else if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U && *flags & 1) { if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { printk("\rUBIFS: cannot re-mount R/O due to prior errors\n"); return (-30); } else { } ubifs_remount_ro(c); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { bu_init(c); } else { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_remount_fs"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): disable bulk-read\n"; descriptor___0.lineno = 1994U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): disable bulk-read\n", tmp___2->pid); } else { } kfree((void const *)c->bu.buf); c->bu.buf = 0; } tmp___5 = ldv__builtin_expect(c->lst.taken_empty_lebs <= 0, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remount_fs", 1999, tmp___4->pid); dump_stack(); } else { } return (0); } } struct super_operations const ubifs_super_operations = {& ubifs_alloc_inode, & ubifs_destroy_inode, & ubifs_dirty_inode, & ubifs_write_inode, 0, & ubifs_evict_inode, & ubifs_put_super, & ubifs_sync_fs, 0, 0, & ubifs_statfs, & ubifs_remount_fs, 0, & ubifs_show_options, 0, 0, 0, 0, 0, 0, 0, 0}; static struct ubi_volume_desc *open_ubi(char const *name , int mode ) { struct ubi_volume_desc *ubi ; int dev ; int vol ; char *endptr ; long tmp ; void *tmp___0 ; struct ubi_volume_desc *tmp___1 ; void *tmp___2 ; unsigned long tmp___3 ; struct ubi_volume_desc *tmp___4 ; unsigned long tmp___5 ; void *tmp___6 ; struct ubi_volume_desc *tmp___7 ; struct ubi_volume_desc *tmp___8 ; void *tmp___9 ; { ubi = ubi_open_volume_path(name, mode); tmp = IS_ERR((void const *)ubi); if (tmp == 0L) { return (ubi); } else { } if (((int )((signed char )*name) != 117 || (int )((signed char )*(name + 1UL)) != 98) || (int )((signed char )*(name + 2UL)) != 105) { tmp___0 = ERR_PTR(-22L); return ((struct ubi_volume_desc *)tmp___0); } else { } if (((int )((signed char )*(name + 3UL)) == 58 || (int )((signed char )*(name + 3UL)) == 33) && (int )((signed char )*(name + 4UL)) != 0) { tmp___1 = ubi_open_volume_nm(0, name + 4UL, mode); return (tmp___1); } else { } if (((int )_ctype[(int )((unsigned char )*(name + 3UL))] & 4) == 0) { tmp___2 = ERR_PTR(-22L); return ((struct ubi_volume_desc *)tmp___2); } else { } tmp___3 = simple_strtoul(name + 3UL, & endptr, 0U); dev = (int )tmp___3; if ((int )((signed char )*endptr) == 0) { tmp___4 = ubi_open_volume(0, dev, mode); return (tmp___4); } else { } if ((int )((signed char )*endptr) == 95 && ((int )_ctype[(int )((unsigned char )*(endptr + 1UL))] & 4) != 0) { tmp___5 = simple_strtoul((char const *)endptr + 1U, & endptr, 0U); vol = (int )tmp___5; if ((int )((signed char )*endptr) != 0) { tmp___6 = ERR_PTR(-22L); return ((struct ubi_volume_desc *)tmp___6); } else { } tmp___7 = ubi_open_volume(dev, vol, mode); return (tmp___7); } else { } if (((int )((signed char )*endptr) == 58 || (int )((signed char )*endptr) == 33) && (int )((signed char )*(endptr + 1UL)) != 0) { endptr = endptr + 1; tmp___8 = ubi_open_volume_nm(dev, (char const *)endptr, mode); return (tmp___8); } else { } tmp___9 = ERR_PTR(-22L); return ((struct ubi_volume_desc *)tmp___9); } } static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi ) { struct ubifs_info *c ; void *tmp ; struct lock_class_key __key ; struct lock_class_key __key___0 ; struct lock_class_key __key___1 ; struct lock_class_key __key___2 ; struct lock_class_key __key___3 ; struct lock_class_key __key___4 ; struct lock_class_key __key___5 ; struct lock_class_key __key___6 ; struct lock_class_key __key___7 ; struct lock_class_key __key___8 ; struct lock_class_key __key___9 ; struct lock_class_key __key___10 ; struct lock_class_key __key___11 ; struct lock_class_key __key___12 ; struct rb_root __constr_expr_0 ; struct rb_root __constr_expr_1 ; struct rb_root __constr_expr_2 ; struct rb_root __constr_expr_3 ; int tmp___0 ; { tmp = kzalloc(5632UL, 208U); c = (struct ubifs_info *)tmp; if ((unsigned long )c != (unsigned long )((struct ubifs_info *)0)) { spinlock_check(& c->cnt_lock); __raw_spin_lock_init(& c->cnt_lock.ldv_5961.rlock, "&(&c->cnt_lock)->rlock", & __key); spinlock_check(& c->cs_lock); __raw_spin_lock_init(& c->cs_lock.ldv_5961.rlock, "&(&c->cs_lock)->rlock", & __key___0); spinlock_check(& c->buds_lock); __raw_spin_lock_init(& c->buds_lock.ldv_5961.rlock, "&(&c->buds_lock)->rlock", & __key___1); spinlock_check(& c->space_lock); __raw_spin_lock_init(& c->space_lock.ldv_5961.rlock, "&(&c->space_lock)->rlock", & __key___2); spinlock_check(& c->orphan_lock); __raw_spin_lock_init(& c->orphan_lock.ldv_5961.rlock, "&(&c->orphan_lock)->rlock", & __key___3); __init_rwsem(& c->commit_sem, "&c->commit_sem", & __key___4); __mutex_init(& c->lp_mutex, "&c->lp_mutex", & __key___5); __mutex_init(& c->tnc_mutex, "&c->tnc_mutex", & __key___6); __mutex_init(& c->log_mutex, "&c->log_mutex", & __key___7); __mutex_init(& c->mst_mutex, "&c->mst_mutex", & __key___8); __mutex_init(& c->umount_mutex, "&c->umount_mutex", & __key___9); __mutex_init(& c->bu_mutex, "&c->bu_mutex", & __key___10); __mutex_init(& c->write_reserve_mutex, "&c->write_reserve_mutex", & __key___11); __init_waitqueue_head(& c->cmt_wq, "&c->cmt_wq", & __key___12); __constr_expr_0.rb_node = 0; c->buds = __constr_expr_0; __constr_expr_1.rb_node = 0; c->old_idx = __constr_expr_1; __constr_expr_2.rb_node = 0; c->size_tree = __constr_expr_2; __constr_expr_3.rb_node = 0; c->orph_tree = __constr_expr_3; INIT_LIST_HEAD(& c->infos_list); INIT_LIST_HEAD(& c->idx_gc); INIT_LIST_HEAD(& c->replay_list); INIT_LIST_HEAD(& c->replay_buds); INIT_LIST_HEAD(& c->uncat_list); INIT_LIST_HEAD(& c->empty_list); INIT_LIST_HEAD(& c->freeable_list); INIT_LIST_HEAD(& c->frdi_idx_list); INIT_LIST_HEAD(& c->unclean_leb_list); INIT_LIST_HEAD(& c->old_buds); INIT_LIST_HEAD(& c->orph_list); INIT_LIST_HEAD(& c->orph_new); c->no_chk_data_crc = 1U; c->highest_inum = 64UL; tmp___0 = 3; c->ltail_lnum = tmp___0; c->lhead_lnum = tmp___0; ubi_get_volume_info(ubi, & c->vi); ubi_get_device_info(c->vi.ubi_num, & c->di); } else { } return (c); } } static int ubifs_fill_super(struct super_block *sb , void *data , int silent ) { struct ubifs_info *c ; struct inode *root ; int err ; long tmp ; long tmp___0 ; long long tmp___1 ; unsigned long long tmp___2 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; { c = (struct ubifs_info *)sb->s_fs_info; c->vfs_sb = sb; c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, 2); tmp___0 = IS_ERR((void const *)c->ubi); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)c->ubi); err = (int )tmp; goto out; } else { } c->bdi.name = (char *)"ubifs"; c->bdi.capabilities = 4U; err = bdi_init(& c->bdi); if (err != 0) { goto out_close; } else { } err = bdi_register(& c->bdi, 0, "ubifs_%d_%d", c->vi.ubi_num, c->vi.vol_id); if (err != 0) { goto out_bdi; } else { } err = ubifs_parse_options(c, (char *)data, 0); if (err != 0) { goto out_bdi; } else { } sb->s_bdi = & c->bdi; sb->s_fs_info = (void *)c; sb->s_magic = 604313861UL; sb->s_blocksize = 4096UL; sb->s_blocksize_bits = 12U; tmp___2 = key_max_inode_size((struct ubifs_info const *)c); tmp___1 = (long long )tmp___2; c->max_inode_sz = tmp___1; sb->s_maxbytes = tmp___1; sb->s_op = & ubifs_super_operations; ldv_mutex_lock_213(& c->umount_mutex); err = mount_ubifs(c); if (err != 0) { tmp___5 = ldv__builtin_expect(err >= 0, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fill_super", 2174, tmp___4->pid); dump_stack(); } else { } goto out_unlock; } else { } root = ubifs_iget(sb, 1UL); tmp___7 = IS_ERR((void const *)root); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)root); err = (int )tmp___6; goto out_umount; } else { } sb->s_root = d_make_root(root); if ((unsigned long )sb->s_root == (unsigned long )((struct dentry *)0)) { goto out_umount; } else { } ldv_mutex_unlock_214(& c->umount_mutex); return (0); out_umount: ubifs_umount(c); out_unlock: ldv_mutex_unlock_215(& c->umount_mutex); out_bdi: bdi_destroy(& c->bdi); out_close: ubi_close_volume(c->ubi); out: ; return (err); } } static int sb_test(struct super_block *sb , void *data ) { struct ubifs_info *c1 ; struct ubifs_info *c ; { c1 = (struct ubifs_info *)data; c = (struct ubifs_info *)sb->s_fs_info; return (c->vi.cdev == c1->vi.cdev); } } static int sb_set(struct super_block *sb , void *data ) { int tmp ; { sb->s_fs_info = data; tmp = set_anon_super(sb, 0); return (tmp); } } static struct dentry *ubifs_mount(struct file_system_type *fs_type , int flags , char const *name , void *data ) { struct ubi_volume_desc *ubi ; struct ubifs_info *c ; struct super_block *sb ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; void *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; struct ubifs_info *c1 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___9 ; long tmp___10 ; struct dentry *tmp___11 ; void *tmp___12 ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_mount"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): name %s, flags %#x\n"; descriptor.lineno = 2226U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): name %s, flags %#x\n", tmp->pid, name, flags); } else { } ubi = open_ubi(name, 1); tmp___4 = IS_ERR((void const *)ubi); if (tmp___4 != 0L) { tmp___1 = PTR_ERR((void const *)ubi); tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot open \"%s\", error %d\n", tmp___2->pid, "ubifs_mount", name, (int )tmp___1); tmp___3 = ERR_CAST((void const *)ubi); return ((struct dentry *)tmp___3); } else { } c = alloc_ubifs_info(ubi); if ((unsigned long )c == (unsigned long )((struct ubifs_info *)0)) { err = -12; goto out_close; } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_mount"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): opened ubi%d_%d\n"; descriptor___0.lineno = 2246U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): opened ubi%d_%d\n", tmp___5->pid, c->vi.ubi_num, c->vi.vol_id); } else { } sb = sget(fs_type, & sb_test, & sb_set, flags, (void *)c); tmp___8 = IS_ERR((void const *)sb); if (tmp___8 != 0L) { tmp___7 = PTR_ERR((void const *)sb); err = (int )tmp___7; kfree((void const *)c); goto out_close; } else { } if ((unsigned long )sb->s_root != (unsigned long )((struct dentry *)0)) { c1 = (struct ubifs_info *)sb->s_fs_info; kfree((void const *)c); descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_mount"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/super.c.prepared"; descriptor___1.format = "UBIFS DBG gen (pid %d): this ubi volume is already mounted\n"; descriptor___1.lineno = 2259U; descriptor___1.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gen (pid %d): this ubi volume is already mounted\n", tmp___9->pid); } else { } if ((flags & 1) != (int )c1->ro_mount) { err = -16; goto out_deact; } else { } } else { err = ubifs_fill_super(sb, data, (flags & 32768) != 0); if (err != 0) { goto out_deact; } else { } sb->s_flags = sb->s_flags | 1073742848UL; } ubi_close_volume(ubi); tmp___11 = dget(sb->s_root); return (tmp___11); out_deact: deactivate_locked_super(sb); out_close: ubi_close_volume(ubi); tmp___12 = ERR_PTR((long )err); return ((struct dentry *)tmp___12); } } static void kill_ubifs_super(struct super_block *s ) { struct ubifs_info *c ; { c = (struct ubifs_info *)s->s_fs_info; kill_anon_super(s); kfree((void const *)c); return; } } static struct file_system_type ubifs_fs_type = {"ubifs", 0, & ubifs_mount, & kill_ubifs_super, & __this_module, 0, {0}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}, {{{(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}, {(char)0}}}}; static void ubifs_exit(void) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = list_empty((struct list_head const *)(& ubifs_infos)); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_exit", 2406, tmp->pid); dump_stack(); } else { } tmp___3 = atomic_long_read(& ubifs_clean_zn_cnt); tmp___4 = ldv__builtin_expect(tmp___3 != 0L, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_exit", 2407, tmp___2->pid); dump_stack(); } else { } dbg_debugfs_exit(); ubifs_compressors_exit(); unregister_shrinker(& ubifs_shrinker_info); rcu_barrier(); kmem_cache_destroy(ubifs_inode_slab); unregister_filesystem(& ubifs_fs_type); return; } } void ldv_main4_sequence_infinite_withcheck_stateful(void) { struct super_block *var_group1 ; struct inode *var_group2 ; struct writeback_control *var_group3 ; struct dentry *var_group4 ; struct kstatfs *var_group5 ; int var_ubifs_dirty_inode_7_p1 ; int *var_ubifs_remount_fs_31_p1 ; char *var_ubifs_remount_fs_31_p2 ; struct seq_file *var_group6 ; int var_ubifs_sync_fs_10_p1 ; struct file_system_type *var_group7 ; int var_ubifs_mount_37_p1 ; char const *var_ubifs_mount_37_p2 ; void *var_ubifs_mount_37_p3 ; int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_29169; ldv_29168: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ldv_handler_precall(); ubifs_alloc_inode(var_group1); goto ldv_29155; case 1: ldv_handler_precall(); ubifs_destroy_inode(var_group2); goto ldv_29155; case 2: ldv_handler_precall(); ubifs_put_super(var_group1); goto ldv_29155; case 3: ldv_handler_precall(); ubifs_write_inode(var_group2, var_group3); goto ldv_29155; case 4: ldv_handler_precall(); ubifs_evict_inode(var_group2); goto ldv_29155; case 5: ldv_handler_precall(); ubifs_statfs(var_group4, var_group5); goto ldv_29155; case 6: ldv_handler_precall(); ubifs_dirty_inode(var_group2, var_ubifs_dirty_inode_7_p1); goto ldv_29155; case 7: ldv_handler_precall(); ubifs_remount_fs(var_group1, var_ubifs_remount_fs_31_p1, var_ubifs_remount_fs_31_p2); goto ldv_29155; case 8: ldv_handler_precall(); ubifs_show_options(var_group6, var_group4); goto ldv_29155; case 9: ldv_handler_precall(); ubifs_sync_fs(var_group1, var_ubifs_sync_fs_10_p1); goto ldv_29155; case 10: ldv_handler_precall(); ubifs_mount(var_group7, var_ubifs_mount_37_p1, var_ubifs_mount_37_p2, var_ubifs_mount_37_p3); goto ldv_29155; case 11: ldv_handler_precall(); kill_ubifs_super(var_group1); goto ldv_29155; default: ; goto ldv_29155; } ldv_29155: ; ldv_29169: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_29168; } else { } ldv_handler_precall(); ubifs_exit(); ldv_check_final_state(); return; } } void ldv_mutex_lock_195(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_196(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_197(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_198(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_199(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_200(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_201(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_202(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_203(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_204(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_205(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_206(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_umount_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_207(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_208(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_209(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_umount_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_210(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_211(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_umount_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_212(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_213(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_umount_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_214(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_215(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_umount_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void *memcpy(void * , void const * , size_t ) ; void ldv_mutex_lock_nested_241(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_238(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_240(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_242(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_244(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_237(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_239(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_243(struct mutex *ldv_func_arg1 ) ; int ubifs_leb_read(struct ubifs_info const *c , int lnum , void *buf , int offs , int len , int even_ebadmsg ) ; int ubifs_leb_change(struct ubifs_info *c , int lnum , void const *buf , int len ) ; int ubifs_read_node(struct ubifs_info const *c , void *buf , int type , int len , int lnum , int offs ) ; int ubifs_write_node(struct ubifs_info *c , void *buf , int len , int lnum , int offs ) ; int ubifs_create_dflt_lpt(struct ubifs_info *c , int *main_lebs , int lpt_first , int *lpt_lebs , int *big_lpt ) ; struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c , int lnum ) ; __inline static struct ubifs_branch *ubifs_idx_branch(struct ubifs_info const *c , struct ubifs_idx_node const *idx , int bnum ) { { return ((struct ubifs_branch *)(& idx->branches) + ((unsigned long )c->key_len + 12UL) * (unsigned long )bnum); } } __inline static void ubifs_get_lprops(struct ubifs_info *c ) { { ldv_mutex_lock_243(& c->lp_mutex); return; } } __inline static void ubifs_release_lprops(struct ubifs_info *c ) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 280, tmp->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect(c->lst.empty_lebs < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lst.empty_lebs > c->main_lebs, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { } } ldv_mutex_unlock_244(& c->lp_mutex); return; } } __inline static int ubifs_next_log_lnum(struct ubifs_info const *c , int lnum ) { { lnum = lnum + 1; if ((int )c->log_last < lnum) { lnum = 3; } else { } return (lnum); } } __inline static uint32_t key_mask_hash(uint32_t hash ) { long tmp ; { hash = hash & 536870911U; tmp = ldv__builtin_expect(hash <= 2U, 0L); if (tmp != 0L) { hash = hash + 3U; } else { } return (hash); } } __inline static uint32_t key_r5_hash(char const *s , int len ) { uint32_t a ; signed char const *str ; uint32_t tmp ; { a = 0U; str = (signed char const *)s; goto ldv_27300; ldv_27299: a = (uint32_t )((int )*str << 4) + a; a = (uint32_t )((int )((signed char )*str) >> 4) + a; a = a * 11U; str = str + 1; ldv_27300: ; if ((int )((signed char )*str) != 0) { goto ldv_27299; } else { } tmp = key_mask_hash(a); return (tmp); } } __inline static uint32_t key_test_hash(char const *str , int len ) { uint32_t a ; uint32_t __min1 ; uint32_t __min2 ; size_t __len ; void *__ret ; uint32_t tmp ; { a = 0U; __min1 = (uint32_t )len; __min2 = 4U; len = (int )(__min1 < __min2 ? __min1 : __min2); __len = (size_t )len; __ret = memcpy((void *)(& a), (void const *)str, __len); tmp = key_mask_hash(a); return (tmp); } } __inline static void key_write_idx(struct ubifs_info const *c , union ubifs_key const *from , void *to ) { union ubifs_key *t ; { t = (union ubifs_key *)to; t->j32[0] = from->u32[0]; t->j32[1] = from->u32[1]; return; } } extern void generate_random_uuid(unsigned char * ) ; static int create_default_filesystem(struct ubifs_info *c ) { struct ubifs_sb_node *sup ; struct ubifs_mst_node *mst ; struct ubifs_idx_node *idx ; struct ubifs_branch *br ; struct ubifs_ino_node *ino ; struct ubifs_cs_node *cs ; union ubifs_key key ; int err ; int tmp ; int jnl_lebs ; int log_lebs ; int max_buds ; int main_lebs ; int main_first ; int lpt_lebs ; int lpt_first ; int orph_lebs ; int big_lpt ; int ino_waste ; int sup_flags ; int min_leb_cnt ; long long tmp64 ; long long main_bytes ; __le64 tmp_le64 ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; void *tmp___2 ; u64 tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; void *tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___10 ; long tmp___11 ; void *tmp___12 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___13 ; long tmp___14 ; void *tmp___15 ; struct timespec __constr_expr_0 ; unsigned long tmp___16 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___17 ; long tmp___18 ; void *tmp___19 ; { sup_flags = 0; min_leb_cnt = 17; c->key_len = 8; if (c->leb_cnt <= 429496728) { jnl_lebs = (c->leb_cnt * 5) / 100; } else { jnl_lebs = (c->leb_cnt / 100) * 5; } if (jnl_lebs <= 4) { jnl_lebs = 5; } else { } if (c->leb_size * jnl_lebs > 33554432) { jnl_lebs = 33554432 / c->leb_size; } else { } tmp = ((c->ref_node_alsz * jnl_lebs) * 2 + c->leb_size) + -1; log_lebs = tmp / c->leb_size; log_lebs = log_lebs + 1; if (c->leb_cnt - min_leb_cnt > 8) { log_lebs = log_lebs + 1; min_leb_cnt = min_leb_cnt + 1; } else { } max_buds = jnl_lebs - log_lebs; if (max_buds <= 2) { max_buds = 3; } else { } orph_lebs = 1; if (c->leb_cnt - min_leb_cnt > 1) { orph_lebs = orph_lebs + 1; } else { } main_lebs = (c->leb_cnt + -3) - log_lebs; main_lebs = main_lebs - orph_lebs; lpt_first = log_lebs + 3; c->lsave_cnt = 256; c->max_leb_cnt = c->leb_cnt; err = ubifs_create_dflt_lpt(c, & main_lebs, lpt_first, & lpt_lebs, & big_lpt); if (err != 0) { return (err); } else { } descriptor.modname = "ubifs"; descriptor.function = "create_default_filesystem"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): LEB Properties Tree created (LEBs %d-%d)\n"; descriptor.lineno = 272U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): LEB Properties Tree created (LEBs %d-%d)\n", tmp___0->pid, lpt_first, (lpt_first + lpt_lebs) + -1); } else { } main_first = c->leb_cnt - main_lebs; tmp = (int )(((unsigned int )c->min_io_size + 4095U) & - ((unsigned int )c->min_io_size)); tmp___2 = kzalloc((size_t )tmp, 208U); sup = (struct ubifs_sb_node *)tmp___2; if ((unsigned long )sup == (unsigned long )((struct ubifs_sb_node *)0)) { return (-12); } else { } tmp64 = (long long )max_buds * (long long )c->leb_size; if (big_lpt != 0) { sup_flags = sup_flags | 2; } else { } sup->ch.node_type = 6U; sup->key_hash = 0U; sup->flags = (unsigned int )sup_flags; sup->min_io_size = (unsigned int )c->min_io_size; sup->leb_size = (unsigned int )c->leb_size; sup->leb_cnt = (unsigned int )c->leb_cnt; sup->max_leb_cnt = (unsigned int )c->max_leb_cnt; sup->max_bud_bytes = (unsigned long long )tmp64; sup->log_lebs = (unsigned int )log_lebs; sup->lpt_lebs = (unsigned int )lpt_lebs; sup->orph_lebs = (unsigned int )orph_lebs; sup->jhead_cnt = 1U; sup->fanout = 8U; sup->lsave_cnt = (unsigned int )c->lsave_cnt; sup->fmt_version = 4U; sup->time_gran = 1000000000U; if ((unsigned int )*((unsigned char *)c + 5616UL) != 0U) { sup->default_compr = (unsigned short )c->mount_opts.compr_type; } else { sup->default_compr = 1U; } generate_random_uuid((unsigned char *)(& sup->uuid)); main_bytes = (long long )main_lebs * (long long )c->leb_size; tmp___3 = div_u64((u64 )(main_bytes * 5LL), 100U); tmp64 = (long long )tmp___3; if (tmp64 > 5242880LL) { tmp64 = 5242880LL; } else { } sup->rp_size = (unsigned long long )tmp64; sup->ro_compat_version = 0U; err = ubifs_write_node(c, (void *)sup, 4096, 0, 0); kfree((void const *)sup); if (err != 0) { return (err); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "create_default_filesystem"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): default superblock created at LEB 0:0\n"; descriptor___0.lineno = 321U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): default superblock created at LEB 0:0\n", tmp___4->pid); } else { } tmp___6 = kzalloc((size_t )c->mst_node_alsz, 208U); mst = (struct ubifs_mst_node *)tmp___6; if ((unsigned long )mst == (unsigned long )((struct ubifs_mst_node *)0)) { return (-12); } else { } mst->ch.node_type = 7U; mst->log_lnum = 3U; mst->highest_inum = 64ULL; mst->cmt_no = 0ULL; mst->root_lnum = (unsigned int )main_first; mst->root_offs = 0U; tmp = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); mst->root_len = (unsigned int )tmp; mst->gc_lnum = (unsigned int )(main_first + 2); mst->ihead_lnum = (unsigned int )main_first; mst->ihead_offs = (unsigned int )(((c->min_io_size + -1) + tmp) & - c->min_io_size); mst->index_size = (unsigned long long )((tmp + 7) & -8); mst->lpt_lnum = (unsigned int )c->lpt_lnum; mst->lpt_offs = (unsigned int )c->lpt_offs; mst->nhead_lnum = (unsigned int )c->nhead_lnum; mst->nhead_offs = (unsigned int )c->nhead_offs; mst->ltab_lnum = (unsigned int )c->ltab_lnum; mst->ltab_offs = (unsigned int )c->ltab_offs; mst->lsave_lnum = (unsigned int )c->lsave_lnum; mst->lsave_offs = (unsigned int )c->lsave_offs; mst->lscan_lnum = (unsigned int )main_first; mst->empty_lebs = (unsigned int )(main_lebs + -2); mst->idx_lebs = 1U; mst->leb_cnt = (unsigned int )c->leb_cnt; tmp64 = main_bytes; tmp___7 = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); tmp64 = tmp64 - (long long )((tmp___7 + (c->min_io_size + -1)) & - c->min_io_size); tmp64 = (long long )((unsigned long long )tmp64 - (unsigned long long )(((unsigned long )c->min_io_size + 159UL) & - ((unsigned long )c->min_io_size))); mst->total_free = (unsigned long long )tmp64; tmp___8 = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); tmp64 = (long long )((tmp___8 + (c->min_io_size + -1)) & - c->min_io_size); ino_waste = (int )((((unsigned int )c->min_io_size + 159U) & - ((unsigned int )c->min_io_size)) - 160U); tmp64 = (long long )ino_waste + tmp64; tmp___9 = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); tmp64 = tmp64 - (long long )((tmp___9 + 7) & -8); mst->total_dirty = (unsigned long long )tmp64; tmp64 = (long long )(c->main_lebs + -1) * (long long )c->dark_wm; mst->total_dark = (unsigned long long )tmp64; mst->total_used = 160ULL; err = ubifs_write_node(c, (void *)mst, 512, 1, 0); if (err != 0) { kfree((void const *)mst); return (err); } else { } err = ubifs_write_node(c, (void *)mst, 512, 2, 0); kfree((void const *)mst); if (err != 0) { return (err); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "create_default_filesystem"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor___1.format = "UBIFS DBG gen (pid %d): default master node created at LEB %d:0\n"; descriptor___1.lineno = 383U; descriptor___1.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gen (pid %d): default master node created at LEB %d:0\n", tmp___10->pid, 1); } else { } tmp = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); tmp___12 = kzalloc((size_t )(((c->min_io_size + -1) + tmp) & - c->min_io_size), 208U); idx = (struct ubifs_idx_node *)tmp___12; if ((unsigned long )idx == (unsigned long )((struct ubifs_idx_node *)0)) { return (-12); } else { } c->key_fmt = 0; c->key_hash = & key_r5_hash; idx->ch.node_type = 9U; idx->child_cnt = 1U; ino_key_init((struct ubifs_info const *)c, & key, 1UL); br = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, 0); key_write_idx((struct ubifs_info const *)c, (union ubifs_key const *)(& key), (void *)(& br->key)); br->lnum = (unsigned int )(main_first + 1); br->len = 160U; err = ubifs_write_node(c, (void *)idx, tmp, main_first, 0); kfree((void const *)idx); if (err != 0) { return (err); } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "create_default_filesystem"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor___2.format = "UBIFS DBG gen (pid %d): default root indexing node created LEB %d:0\n"; descriptor___2.lineno = 407U; descriptor___2.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG gen (pid %d): default root indexing node created LEB %d:0\n", tmp___13->pid, main_first); } else { } tmp = (int )(((unsigned int )c->min_io_size + 159U) & - ((unsigned int )c->min_io_size)); tmp___15 = kzalloc((size_t )tmp, 208U); ino = (struct ubifs_ino_node *)tmp___15; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { return (-12); } else { } ino_key_init_flash((struct ubifs_info const *)c, (void *)(& ino->key), 1UL); ino->ch.node_type = 0U; c->max_sqnum = c->max_sqnum + 1ULL; ino->creat_sqnum = c->max_sqnum; ino->nlink = 2U; tmp___16 = get_seconds(); __constr_expr_0.tv_sec = (long )tmp___16; __constr_expr_0.tv_nsec = 0L; tmp_le64 = (unsigned long long )__constr_expr_0.tv_sec; ino->atime_sec = tmp_le64; ino->ctime_sec = tmp_le64; ino->mtime_sec = tmp_le64; ino->atime_nsec = 0U; ino->ctime_nsec = 0U; ino->mtime_nsec = 0U; ino->mode = 16877U; ino->size = 160ULL; ino->flags = 1U; err = ubifs_write_node(c, (void *)ino, 160, main_first + 1, 0); kfree((void const *)ino); if (err != 0) { return (err); } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "create_default_filesystem"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor___3.format = "UBIFS DBG gen (pid %d): root inode created at LEB %d:0\n"; descriptor___3.lineno = 439U; descriptor___3.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG gen (pid %d): root inode created at LEB %d:0\n", tmp___17->pid, main_first + 1); } else { } tmp = (int )(((unsigned int )c->min_io_size + 31U) & - ((unsigned int )c->min_io_size)); tmp___19 = kzalloc((size_t )tmp, 208U); cs = (struct ubifs_cs_node *)tmp___19; if ((unsigned long )cs == (unsigned long )((struct ubifs_cs_node *)0)) { return (-12); } else { } cs->ch.node_type = 10U; err = ubifs_write_node(c, (void *)cs, 32, 3, 0); kfree((void const *)cs); printk("\rUBIFS: default file-system created\n"); return (0); } } static int validate_sb(struct ubifs_info *c , struct ubifs_sb_node *sup ) { long long max_bytes ; int err ; int min_leb_cnt ; struct task_struct *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; struct task_struct *tmp___7 ; { err = 1; if ((unsigned long )c->key_hash == (unsigned long )((uint32_t (*)(char const * , int ))0)) { err = 2; goto failed; } else { } if ((unsigned int )sup->key_fmt != 0U) { err = 3; goto failed; } else { } if (sup->min_io_size != (__le32 )c->min_io_size) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: min. I/O unit mismatch: %d in superblock, %d real\n", tmp->pid, "validate_sb", sup->min_io_size, c->min_io_size); goto failed; } else { } if (sup->leb_size != (__le32 )c->leb_size) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB size mismatch: %d in superblock, %d real\n", tmp___0->pid, "validate_sb", sup->leb_size, c->leb_size); goto failed; } else { } if (((c->log_lebs <= 1 || c->lpt_lebs <= 1) || c->orph_lebs <= 0) || c->main_lebs <= 8) { err = 4; goto failed; } else { } min_leb_cnt = c->log_lebs + 3; min_leb_cnt = (((c->lpt_lebs + c->orph_lebs) + c->jhead_cnt) + 6) + min_leb_cnt; if (c->leb_cnt < min_leb_cnt || c->leb_cnt > c->vi.size) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: bad LEB count: %d in superblock, %d on UBI volume, %d minimum required\n", tmp___1->pid, "validate_sb", c->leb_cnt, c->vi.size, min_leb_cnt); goto failed; } else { } if (c->max_leb_cnt < c->leb_cnt) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: max. LEB count %d less than LEB count %d\n", tmp___2->pid, "validate_sb", c->max_leb_cnt, c->leb_cnt); goto failed; } else { } if (c->main_lebs <= 8) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: too few main LEBs count %d, must be at least %d\n", tmp___3->pid, "validate_sb", c->main_lebs, 9); goto failed; } else { } max_bytes = (long long )c->leb_size * 3LL; if (c->max_bud_bytes < max_bytes) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: too small journal (%lld bytes), must be at least %lld bytes\n", tmp___4->pid, "validate_sb", c->max_bud_bytes, max_bytes); goto failed; } else { } max_bytes = (long long )c->leb_size * (long long )c->main_lebs; if (c->max_bud_bytes > max_bytes) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: too large journal size (%lld bytes), only %lld bytes available in the main area\n", tmp___5->pid, "validate_sb", c->max_bud_bytes, max_bytes); goto failed; } else { } if (c->jhead_cnt <= 2 || c->jhead_cnt > 3) { err = 9; goto failed; } else { } if (c->fanout <= 2) { err = 10; goto failed; } else { tmp___6 = ubifs_idx_node_sz((struct ubifs_info const *)c, c->fanout); if (tmp___6 > c->leb_size) { err = 10; goto failed; } else { } } if (c->lsave_cnt < 0 || (c->lsave_cnt > 256 && c->lsave_cnt > (((c->max_leb_cnt + -3) - c->log_lebs) - c->lpt_lebs) - c->orph_lebs)) { err = 11; goto failed; } else { } if ((((c->log_lebs + 3) + c->lpt_lebs) + c->orph_lebs) + c->main_lebs != c->leb_cnt) { err = 12; goto failed; } else { } if ((int )c->default_compr < 0 || (int )c->default_compr > 2) { err = 13; goto failed; } else { } if (c->rp_size < 0LL || c->rp_size > max_bytes) { err = 14; goto failed; } else { } if (sup->time_gran > 1000000000U || sup->time_gran == 0U) { err = 15; goto failed; } else { } return (0); failed: tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: bad superblock, error %d\n", tmp___7->pid, "validate_sb", err); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sup); return (-22); } } struct ubifs_sb_node *ubifs_read_sb_node(struct ubifs_info *c ) { struct ubifs_sb_node *sup ; int err ; void *tmp ; void *tmp___0 ; void *tmp___1 ; { tmp = kmalloc(((unsigned long )c->min_io_size + 4095UL) & - ((unsigned long )c->min_io_size), 80U); sup = (struct ubifs_sb_node *)tmp; if ((unsigned long )sup == (unsigned long )((struct ubifs_sb_node *)0)) { tmp___0 = ERR_PTR(-12L); return ((struct ubifs_sb_node *)tmp___0); } else { } err = ubifs_read_node((struct ubifs_info const *)c, (void *)sup, 6, 4096, 0, 0); if (err != 0) { kfree((void const *)sup); tmp___1 = ERR_PTR((long )err); return ((struct ubifs_sb_node *)tmp___1); } else { } return (sup); } } int ubifs_write_sb_node(struct ubifs_info *c , struct ubifs_sb_node *sup ) { int len ; int tmp ; { len = (int )(((unsigned int )c->min_io_size + 4095U) & - ((unsigned int )c->min_io_size)); ubifs_prepare_node(c, (void *)sup, 4096, 1); tmp = ubifs_leb_change(c, 0, (void const *)sup, len); return (tmp); } } int ubifs_read_superblock(struct ubifs_info *c ) { int err ; int sup_flags ; struct ubifs_sb_node *sup ; long tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; size_t __len ; void *__ret ; int __min1 ; int __min2 ; struct _ddebug descriptor ; struct task_struct *tmp___7 ; long tmp___8 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___9 ; long tmp___10 ; { if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { err = create_default_filesystem(c); if (err != 0) { return (err); } else { } } else { } sup = ubifs_read_sb_node(c); tmp___0 = IS_ERR((void const *)sup); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)sup); return ((int )tmp); } else { } c->fmt_version = (int )sup->fmt_version; c->ro_compat_version = (int )sup->ro_compat_version; if (c->fmt_version > 4) { tmp___2 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___2 != 0L) { tmp___3 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) == 0U, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_superblock", 666, tmp___1->pid); dump_stack(); } else { } } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U || c->ro_compat_version > 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: on-flash format version is w%d/r%d, but software only supports up to version w%d/r%d\n", tmp___4->pid, "ubifs_read_superblock", c->fmt_version, c->ro_compat_version, 4, 0); if (c->ro_compat_version <= 0) { printk("\rUBIFS: only R/O mounting is possible\n"); err = -30; } else { err = -22; } goto out; } else { } c->rw_incompat = 1U; } else { } if (c->fmt_version <= 2) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: on-flash format version %d is not supported\n", tmp___5->pid, "ubifs_read_superblock", c->fmt_version); err = -22; goto out; } else { } switch ((int )sup->key_hash) { case 0: c->key_hash = & key_r5_hash; c->key_hash_type = 0U; goto ldv_27612; case 1: c->key_hash = & key_test_hash; c->key_hash_type = 1U; goto ldv_27612; } ldv_27612: c->key_fmt = (int )sup->key_fmt; switch (c->key_fmt) { case 0: c->key_len = 8; goto ldv_27615; default: tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: unsupported key format\n", tmp___6->pid, "ubifs_read_superblock"); err = -22; goto out; } ldv_27615: c->leb_cnt = (int )sup->leb_cnt; c->max_leb_cnt = (int )sup->max_leb_cnt; c->max_bud_bytes = (long long )sup->max_bud_bytes; c->log_lebs = (int )sup->log_lebs; c->lpt_lebs = (int )sup->lpt_lebs; c->orph_lebs = (int )sup->orph_lebs; c->jhead_cnt = (int )(sup->jhead_cnt + 2U); c->fanout = (int )sup->fanout; c->lsave_cnt = (int )sup->lsave_cnt; c->rp_size = (long long )sup->rp_size; c->rp_uid = make_kuid(& init_user_ns, sup->rp_uid); c->rp_gid = make_kgid(& init_user_ns, sup->rp_gid); sup_flags = (int )sup->flags; if ((unsigned int )*((unsigned char *)c + 5616UL) == 0U) { c->default_compr = (unsigned char )sup->default_compr; } else { } (c->vfs_sb)->s_time_gran = sup->time_gran; __len = 16UL; if (__len > 63UL) { __ret = memcpy((void *)(& c->uuid), (void const *)(& sup->uuid), __len); } else { __ret = memcpy((void *)(& c->uuid), (void const *)(& sup->uuid), __len); } c->big_lpt = (sup_flags & 2) != 0; c->space_fixup = (sup_flags & 4) != 0; c->old_leb_cnt = c->leb_cnt; if (c->leb_cnt < c->vi.size && c->leb_cnt < c->max_leb_cnt) { __min1 = c->max_leb_cnt; __min2 = c->vi.size; c->leb_cnt = __min1 < __min2 ? __min1 : __min2; if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_read_superblock"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): Auto resizing (ro) from %d LEBs to %d LEBs\n"; descriptor.lineno = 747U; descriptor.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): Auto resizing (ro) from %d LEBs to %d LEBs\n", tmp___7->pid, c->old_leb_cnt, c->leb_cnt); } else { } } else { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_read_superblock"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor___0.format = "UBIFS DBG mnt (pid %d): Auto resizing (sb) from %d LEBs to %d LEBs\n"; descriptor___0.lineno = 750U; descriptor___0.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG mnt (pid %d): Auto resizing (sb) from %d LEBs to %d LEBs\n", tmp___9->pid, c->old_leb_cnt, c->leb_cnt); } else { } sup->leb_cnt = (unsigned int )c->leb_cnt; err = ubifs_write_sb_node(c, sup); if (err != 0) { goto out; } else { } c->old_leb_cnt = c->leb_cnt; } } else { } c->log_bytes = (long long )c->log_lebs * (long long )c->leb_size; c->log_last = c->log_lebs + 2; c->lpt_first = c->log_lebs + 3; c->lpt_last = (c->lpt_first + c->lpt_lebs) + -1; c->orph_first = c->lpt_last + 1; c->orph_last = (c->orph_first + c->orph_lebs) + -1; c->main_lebs = c->leb_cnt + -3; c->main_lebs = c->main_lebs - ((c->log_lebs + c->lpt_lebs) + c->orph_lebs); c->main_first = c->leb_cnt - c->main_lebs; err = validate_sb(c, sup); out: kfree((void const *)sup); return (err); } } static int fixup_leb(struct ubifs_info *c , int lnum , int len ) { int err ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor ; struct task_struct *tmp___5 ; long tmp___6 ; int tmp___7 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___8 ; long tmp___9 ; int tmp___10 ; { tmp___0 = ldv__builtin_expect(len < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fixup_leb", 790, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(len % c->min_io_size != 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fixup_leb", 791, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(c->leb_size <= len, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fixup_leb", 792, tmp___3->pid); dump_stack(); } else { } if (len == 0) { descriptor.modname = "ubifs"; descriptor.function = "fixup_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): unmap empty LEB %d\n"; descriptor.lineno = 795U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): unmap empty LEB %d\n", tmp___5->pid, lnum); } else { } tmp___7 = ubifs_leb_unmap(c, lnum); return (tmp___7); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "fixup_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/sb.c.prepared"; descriptor___0.format = "UBIFS DBG mnt (pid %d): fixup LEB %d, data len %d\n"; descriptor___0.lineno = 799U; descriptor___0.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG mnt (pid %d): fixup LEB %d, data len %d\n", tmp___8->pid, lnum, len); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, c->sbuf, 0, len, 1); if (err != 0) { return (err); } else { } tmp___10 = ubifs_leb_change(c, lnum, (void const *)c->sbuf, len); return (tmp___10); } } static int fixup_free_space(struct ubifs_info *c ) { int lnum ; int err ; struct ubifs_lprops *lprops ; int free ; long tmp ; long tmp___0 ; { err = 0; ubifs_get_lprops(c); lnum = 1; goto ldv_27642; ldv_27641: err = fixup_leb(c, lnum, c->mst_offs + c->mst_node_alsz); if (err != 0) { goto out; } else { } lnum = lnum + 1; ldv_27642: ; if (lnum <= 2) { goto ldv_27641; } else { } lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, c->lhead_lnum); goto ldv_27645; ldv_27644: err = fixup_leb(c, lnum, 0); if (err != 0) { goto out; } else { } lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, lnum); ldv_27645: ; if (c->ltail_lnum != lnum) { goto ldv_27644; } else { } err = fixup_leb(c, c->lhead_lnum, (int )(((unsigned int )c->min_io_size + 31U) & - ((unsigned int )c->min_io_size))); if (err != 0) { goto out; } else { } lnum = c->lpt_first; goto ldv_27649; ldv_27648: free = (c->ltab + (unsigned long )(lnum - c->lpt_first))->free; if (free > 0) { err = fixup_leb(c, lnum, c->leb_size - free); if (err != 0) { goto out; } else { } } else { } lnum = lnum + 1; ldv_27649: ; if (c->lpt_last >= lnum) { goto ldv_27648; } else { } lnum = c->orph_first; goto ldv_27652; ldv_27651: err = fixup_leb(c, lnum, 0); if (err != 0) { goto out; } else { } lnum = lnum + 1; ldv_27652: ; if (c->orph_last >= lnum) { goto ldv_27651; } else { } lnum = c->main_first; goto ldv_27655; ldv_27654: lprops = ubifs_lpt_lookup(c, lnum); tmp___0 = IS_ERR((void const *)lprops); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)lprops); err = (int )tmp; goto out; } else { } if (lprops->free > 0) { err = fixup_leb(c, lnum, c->leb_size - lprops->free); if (err != 0) { goto out; } else { } } else { } lnum = lnum + 1; ldv_27655: ; if (c->leb_cnt > lnum) { goto ldv_27654; } else { } out: ubifs_release_lprops(c); return (err); } } int ubifs_fixup_free_space(struct ubifs_info *c ) { int err ; struct ubifs_sb_node *sup ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 2048UL) == 0U, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fixup_free_space", 902, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fixup_free_space", 903, tmp___1->pid); dump_stack(); } else { } printk("\rUBIFS: start fixing up free space\n"); err = fixup_free_space(c); if (err != 0) { return (err); } else { } sup = ubifs_read_sb_node(c); tmp___4 = IS_ERR((void const *)sup); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)sup); return ((int )tmp___3); } else { } c->space_fixup = 0U; sup->flags = sup->flags & 4294967291U; err = ubifs_write_sb_node(c, sup); kfree((void const *)sup); if (err != 0) { return (err); } else { } printk("\rUBIFS: free space fixup complete\n"); return (err); } } void ldv_mutex_lock_237(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_238(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_239(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_240(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_241(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_242(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_243(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_244(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int ldv_mutex_is_locked_261(struct mutex *lock ) ; void ldv_mutex_lock_nested_257(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_262(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_265(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_267(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_254(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_256(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_258(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_260(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_263(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_264(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_266(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_268(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_253(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_255(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_259(struct mutex *ldv_func_arg1 ) ; int ldv_mutex_is_locked_io_mutex(struct mutex *lock ) ; extern u32 crc32_le(u32 , unsigned char const * , size_t ) ; __inline static ktime_t ktime_set(long const secs , unsigned long const nsecs ) { ktime_t __constr_expr_0 ; long tmp ; ktime_t __constr_expr_1 ; { tmp = ldv__builtin_expect((long long )secs > 9223372035LL, 0L); if (tmp != 0L) { __constr_expr_0.tv64 = 9223372036854775807LL; return (__constr_expr_0); } else { } __constr_expr_1.tv64 = (long long )secs * 1000000000LL + (long long )nsecs; return (__constr_expr_1); } } extern void hrtimer_init(struct hrtimer * , clockid_t , enum hrtimer_mode ) ; extern int hrtimer_start_range_ns(struct hrtimer * , ktime_t , unsigned long , enum hrtimer_mode const ) ; __inline static int hrtimer_active(struct hrtimer const *timer ) { { return ((unsigned long )timer->state != 0UL); } } extern int ubi_leb_read(struct ubi_volume_desc * , int , char * , int , int , int ) ; extern int ubi_leb_write(struct ubi_volume_desc * , int , void const * , int , int ) ; extern int ubi_leb_change(struct ubi_volume_desc * , int , void const * , int ) ; extern int ubi_leb_unmap(struct ubi_volume_desc * , int ) ; extern int ubi_leb_map(struct ubi_volume_desc * , int ) ; extern int ubi_is_mapped(struct ubi_volume_desc * , int ) ; __inline static int ubi_read(struct ubi_volume_desc *desc , int lnum , char *buf , int offset , int len ) { int tmp ; { tmp = ubi_leb_read(desc, lnum, buf, offset, len, 0); return (tmp); } } int ubifs_leb_write(struct ubifs_info *c , int lnum , void const *buf , int offs , int len ) ; int ubifs_leb_map(struct ubifs_info *c , int lnum ) ; int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf , void *buf , int type , int len , int lnum , int offs ) ; int ubifs_check_node(struct ubifs_info const *c , void const *buf , int lnum , int offs , int quiet , int must_chk_crc ) ; void ubifs_pad(struct ubifs_info const *c , void *buf , int pad ) ; int ubifs_bg_wbufs_sync(struct ubifs_info *c ) ; char const *dbg_ntype(int type ) ; void ubifs_dump_leb(struct ubifs_info const *c , int lnum ) ; int dbg_leb_write(struct ubifs_info *c , int lnum , void const *buf , int offs , int len ) ; int dbg_leb_change(struct ubifs_info *c , int lnum , void const *buf , int len ) ; int dbg_leb_unmap(struct ubifs_info *c , int lnum ) ; int dbg_leb_map(struct ubifs_info *c , int lnum ) ; __inline static void ubifs_wake_up_bgt(struct ubifs_info *c ) { { if ((unsigned long )c->bgt != (unsigned long )((struct task_struct *)0) && c->need_bgt == 0) { c->need_bgt = 1; wake_up_process(c->bgt); } else { } return; } } void ubifs_ro_mode(struct ubifs_info *c , int err ) { struct task_struct *tmp ; { if ((unsigned int )*((unsigned char *)c + 4080UL) == 0U) { c->ro_error = 1U; c->no_chk_data_crc = 0U; (c->vfs_sb)->s_flags = (c->vfs_sb)->s_flags | 1UL; tmp = get_current(); printk("\fUBIFS warning (pid %d): %s: switched to read-only mode, error %d\n", tmp->pid, "ubifs_ro_mode", err); dump_stack(); } else { } return; } } int ubifs_leb_read(struct ubifs_info const *c , int lnum , void *buf , int offs , int len , int even_ebadmsg ) { int err ; struct task_struct *tmp ; { err = ubi_read(c->ubi, lnum, (char *)buf, offs, len); if (err != 0 && (err != -74 || even_ebadmsg != 0)) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: reading %d bytes from LEB %d:%d failed, error %d\n", tmp->pid, "ubifs_leb_read", len, lnum, offs, err); dump_stack(); } else { } return (err); } } int ubifs_leb_write(struct ubifs_info *c , int lnum , void const *buf , int offs , int len ) { int err ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; { tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_write", 241, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_write", 241, tmp->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } tmp___2 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___2 == 0) { err = ubi_leb_write(c->ubi, lnum, buf, offs, len); } else { err = dbg_leb_write(c, lnum, buf, offs, len); } if (err != 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: writing %d bytes to LEB %d:%d failed, error %d\n", tmp___3->pid, "ubifs_leb_write", len, lnum, offs, err); ubifs_ro_mode(c, err); dump_stack(); } else { } return (err); } } int ubifs_leb_change(struct ubifs_info *c , int lnum , void const *buf , int len ) { int err ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; { tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_change", 261, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_change", 261, tmp->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } tmp___2 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___2 == 0) { err = ubi_leb_change(c->ubi, lnum, buf, len); } else { err = dbg_leb_change(c, lnum, buf, len); } if (err != 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: changing %d bytes in LEB %d failed, error %d\n", tmp___3->pid, "ubifs_leb_change", len, lnum, err); ubifs_ro_mode(c, err); dump_stack(); } else { } return (err); } } int ubifs_leb_unmap(struct ubifs_info *c , int lnum ) { int err ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; { tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_unmap", 281, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_unmap", 281, tmp->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } tmp___2 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___2 == 0) { err = ubi_leb_unmap(c->ubi, lnum); } else { err = dbg_leb_unmap(c, lnum); } if (err != 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: unmap LEB %d failed, error %d\n", tmp___3->pid, "ubifs_leb_unmap", lnum, err); ubifs_ro_mode(c, err); dump_stack(); } else { } return (err); } } int ubifs_leb_map(struct ubifs_info *c , int lnum ) { int err ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; { tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_map", 300, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_leb_map", 300, tmp->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } tmp___2 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___2 == 0) { err = ubi_leb_map(c->ubi, lnum); } else { err = dbg_leb_map(c, lnum); } if (err != 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: mapping LEB %d failed, error %d\n", tmp___3->pid, "ubifs_leb_map", lnum, err); ubifs_ro_mode(c, err); dump_stack(); } else { } return (err); } } int ubifs_is_mapped(struct ubifs_info const *c , int lnum ) { int err ; struct task_struct *tmp ; { err = ubi_is_mapped(c->ubi, lnum); if (err < 0) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: ubi_is_mapped failed for LEB %d, error %d\n", tmp->pid, "ubifs_is_mapped", lnum, err); dump_stack(); } else { } return (err); } } int ubifs_check_node(struct ubifs_info const *c , void const *buf , int lnum , int offs , int quiet , int must_chk_crc ) { int err ; int type ; int node_len ; uint32_t crc ; uint32_t node_crc ; uint32_t magic ; struct ubifs_ch const *ch ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; struct task_struct *tmp___8 ; struct task_struct *tmp___9 ; struct task_struct *tmp___10 ; struct task_struct *tmp___11 ; { err = -22; ch = (struct ubifs_ch const *)buf; tmp___0 = ldv__builtin_expect(lnum < 0, 0L); if (tmp___0 != 0L) { tmp___2 = 1; } else { tmp___1 = ldv__builtin_expect((int )c->leb_cnt <= lnum, 0L); if (tmp___1 != 0L) { tmp___2 = 1; } else { tmp___2 = 0; } } if (tmp___2 != 0) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_check_node", 363, tmp->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(offs < 0, 0L); if (tmp___3 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_check_node", 363, tmp->pid); dump_stack(); } else { } } tmp___5 = ldv__builtin_expect((offs & 7) != 0, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_check_node", 364, tmp___4->pid); dump_stack(); } else { tmp___6 = ldv__builtin_expect((int )c->leb_size <= offs, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_check_node", 364, tmp___4->pid); dump_stack(); } else { } } magic = ch->magic; if (magic != 101718065U) { if (quiet == 0) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: bad magic %#08x, expected %#08x\n", tmp___7->pid, "ubifs_check_node", magic, 101718065); } else { } err = -117; goto out; } else { } type = (int )ch->node_type; if (type < 0 || type > 11) { if (quiet == 0) { tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type %d\n", tmp___8->pid, "ubifs_check_node", type); } else { } goto out; } else { } node_len = (int )ch->len; if (node_len + offs > (int )c->leb_size) { goto out_len; } else { } if ((int )c->ranges[type].max_len == 0) { if ((int )c->ranges[type].ldv_26105.len != node_len) { goto out_len; } else if ((int )c->ranges[type].ldv_26105.min_len > node_len || (int )c->ranges[type].max_len < node_len) { goto out_len; } else { } } else { } if ((((must_chk_crc == 0 && type == 1) && (unsigned int )*((unsigned char *)c + 5528UL) == 0U) && (unsigned int )*((unsigned char *)c + 5528UL) == 0U) && (unsigned int )*((unsigned char *)c + 2048UL) != 0U) { return (0); } else { } crc = crc32_le(4294967295U, (unsigned char const *)buf + 8U, (size_t )(node_len + -8)); node_crc = ch->crc; if (crc != node_crc) { if (quiet == 0) { tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: bad CRC: calculated %#08x, read %#08x\n", tmp___9->pid, "ubifs_check_node", crc, node_crc); } else { } err = -117; goto out; } else { } return (0); out_len: ; if (quiet == 0) { tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node length %d\n", tmp___10->pid, "ubifs_check_node", node_len); } else { } out: ; if (quiet == 0) { tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node at LEB %d:%d\n", tmp___11->pid, "ubifs_check_node", lnum, offs); ubifs_dump_node(c, buf); dump_stack(); } else { } return (err); } } void ubifs_pad(struct ubifs_info const *c , void *buf , int pad ) { uint32_t crc ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct ubifs_ch *ch ; struct ubifs_pad_node *pad_node ; __u8 tmp___2 ; { tmp___0 = ldv__builtin_expect(pad < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_pad", 441, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((pad & 7) != 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_pad", 441, tmp->pid); dump_stack(); } else { } } if ((unsigned int )pad > 27U) { ch = (struct ubifs_ch *)buf; pad_node = (struct ubifs_pad_node *)buf; ch->magic = 101718065U; ch->node_type = 5U; ch->group_type = 0U; tmp___2 = 0U; ch->padding[1] = tmp___2; ch->padding[0] = tmp___2; ch->sqnum = 0ULL; ch->len = 28U; pad = (int )((unsigned int )pad - 28U); pad_node->pad_len = (unsigned int )pad; crc = crc32_le(4294967295U, (unsigned char const *)buf + 8U, 20UL); ch->crc = crc; memset(buf + 28UL, 0, (size_t )pad); } else if (pad > 0) { memset(buf, 206, (size_t )pad); } else { } return; } } static unsigned long long next_sqnum(struct ubifs_info *c ) { unsigned long long sqnum ; struct task_struct *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; { spin_lock(& c->cnt_lock); c->max_sqnum = c->max_sqnum + 1ULL; sqnum = c->max_sqnum; spin_unlock(& c->cnt_lock); tmp___1 = ldv__builtin_expect(sqnum > 0xfffffffeffffffffULL, 0L); if (tmp___1 != 0L) { if (sqnum > 0xfffffffffeffffffULL) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: sequence number overflow %llu, end of life\n", tmp->pid, "next_sqnum", sqnum); ubifs_ro_mode(c, -22); } else { } tmp___0 = get_current(); printk("\fUBIFS warning (pid %d): %s: running out of sequence numbers, end of life soon\n", tmp___0->pid, "next_sqnum"); } else { } return (sqnum); } } void ubifs_prepare_node(struct ubifs_info *c , void *node , int len , int pad ) { uint32_t crc ; struct ubifs_ch *ch ; unsigned long long sqnum ; unsigned long long tmp ; struct task_struct *tmp___0 ; long tmp___1 ; __u8 tmp___2 ; { ch = (struct ubifs_ch *)node; tmp = next_sqnum(c); sqnum = tmp; tmp___1 = ldv__builtin_expect((unsigned int )len <= 23U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_prepare_node", 504, tmp___0->pid); dump_stack(); } else { } ch->magic = 101718065U; ch->len = (unsigned int )len; ch->group_type = 0U; ch->sqnum = sqnum; tmp___2 = 0U; ch->padding[1] = tmp___2; ch->padding[0] = tmp___2; crc = crc32_le(4294967295U, (unsigned char const *)node + 8U, (size_t )(len + -8)); ch->crc = crc; if (pad != 0) { len = (len + 7) & -8; pad = (((c->min_io_size + -1) + len) & - c->min_io_size) - len; ubifs_pad((struct ubifs_info const *)c, node + (unsigned long )len, pad); } else { } return; } } void ubifs_prep_grp_node(struct ubifs_info *c , void *node , int len , int last ) { uint32_t crc ; struct ubifs_ch *ch ; unsigned long long sqnum ; unsigned long long tmp ; struct task_struct *tmp___0 ; long tmp___1 ; __u8 tmp___2 ; { ch = (struct ubifs_ch *)node; tmp = next_sqnum(c); sqnum = tmp; tmp___1 = ldv__builtin_expect((unsigned int )len <= 23U, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_prep_grp_node", 537, tmp___0->pid); dump_stack(); } else { } ch->magic = 101718065U; ch->len = (unsigned int )len; if (last != 0) { ch->group_type = 2U; } else { ch->group_type = 1U; } ch->sqnum = sqnum; tmp___2 = 0U; ch->padding[1] = tmp___2; ch->padding[0] = tmp___2; crc = crc32_le(4294967295U, (unsigned char const *)node + 8U, (size_t )(len + -8)); ch->crc = crc; return; } } static enum hrtimer_restart wbuf_timer_callback_nolock(struct hrtimer *timer ) { struct ubifs_wbuf *wbuf ; struct hrtimer const *__mptr ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; { __mptr = (struct hrtimer const *)timer; wbuf = (struct ubifs_wbuf *)__mptr + 0xfffffffffffffed0UL; descriptor.modname = "ubifs"; descriptor.function = "wbuf_timer_callback_nolock"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): jhead %s\n"; descriptor.lineno = 561U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_jhead(wbuf->jhead); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): jhead %s\n", tmp___0->pid, tmp); } else { } wbuf->need_sync = 1U; (wbuf->c)->need_wbuf_sync = 1; ubifs_wake_up_bgt(wbuf->c); return (0); } } static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf ) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct _ddebug descriptor ; u64 tmp___2 ; u64 tmp___3 ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; { tmp___0 = hrtimer_active((struct hrtimer const *)(& wbuf->timer)); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "new_wbuf_timer_nolock", 574, tmp->pid); dump_stack(); } else { } if ((unsigned int )*((unsigned char *)wbuf + 400UL) != 0U) { return; } else { } descriptor.modname = "ubifs"; descriptor.function = "new_wbuf_timer_nolock"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): set timer for jhead %s, %llu-%llu millisecs\n"; descriptor.lineno = 582U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___2 = div_u64((unsigned long long )wbuf->softlimit.tv64 + wbuf->delta, 1000000U); tmp___3 = div_u64((u64 )wbuf->softlimit.tv64, 1000000U); tmp___4 = dbg_jhead(wbuf->jhead); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): set timer for jhead %s, %llu-%llu millisecs\n", tmp___5->pid, tmp___4, tmp___3, tmp___2); } else { } hrtimer_start_range_ns(& wbuf->timer, wbuf->softlimit, (unsigned long )wbuf->delta, 1); return; } } static void cancel_wbuf_timer_nolock(struct ubifs_wbuf *wbuf ) { { if ((unsigned int )*((unsigned char *)wbuf + 400UL) != 0U) { return; } else { } wbuf->need_sync = 0U; hrtimer_cancel(& wbuf->timer); return; } } int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf ) { struct ubifs_info *c ; int err ; int dirt ; int sync_len ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; long tmp___13 ; long tmp___14 ; struct task_struct *tmp___15 ; long tmp___16 ; { c = wbuf->c; cancel_wbuf_timer_nolock(wbuf); if (wbuf->used == 0 || wbuf->lnum == -1) { return (0); } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_wbuf_sync_nolock"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, %d bytes, jhead %s\n"; descriptor.lineno = 623U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_jhead(wbuf->jhead); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, %d bytes, jhead %s\n", tmp___0->pid, wbuf->lnum, wbuf->offs, wbuf->used, tmp); } else { } tmp___3 = ldv__builtin_expect((wbuf->avail & 7) != 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 624, tmp___2->pid); dump_stack(); } else { } tmp___5 = ldv__builtin_expect(wbuf->offs + wbuf->size > c->leb_size, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 625, tmp___4->pid); dump_stack(); } else { } tmp___7 = ldv__builtin_expect(wbuf->size < c->min_io_size, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 626, tmp___6->pid); dump_stack(); } else { } tmp___9 = ldv__builtin_expect(wbuf->size > c->max_write_size, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 627, tmp___8->pid); dump_stack(); } else { } tmp___11 = ldv__builtin_expect(wbuf->size % c->min_io_size != 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 628, tmp___10->pid); dump_stack(); } else { } tmp___13 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 629, tmp___12->pid); dump_stack(); } else { tmp___14 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___14 != 0L) { tmp___12 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 629, tmp___12->pid); dump_stack(); } else { } } if (c->leb_size - wbuf->offs >= c->max_write_size) { tmp___16 = ldv__builtin_expect((wbuf->offs + wbuf->size) % c->max_write_size != 0, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_sync_nolock", 631, tmp___15->pid); dump_stack(); } else { } } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } sync_len = (wbuf->used + (c->min_io_size + -1)) & - c->min_io_size; dirt = sync_len - wbuf->used; if (dirt != 0) { ubifs_pad((struct ubifs_info const *)c, wbuf->buf + (unsigned long )wbuf->used, dirt); } else { } err = ubifs_leb_write(c, wbuf->lnum, (void const *)wbuf->buf, wbuf->offs, sync_len); if (err != 0) { return (err); } else { } spin_lock(& wbuf->lock); wbuf->offs = wbuf->offs + sync_len; if (c->leb_size - wbuf->offs < c->max_write_size) { wbuf->size = c->leb_size - wbuf->offs; } else if ((wbuf->offs & (c->max_write_size + -1)) != 0) { wbuf->size = ((wbuf->offs + (c->max_write_size + -1)) & - c->max_write_size) - wbuf->offs; } else { wbuf->size = c->max_write_size; } wbuf->avail = wbuf->size; wbuf->used = 0; wbuf->next_ino = 0; spin_unlock(& wbuf->lock); if ((unsigned long )wbuf->sync_callback != (unsigned long )((int (*)(struct ubifs_info * , int , int , int ))0)) { err = (*(wbuf->sync_callback))(c, wbuf->lnum, c->leb_size - wbuf->offs, dirt); } else { } return (err); } } int ubifs_wbuf_seek_nolock(struct ubifs_wbuf *wbuf , int lnum , int offs ) { struct ubifs_info const *c ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; { c = (struct ubifs_info const *)wbuf->c; descriptor.modname = "ubifs"; descriptor.function = "ubifs_wbuf_seek_nolock"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, jhead %s\n"; descriptor.lineno = 691U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_jhead(wbuf->jhead); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, jhead %s\n", tmp___0->pid, lnum, offs, tmp); } else { } tmp___3 = ldv__builtin_expect(lnum < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 692, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect((int )c->leb_cnt <= lnum, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 692, tmp___2->pid); dump_stack(); } else { } } tmp___6 = ldv__builtin_expect(offs < 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 693, tmp___5->pid); dump_stack(); } else { tmp___7 = ldv__builtin_expect((int )c->leb_size < offs, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 693, tmp___5->pid); dump_stack(); } else { } } tmp___9 = ldv__builtin_expect(offs % (int )c->min_io_size != 0, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 694, tmp___8->pid); dump_stack(); } else { tmp___10 = ldv__builtin_expect((offs & 7) != 0, 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 694, tmp___8->pid); dump_stack(); } else { } } tmp___12 = ldv__builtin_expect(wbuf->lnum == lnum, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 695, tmp___11->pid); dump_stack(); } else { } tmp___14 = ldv__builtin_expect(wbuf->used != 0, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_seek_nolock", 696, tmp___13->pid); dump_stack(); } else { } spin_lock(& wbuf->lock); wbuf->lnum = lnum; wbuf->offs = offs; if ((int )c->leb_size - wbuf->offs < (int )c->max_write_size) { wbuf->size = (int )c->leb_size - wbuf->offs; } else if ((wbuf->offs & ((int )c->max_write_size + -1)) != 0) { wbuf->size = ((wbuf->offs + ((int )c->max_write_size + -1)) & - ((int )c->max_write_size)) - wbuf->offs; } else { wbuf->size = c->max_write_size; } wbuf->avail = wbuf->size; wbuf->used = 0; spin_unlock(& wbuf->lock); return (0); } } int ubifs_bg_wbufs_sync(struct ubifs_info *c ) { int err ; int i ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; struct ubifs_wbuf *wbuf ; int tmp___4 ; struct task_struct *tmp___5 ; struct ubifs_wbuf *wbuf___0 ; { tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_bg_wbufs_sync", 726, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_bg_wbufs_sync", 726, tmp->pid); dump_stack(); } else { } } if (c->need_wbuf_sync == 0) { return (0); } else { } c->need_wbuf_sync = 0; if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { err = -30; goto out_timers; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_bg_wbufs_sync"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): synchronize\n"; descriptor.lineno = 736U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): synchronize\n", tmp___2->pid); } else { } i = 0; goto ldv_27692; ldv_27691: wbuf = & (c->jheads + (unsigned long )i)->wbuf; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared", 740, 0); _cond_resched(); tmp___4 = ldv_mutex_is_locked_261(& wbuf->io_mutex); if (tmp___4 != 0) { goto ldv_27690; } else { } ldv_mutex_lock_nested_262(& wbuf->io_mutex, (unsigned int )wbuf->jhead); if ((unsigned int )*((unsigned char *)wbuf + 400UL) == 0U) { ldv_mutex_unlock_263(& wbuf->io_mutex); goto ldv_27690; } else { } err = ubifs_wbuf_sync_nolock(wbuf); ldv_mutex_unlock_264(& wbuf->io_mutex); if (err != 0) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot sync write-buffer, error %d\n", tmp___5->pid, "ubifs_bg_wbufs_sync", err); ubifs_ro_mode(c, err); goto out_timers; } else { } ldv_27690: i = i + 1; ldv_27692: ; if (c->jhead_cnt > i) { goto ldv_27691; } else { } return (0); out_timers: i = 0; goto ldv_27696; ldv_27695: wbuf___0 = & (c->jheads + (unsigned long )i)->wbuf; ldv_mutex_lock_nested_265(& wbuf___0->io_mutex, (unsigned int )wbuf___0->jhead); cancel_wbuf_timer_nolock(wbuf___0); ldv_mutex_unlock_266(& wbuf___0->io_mutex); i = i + 1; ldv_27696: ; if (c->jhead_cnt > i) { goto ldv_27695; } else { } return (err); } } int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf , void *buf , int len ) { struct ubifs_info *c ; int err ; int written ; int n ; int aligned_len ; struct _ddebug descriptor ; char const *tmp ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; int tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; long tmp___13 ; struct task_struct *tmp___14 ; long tmp___15 ; long tmp___16 ; struct task_struct *tmp___17 ; long tmp___18 ; struct task_struct *tmp___19 ; long tmp___20 ; struct task_struct *tmp___21 ; long tmp___22 ; struct task_struct *tmp___23 ; int tmp___24 ; long tmp___25 ; struct task_struct *tmp___26 ; long tmp___27 ; long tmp___28 ; struct task_struct *tmp___29 ; long tmp___30 ; struct task_struct *tmp___31 ; long tmp___32 ; size_t __len ; void *__ret ; struct _ddebug descriptor___0 ; char const *tmp___33 ; struct task_struct *tmp___34 ; long tmp___35 ; struct _ddebug descriptor___1 ; char const *tmp___36 ; struct task_struct *tmp___37 ; long tmp___38 ; size_t __len___0 ; void *__ret___0 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___39 ; long tmp___40 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___41 ; long tmp___42 ; size_t __len___1 ; void *__ret___1 ; int free ; struct task_struct *tmp___43 ; { c = wbuf->c; aligned_len = (len + 7) & -8; descriptor.modname = "ubifs"; descriptor.function = "ubifs_wbuf_write_nolock"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): %d bytes (%s) to jhead %s wbuf at LEB %d:%d\n"; descriptor.lineno = 801U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp = dbg_jhead(wbuf->jhead); tmp___0 = dbg_ntype((int )((struct ubifs_ch *)buf)->node_type); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): %d bytes (%s) to jhead %s wbuf at LEB %d:%d\n", tmp___1->pid, len, tmp___0, tmp, wbuf->lnum, wbuf->offs + wbuf->used); } else { } tmp___4 = ldv__builtin_expect(len <= 0, 0L); if (tmp___4 != 0L) { tmp___6 = 1; } else { tmp___5 = ldv__builtin_expect(wbuf->lnum < 0, 0L); if (tmp___5 != 0L) { tmp___6 = 1; } else { tmp___6 = 0; } } if (tmp___6 != 0) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 802, tmp___3->pid); dump_stack(); } else { tmp___7 = ldv__builtin_expect(wbuf->lnum >= c->leb_cnt, 0L); if (tmp___7 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 802, tmp___3->pid); dump_stack(); } else { } } tmp___9 = ldv__builtin_expect(wbuf->offs < 0, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 803, tmp___8->pid); dump_stack(); } else { tmp___10 = ldv__builtin_expect(wbuf->offs % c->min_io_size != 0, 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 803, tmp___8->pid); dump_stack(); } else { } } tmp___12 = ldv__builtin_expect((wbuf->offs & 7) != 0, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 804, tmp___11->pid); dump_stack(); } else { tmp___13 = ldv__builtin_expect(wbuf->offs > c->leb_size, 0L); if (tmp___13 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 804, tmp___11->pid); dump_stack(); } else { } } tmp___15 = ldv__builtin_expect(wbuf->avail <= 0, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 805, tmp___14->pid); dump_stack(); } else { tmp___16 = ldv__builtin_expect(wbuf->avail > wbuf->size, 0L); if (tmp___16 != 0L) { tmp___14 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 805, tmp___14->pid); dump_stack(); } else { } } tmp___18 = ldv__builtin_expect(wbuf->size < c->min_io_size, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 806, tmp___17->pid); dump_stack(); } else { } tmp___20 = ldv__builtin_expect(wbuf->size > c->max_write_size, 0L); if (tmp___20 != 0L) { tmp___19 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 807, tmp___19->pid); dump_stack(); } else { } tmp___22 = ldv__builtin_expect(wbuf->size % c->min_io_size != 0, 0L); if (tmp___22 != 0L) { tmp___21 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 808, tmp___21->pid); dump_stack(); } else { } tmp___24 = mutex_is_locked(& wbuf->io_mutex); tmp___25 = ldv__builtin_expect(tmp___24 == 0, 0L); if (tmp___25 != 0L) { tmp___23 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 809, tmp___23->pid); dump_stack(); } else { } tmp___27 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 810, tmp___26->pid); dump_stack(); } else { tmp___28 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___28 != 0L) { tmp___26 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 810, tmp___26->pid); dump_stack(); } else { } } tmp___30 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 2048UL) != 0U, 0L); if (tmp___30 != 0L) { tmp___29 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 811, tmp___29->pid); dump_stack(); } else { } if (c->leb_size - wbuf->offs >= c->max_write_size) { tmp___32 = ldv__builtin_expect((wbuf->offs + wbuf->size) % c->max_write_size != 0, 0L); if (tmp___32 != 0L) { tmp___31 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_wbuf_write_nolock", 813, tmp___31->pid); dump_stack(); } else { } } else { } if ((c->leb_size - wbuf->offs) - wbuf->used < aligned_len) { err = -28; goto out; } else { } cancel_wbuf_timer_nolock(wbuf); if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } if (wbuf->avail >= aligned_len) { __len = (size_t )len; __ret = memcpy(wbuf->buf + (unsigned long )wbuf->used, (void const *)buf, __len); if (wbuf->avail == aligned_len) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_wbuf_write_nolock"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor___0.format = "UBIFS DBG io (pid %d): flush jhead %s wbuf to LEB %d:%d\n"; descriptor___0.lineno = 834U; descriptor___0.flags = 0U; tmp___35 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___35 != 0L) { tmp___33 = dbg_jhead(wbuf->jhead); tmp___34 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG io (pid %d): flush jhead %s wbuf to LEB %d:%d\n", tmp___34->pid, tmp___33, wbuf->lnum, wbuf->offs); } else { } err = ubifs_leb_write(c, wbuf->lnum, (void const *)wbuf->buf, wbuf->offs, wbuf->size); if (err != 0) { goto out; } else { } spin_lock(& wbuf->lock); wbuf->offs = wbuf->offs + wbuf->size; if (c->leb_size - wbuf->offs >= c->max_write_size) { wbuf->size = c->max_write_size; } else { wbuf->size = c->leb_size - wbuf->offs; } wbuf->avail = wbuf->size; wbuf->used = 0; wbuf->next_ino = 0; spin_unlock(& wbuf->lock); } else { spin_lock(& wbuf->lock); wbuf->avail = wbuf->avail - aligned_len; wbuf->used = wbuf->used + aligned_len; spin_unlock(& wbuf->lock); } goto exit; } else { } written = 0; if (wbuf->used != 0) { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_wbuf_write_nolock"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor___1.format = "UBIFS DBG io (pid %d): flush jhead %s wbuf to LEB %d:%d\n"; descriptor___1.lineno = 869U; descriptor___1.flags = 0U; tmp___38 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___38 != 0L) { tmp___36 = dbg_jhead(wbuf->jhead); tmp___37 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG io (pid %d): flush jhead %s wbuf to LEB %d:%d\n", tmp___37->pid, tmp___36, wbuf->lnum, wbuf->offs); } else { } __len___0 = (size_t )wbuf->avail; __ret___0 = memcpy(wbuf->buf + (unsigned long )wbuf->used, (void const *)buf, __len___0); err = ubifs_leb_write(c, wbuf->lnum, (void const *)wbuf->buf, wbuf->offs, wbuf->size); if (err != 0) { goto out; } else { } wbuf->offs = wbuf->offs + wbuf->size; len = len - wbuf->avail; aligned_len = aligned_len - wbuf->avail; written = wbuf->avail + written; } else if ((wbuf->offs & (c->max_write_size + -1)) != 0) { descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_wbuf_write_nolock"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor___2.format = "UBIFS DBG io (pid %d): write %d bytes to LEB %d:%d\n"; descriptor___2.lineno = 889U; descriptor___2.flags = 0U; tmp___40 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___40 != 0L) { tmp___39 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG io (pid %d): write %d bytes to LEB %d:%d\n", tmp___39->pid, wbuf->size, wbuf->lnum, wbuf->offs); } else { } err = ubifs_leb_write(c, wbuf->lnum, (void const *)buf, wbuf->offs, wbuf->size); if (err != 0) { goto out; } else { } wbuf->offs = wbuf->offs + wbuf->size; len = len - wbuf->size; aligned_len = aligned_len - wbuf->size; written = wbuf->size + written; } else { } n = aligned_len >> c->max_write_shift; if (n != 0) { n = n << c->max_write_shift; descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_wbuf_write_nolock"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor___3.format = "UBIFS DBG io (pid %d): write %d bytes to LEB %d:%d\n"; descriptor___3.lineno = 911U; descriptor___3.flags = 0U; tmp___42 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___42 != 0L) { tmp___41 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG io (pid %d): write %d bytes to LEB %d:%d\n", tmp___41->pid, n, wbuf->lnum, wbuf->offs); } else { } err = ubifs_leb_write(c, wbuf->lnum, (void const *)buf + (unsigned long )written, wbuf->offs, n); if (err != 0) { goto out; } else { } wbuf->offs = wbuf->offs + n; aligned_len = aligned_len - n; len = len - n; written = written + n; } else { } spin_lock(& wbuf->lock); if (aligned_len != 0) { __len___1 = (size_t )len; __ret___1 = memcpy(wbuf->buf, (void const *)buf + (unsigned long )written, __len___1); } else { } if (c->leb_size - wbuf->offs >= c->max_write_size) { wbuf->size = c->max_write_size; } else { wbuf->size = c->leb_size - wbuf->offs; } wbuf->avail = wbuf->size - aligned_len; wbuf->used = aligned_len; wbuf->next_ino = 0; spin_unlock(& wbuf->lock); exit: ; if ((unsigned long )wbuf->sync_callback != (unsigned long )((int (*)(struct ubifs_info * , int , int , int ))0)) { free = (c->leb_size - wbuf->offs) - wbuf->used; err = (*(wbuf->sync_callback))(c, wbuf->lnum, free, 0); if (err != 0) { goto out; } else { } } else { } if (wbuf->used != 0) { new_wbuf_timer_nolock(wbuf); } else { } return (0); out: tmp___43 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot write %d bytes to LEB %d:%d, error %d\n", tmp___43->pid, "ubifs_wbuf_write_nolock", len, wbuf->lnum, wbuf->offs, err); ubifs_dump_node((struct ubifs_info const *)c, (void const *)buf); dump_stack(); ubifs_dump_leb((struct ubifs_info const *)c, wbuf->lnum); return (err); } } int ubifs_write_node(struct ubifs_info *c , void *buf , int len , int lnum , int offs ) { int err ; int buf_len ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; int tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; { buf_len = ((c->min_io_size + -1) + len) & - c->min_io_size; descriptor.modname = "ubifs"; descriptor.function = "ubifs_write_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d (aligned %d)\n"; descriptor.lineno = 984U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_ntype((int )((struct ubifs_ch *)buf)->node_type); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d (aligned %d)\n", tmp___0->pid, lnum, offs, tmp, len, buf_len); } else { } tmp___3 = ldv__builtin_expect(lnum < 0, 0L); if (tmp___3 != 0L) { tmp___5 = 1; } else { tmp___4 = ldv__builtin_expect(c->leb_cnt <= lnum, 0L); if (tmp___4 != 0L) { tmp___5 = 1; } else { tmp___5 = 0; } } if (tmp___5 != 0) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 985, tmp___2->pid); dump_stack(); } else { tmp___6 = ldv__builtin_expect(offs < 0, 0L); if (tmp___6 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 985, tmp___2->pid); dump_stack(); } else { } } tmp___8 = ldv__builtin_expect(offs % c->min_io_size != 0, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 986, tmp___7->pid); dump_stack(); } else { tmp___9 = ldv__builtin_expect(c->leb_size <= offs, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 986, tmp___7->pid); dump_stack(); } else { } } tmp___11 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 987, tmp___10->pid); dump_stack(); } else { tmp___12 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___12 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 987, tmp___10->pid); dump_stack(); } else { } } tmp___14 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 2048UL) != 0U, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_node", 988, tmp___13->pid); dump_stack(); } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } ubifs_prepare_node(c, buf, len, 1); err = ubifs_leb_write(c, lnum, (void const *)buf, offs, buf_len); if (err != 0) { ubifs_dump_node((struct ubifs_info const *)c, (void const *)buf); } else { } return (err); } } int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf , void *buf , int type , int len , int lnum , int offs ) { struct ubifs_info const *c ; int err ; int rlen ; int overlap ; struct ubifs_ch *ch ; struct _ddebug descriptor ; char const *tmp ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; int tmp___6 ; long tmp___7 ; int tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; long tmp___15 ; int tmp___16 ; size_t __len ; void *__ret ; struct task_struct *tmp___17 ; struct task_struct *tmp___18 ; struct task_struct *tmp___19 ; struct task_struct *tmp___20 ; { c = (struct ubifs_info const *)wbuf->c; ch = (struct ubifs_ch *)buf; descriptor.modname = "ubifs"; descriptor.function = "ubifs_read_node_wbuf"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d, jhead %s\n"; descriptor.lineno = 1024U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp = dbg_jhead(wbuf->jhead); tmp___0 = dbg_ntype(type); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d, jhead %s\n", tmp___1->pid, lnum, offs, tmp___0, len, tmp); } else { } tmp___4 = ldv__builtin_expect((unsigned long )wbuf == (unsigned long )((struct ubifs_wbuf *)0), 0L); if (tmp___4 != 0L) { tmp___6 = 1; } else { tmp___5 = ldv__builtin_expect(lnum < 0, 0L); if (tmp___5 != 0L) { tmp___6 = 1; } else { tmp___6 = 0; } } if (tmp___6 != 0) { tmp___8 = 1; } else { tmp___7 = ldv__builtin_expect((int )c->leb_cnt <= lnum, 0L); if (tmp___7 != 0L) { tmp___8 = 1; } else { tmp___8 = 0; } } if (tmp___8 != 0) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node_wbuf", 1025, tmp___3->pid); dump_stack(); } else { tmp___9 = ldv__builtin_expect(offs < 0, 0L); if (tmp___9 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node_wbuf", 1025, tmp___3->pid); dump_stack(); } else { } } tmp___11 = ldv__builtin_expect((offs & 7) != 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node_wbuf", 1026, tmp___10->pid); dump_stack(); } else { tmp___12 = ldv__builtin_expect((int )c->leb_size <= offs, 0L); if (tmp___12 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node_wbuf", 1026, tmp___10->pid); dump_stack(); } else { } } tmp___14 = ldv__builtin_expect(type < 0, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node_wbuf", 1027, tmp___13->pid); dump_stack(); } else { tmp___15 = ldv__builtin_expect(type > 11, 0L); if (tmp___15 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node_wbuf", 1027, tmp___13->pid); dump_stack(); } else { } } spin_lock(& wbuf->lock); overlap = wbuf->lnum == lnum && offs + len > wbuf->offs; if (overlap == 0) { spin_unlock(& wbuf->lock); tmp___16 = ubifs_read_node(c, buf, type, len, lnum, offs); return (tmp___16); } else { } rlen = wbuf->offs - offs; if (rlen < 0) { rlen = 0; } else { } __len = (size_t )(len - rlen); __ret = memcpy(buf + (unsigned long )rlen, (void const *)(wbuf->buf + (((unsigned long )offs + (unsigned long )rlen) - (unsigned long )wbuf->offs)), __len); spin_unlock(& wbuf->lock); if (rlen > 0) { err = ubifs_leb_read(c, lnum, buf, offs, rlen, 0); if (err != 0 && err != -74) { return (err); } else { } } else { } if ((int )ch->node_type != type) { tmp___17 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type (%d but expected %d)\n", tmp___17->pid, "ubifs_read_node_wbuf", (int )ch->node_type, type); goto out; } else { } err = ubifs_check_node(c, (void const *)buf, lnum, offs, 0, 0); if (err != 0) { tmp___18 = get_current(); printk("\vUBIFS error (pid %d): %s: expected node type %d\n", tmp___18->pid, "ubifs_read_node_wbuf", type); return (err); } else { } rlen = (int )ch->len; if (rlen != len) { tmp___19 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node length %d, expected %d\n", tmp___19->pid, "ubifs_read_node_wbuf", rlen, len); goto out; } else { } return (0); out: tmp___20 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node at LEB %d:%d\n", tmp___20->pid, "ubifs_read_node_wbuf", lnum, offs); ubifs_dump_node(c, (void const *)buf); dump_stack(); return (-22); } } int ubifs_read_node(struct ubifs_info const *c , void *buf , int type , int len , int lnum , int offs ) { int err ; int l ; struct ubifs_ch *ch ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; int tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; long tmp___15 ; struct task_struct *tmp___16 ; struct task_struct *tmp___17 ; struct task_struct *tmp___18 ; int tmp___19 ; struct task_struct *tmp___20 ; { ch = (struct ubifs_ch *)buf; descriptor.modname = "ubifs"; descriptor.function = "ubifs_read_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/io.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d\n"; descriptor.lineno = 1099U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_ntype(type); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d\n", tmp___0->pid, lnum, offs, tmp, len); } else { } tmp___3 = ldv__builtin_expect(lnum < 0, 0L); if (tmp___3 != 0L) { tmp___5 = 1; } else { tmp___4 = ldv__builtin_expect((int )c->leb_cnt <= lnum, 0L); if (tmp___4 != 0L) { tmp___5 = 1; } else { tmp___5 = 0; } } if (tmp___5 != 0) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1100, tmp___2->pid); dump_stack(); } else { tmp___6 = ldv__builtin_expect(offs < 0, 0L); if (tmp___6 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1100, tmp___2->pid); dump_stack(); } else { } } tmp___8 = ldv__builtin_expect((unsigned int )len <= 23U, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1101, tmp___7->pid); dump_stack(); } else { tmp___9 = ldv__builtin_expect(offs + len > (int )c->leb_size, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1101, tmp___7->pid); dump_stack(); } else { } } tmp___11 = ldv__builtin_expect((offs & 7) != 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1102, tmp___10->pid); dump_stack(); } else { tmp___12 = ldv__builtin_expect((int )c->leb_size <= offs, 0L); if (tmp___12 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1102, tmp___10->pid); dump_stack(); } else { } } tmp___14 = ldv__builtin_expect(type < 0, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1103, tmp___13->pid); dump_stack(); } else { tmp___15 = ldv__builtin_expect(type > 11, 0L); if (tmp___15 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_read_node", 1103, tmp___13->pid); dump_stack(); } else { } } err = ubifs_leb_read(c, lnum, buf, offs, len, 0); if (err != 0 && err != -74) { return (err); } else { } if ((int )ch->node_type != type) { tmp___16 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type (%d but expected %d)\n", tmp___16->pid, "ubifs_read_node", (int )ch->node_type, type); goto out; } else { } err = ubifs_check_node(c, (void const *)buf, lnum, offs, 0, 0); if (err != 0) { tmp___17 = get_current(); printk("\vUBIFS error (pid %d): %s: expected node type %d\n", tmp___17->pid, "ubifs_read_node", type); return (err); } else { } l = (int )ch->len; if (l != len) { tmp___18 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node length %d, expected %d\n", tmp___18->pid, "ubifs_read_node", l, len); goto out; } else { } return (0); out: tmp___19 = ubi_is_mapped(c->ubi, lnum); tmp___20 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node at LEB %d:%d, LEB mapping status %d\n", tmp___20->pid, "ubifs_read_node", lnum, offs, tmp___19); ubifs_dump_node(c, (void const *)buf); dump_stack(); return (-22); } } int ubifs_wbuf_init(struct ubifs_info *c , struct ubifs_wbuf *wbuf ) { size_t size ; void *tmp ; int tmp___0 ; int tmp___1 ; struct lock_class_key __key ; struct lock_class_key __key___0 ; { wbuf->buf = kmalloc((size_t )c->max_write_size, 208U); if ((unsigned long )wbuf->buf == (unsigned long )((void *)0)) { return (-12); } else { } size = ((unsigned long )c->max_write_size / 24UL + 1UL) * 8UL; tmp = kmalloc(size, 208U); wbuf->inodes = (ino_t *)tmp; if ((unsigned long )wbuf->inodes == (unsigned long )((ino_t *)0)) { kfree((void const *)wbuf->buf); wbuf->buf = 0; return (-12); } else { } wbuf->used = 0; tmp___0 = -1; wbuf->offs = tmp___0; wbuf->lnum = tmp___0; size = (size_t )(c->max_write_size - c->leb_start % c->max_write_size); tmp___1 = (int )size; wbuf->size = tmp___1; wbuf->avail = tmp___1; wbuf->sync_callback = 0; __mutex_init(& wbuf->io_mutex, "&wbuf->io_mutex", & __key); spinlock_check(& wbuf->lock); __raw_spin_lock_init(& wbuf->lock.ldv_5961.rlock, "&(&wbuf->lock)->rlock", & __key___0); wbuf->c = c; wbuf->next_ino = 0; hrtimer_init(& wbuf->timer, 1, 1); wbuf->timer.function = & wbuf_timer_callback_nolock; wbuf->softlimit = ktime_set(3L, 0UL); wbuf->delta = 2ULL; wbuf->delta = wbuf->delta * 1000000000ULL; return (0); } } void ubifs_wbuf_add_ino_nolock(struct ubifs_wbuf *wbuf , ino_t inum ) { int tmp ; { if ((unsigned long )wbuf->buf == (unsigned long )((void *)0)) { return; } else { } spin_lock(& wbuf->lock); if (wbuf->used != 0) { tmp = wbuf->next_ino; wbuf->next_ino = wbuf->next_ino + 1; *(wbuf->inodes + (unsigned long )tmp) = inum; } else { } spin_unlock(& wbuf->lock); return; } } static int wbuf_has_ino(struct ubifs_wbuf *wbuf , ino_t inum ) { int i ; int ret ; { ret = 0; spin_lock(& wbuf->lock); i = 0; goto ldv_27790; ldv_27789: ; if (*(wbuf->inodes + (unsigned long )i) == inum) { ret = 1; goto ldv_27788; } else { } i = i + 1; ldv_27790: ; if (wbuf->next_ino > i) { goto ldv_27789; } else { } ldv_27788: spin_unlock(& wbuf->lock); return (ret); } } int ubifs_sync_wbufs_by_inode(struct ubifs_info *c , struct inode *inode ) { int i ; int err ; struct ubifs_wbuf *wbuf ; int tmp ; int tmp___0 ; { err = 0; i = 0; goto ldv_27800; ldv_27799: wbuf = & (c->jheads + (unsigned long )i)->wbuf; if (i == 0) { goto ldv_27798; } else { } tmp = wbuf_has_ino(wbuf, inode->i_ino); if (tmp == 0) { goto ldv_27798; } else { } ldv_mutex_lock_nested_267(& wbuf->io_mutex, (unsigned int )wbuf->jhead); tmp___0 = wbuf_has_ino(wbuf, inode->i_ino); if (tmp___0 != 0) { err = ubifs_wbuf_sync_nolock(wbuf); } else { } ldv_mutex_unlock_268(& wbuf->io_mutex); if (err != 0) { ubifs_ro_mode(c, err); return (err); } else { } ldv_27798: i = i + 1; ldv_27800: ; if (c->jhead_cnt > i) { goto ldv_27799; } else { } return (0); } } void ldv_mutex_lock_253(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_254(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_255(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_256(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_257(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_258(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_259(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_260(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int ldv_mutex_is_locked_261(struct mutex *lock ) { ldv_func_ret_type___7 ldv_func_res ; int tmp ; int tmp___0 ; { tmp = mutex_is_locked(lock); ldv_func_res = tmp; tmp___0 = ldv_mutex_is_locked_io_mutex(lock); return (tmp___0); return (ldv_func_res); } } void ldv_mutex_lock_nested_262(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_263(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_264(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_265(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_266(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_267(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_268(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void __set_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile ("bts %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr): "memory"); return; } } __inline static void __clear_bit(int nr , unsigned long volatile *addr ) { { __asm__ volatile ("btr %1,%0": "+m" (*((long volatile *)addr)): "Ir" (nr)); return; } } extern void *kmemdup(void const * , size_t , gfp_t ) ; void ldv_mutex_lock_nested_289(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_286(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_288(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_290(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_292(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_294(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_295(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_297(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_299(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_301(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_303(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_305(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_306(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_308(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_310(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_312(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_314(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_315(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_317(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_319(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_321(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_322(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_285(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_287(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_291(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_293(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_296(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_298(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_300(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_302(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_304(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_307(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_309(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_311(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_313(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_316(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_318(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_320(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_tnc_mutex(struct mutex *lock ) ; extern void rb_insert_color(struct rb_node * , struct rb_root * ) ; __inline static void rb_link_node(struct rb_node *node , struct rb_node *parent , struct rb_node **rb_link ) { struct rb_node *tmp ; { node->__rb_parent_color = (unsigned long )parent; tmp = 0; node->rb_right = tmp; node->rb_left = tmp; *rb_link = node; return; } } struct ubifs_wbuf *ubifs_get_wbuf(struct ubifs_info *c , int lnum ) ; int ubifs_lookup_level0(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_znode **zn , int *n ) ; int ubifs_tnc_replace(struct ubifs_info *c , union ubifs_key const *key , int old_lnum , int old_offs , int lnum , int offs , int len ) ; int ubifs_tnc_remove(struct ubifs_info *c , union ubifs_key const *key ) ; int ubifs_tnc_has_node(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs , int is_idx ) ; int ubifs_dirty_idx_node(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs ) ; void destroy_old_idx(struct ubifs_info *c ) ; int is_idx_node_in_tnc(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs ) ; int insert_old_idx_znode(struct ubifs_info *c , struct ubifs_znode *znode ) ; int ubifs_search_zbranch(struct ubifs_info const *c , struct ubifs_znode const *znode , union ubifs_key const *key , int *n ) ; struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c , struct ubifs_zbranch *zbr , struct ubifs_znode *parent , int iip ) ; int ubifs_tnc_read_node(struct ubifs_info *c , struct ubifs_zbranch *zbr , void *node ) ; int ubifs_validate_entry(struct ubifs_info *c , struct ubifs_dent_node const *dent ) ; void ubifs_dump_znode(struct ubifs_info const *c , struct ubifs_znode const *znode ) ; int dbg_check_tnc(struct ubifs_info *c , int extra ) ; __inline static int ubifs_zn_obsolete(struct ubifs_znode const *znode ) { int tmp ; { tmp = constant_test_bit(2U, (unsigned long const volatile *)(& znode->flags)); return (tmp != 0); } } __inline static int ubifs_zn_cow(struct ubifs_znode const *znode ) { int tmp ; { tmp = constant_test_bit(1U, (unsigned long const volatile *)(& znode->flags)); return (tmp != 0); } } __inline static void lowest_xent_key(struct ubifs_info const *c , union ubifs_key *key , ino_t inum ) { { key->u32[0] = (uint32_t )inum; key->u32[1] = 1610612736U; return; } } __inline static void highest_data_key(struct ubifs_info const *c , union ubifs_key *key , ino_t inum ) { { data_key_init(c, key, inum, 536870911U); return; } } __inline static int key_type(struct ubifs_info const *c , union ubifs_key const *key ) { { return ((int )(key->u32[1] >> 29)); } } __inline static void key_copy(struct ubifs_info const *c , union ubifs_key const *from , union ubifs_key *to ) { { to->u64[0] = from->u64[0]; return; } } __inline static int keys_cmp(struct ubifs_info const *c , union ubifs_key const *key1 , union ubifs_key const *key2 ) { { if (key1->u32[0] < key2->u32[0]) { return (-1); } else { } if (key1->u32[0] > key2->u32[0]) { return (1); } else { } if (key1->u32[1] < key2->u32[1]) { return (-1); } else { } if (key1->u32[1] > key2->u32[1]) { return (1); } else { } return (0); } } __inline static int keys_eq(struct ubifs_info const *c , union ubifs_key const *key1 , union ubifs_key const *key2 ) { { if (key1->u32[0] != key2->u32[0]) { return (0); } else { } if (key1->u32[1] != key2->u32[1]) { return (0); } else { } return (1); } } __inline static int is_hash_key(struct ubifs_info const *c , union ubifs_key const *key ) { int type ; int tmp ; { tmp = key_type(c, key); type = tmp; return (type == 2 || type == 3); } } static int insert_old_idx(struct ubifs_info *c , int lnum , int offs ) { struct ubifs_old_idx *old_idx ; struct ubifs_old_idx *o ; struct rb_node **p ; struct rb_node *parent ; void *tmp ; long tmp___0 ; struct rb_node const *__mptr ; struct task_struct *tmp___1 ; { parent = 0; tmp = kmalloc(32UL, 80U); old_idx = (struct ubifs_old_idx *)tmp; tmp___0 = ldv__builtin_expect((unsigned long )old_idx == (unsigned long )((struct ubifs_old_idx *)0), 0L); if (tmp___0 != 0L) { return (-12); } else { } old_idx->lnum = lnum; old_idx->offs = offs; p = & c->old_idx.rb_node; goto ldv_27644; ldv_27643: parent = *p; __mptr = (struct rb_node const *)parent; o = (struct ubifs_old_idx *)__mptr; if (o->lnum > lnum) { p = & (*p)->rb_left; } else if (o->lnum < lnum) { p = & (*p)->rb_right; } else if (o->offs > offs) { p = & (*p)->rb_left; } else if (o->offs < offs) { p = & (*p)->rb_right; } else { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: old idx added twice!\n", tmp___1->pid, "insert_old_idx"); kfree((void const *)old_idx); return (0); } ldv_27644: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27643; } else { } rb_link_node(& old_idx->rb, parent, p); rb_insert_color(& old_idx->rb, & c->old_idx); return (0); } } int insert_old_idx_znode(struct ubifs_info *c , struct ubifs_znode *znode ) { struct ubifs_zbranch *zbr ; int tmp ; int tmp___0 ; { if ((unsigned long )znode->parent != (unsigned long )((struct ubifs_znode *)0)) { zbr = (struct ubifs_zbranch *)(& (znode->parent)->zbranch) + (unsigned long )znode->iip; if (zbr->len != 0) { tmp = insert_old_idx(c, zbr->lnum, zbr->offs); return (tmp); } else { } } else if (c->zroot.len != 0) { tmp___0 = insert_old_idx(c, c->zroot.lnum, c->zroot.offs); return (tmp___0); } else { } return (0); } } static int ins_clr_old_idx_znode(struct ubifs_info *c , struct ubifs_znode *znode ) { int err ; struct ubifs_zbranch *zbr ; { if ((unsigned long )znode->parent != (unsigned long )((struct ubifs_znode *)0)) { zbr = (struct ubifs_zbranch *)(& (znode->parent)->zbranch) + (unsigned long )znode->iip; if (zbr->len != 0) { err = insert_old_idx(c, zbr->lnum, zbr->offs); if (err != 0) { return (err); } else { } zbr->lnum = 0; zbr->offs = 0; zbr->len = 0; } else { } } else if (c->zroot.len != 0) { err = insert_old_idx(c, c->zroot.lnum, c->zroot.offs); if (err != 0) { return (err); } else { } c->zroot.lnum = 0; c->zroot.offs = 0; c->zroot.len = 0; } else { } return (0); } } void destroy_old_idx(struct ubifs_info *c ) { struct rb_node *this ; struct ubifs_old_idx *old_idx ; struct rb_node const *__mptr ; struct rb_root __constr_expr_0 ; { this = c->old_idx.rb_node; goto ldv_27662; ldv_27665: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; goto ldv_27662; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; goto ldv_27662; } else { } __mptr = (struct rb_node const *)this; old_idx = (struct ubifs_old_idx *)__mptr; this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& old_idx->rb)) { this->rb_left = 0; } else { this->rb_right = 0; } } else { } kfree((void const *)old_idx); ldv_27662: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_27665; } else { } __constr_expr_0.rb_node = 0; c->old_idx = __constr_expr_0; return; } } static struct ubifs_znode *copy_znode(struct ubifs_info *c , struct ubifs_znode *znode ) { struct ubifs_znode *zn ; void *tmp ; void *tmp___0 ; long tmp___1 ; size_t __len ; void *__ret ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; int i ; int n ; struct ubifs_zbranch *zbr ; { tmp = kmalloc((size_t )c->max_znode_sz, 80U); zn = (struct ubifs_znode *)tmp; tmp___1 = ldv__builtin_expect((unsigned long )zn == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___1 != 0L) { tmp___0 = ERR_PTR(-12L); return ((struct ubifs_znode *)tmp___0); } else { } __len = (size_t )c->max_znode_sz; __ret = memcpy((void *)zn, (void const *)znode, __len); zn->cnext = 0; __set_bit(0, (unsigned long volatile *)(& zn->flags)); __clear_bit(1, (unsigned long volatile *)(& zn->flags)); tmp___3 = ubifs_zn_obsolete((struct ubifs_znode const *)znode); tmp___4 = ldv__builtin_expect(tmp___3 != 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "copy_znode", 346, tmp___2->pid); dump_stack(); } else { } __set_bit(2, (unsigned long volatile *)(& znode->flags)); if (znode->level != 0) { n = zn->child_cnt; i = 0; goto ldv_27681; ldv_27680: zbr = (struct ubifs_zbranch *)(& zn->zbranch) + (unsigned long )i; if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { (zbr->ldv_26076.znode)->parent = zn; } else { } i = i + 1; ldv_27681: ; if (i < n) { goto ldv_27680; } else { } } else { } atomic_long_inc(& c->dirty_zn_cnt); return (zn); } } static int add_idx_dirt(struct ubifs_info *c , int lnum , int dirt ) { int tmp ; { c->calc_idx_sz = c->calc_idx_sz - (unsigned long long )((dirt + 7) & -8); tmp = ubifs_add_dirt(c, lnum, dirt); return (tmp); } } static struct ubifs_znode *dirty_cow_znode(struct ubifs_info *c , struct ubifs_zbranch *zbr ) { struct ubifs_znode *znode ; struct ubifs_znode *zn ; int err ; void *tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; long tmp___3 ; void *tmp___4 ; long tmp___5 ; void *tmp___6 ; long tmp___7 ; { znode = zbr->ldv_26076.znode; tmp___2 = ubifs_zn_cow((struct ubifs_znode const *)znode); if (tmp___2 == 0) { tmp___1 = test_and_set_bit(0, (unsigned long volatile *)(& znode->flags)); if (tmp___1 == 0) { atomic_long_inc(& c->dirty_zn_cnt); atomic_long_dec(& c->clean_zn_cnt); atomic_long_dec(& ubifs_clean_zn_cnt); err = add_idx_dirt(c, zbr->lnum, zbr->len); tmp___0 = ldv__builtin_expect(err != 0, 0L); if (tmp___0 != 0L) { tmp = ERR_PTR((long )err); return ((struct ubifs_znode *)tmp); } else { } } else { } return (znode); } else { } zn = copy_znode(c, znode); tmp___3 = IS_ERR((void const *)zn); if (tmp___3 != 0L) { return (zn); } else { } if (zbr->len != 0) { err = insert_old_idx(c, zbr->lnum, zbr->offs); tmp___5 = ldv__builtin_expect(err != 0, 0L); if (tmp___5 != 0L) { tmp___4 = ERR_PTR((long )err); return ((struct ubifs_znode *)tmp___4); } else { } err = add_idx_dirt(c, zbr->lnum, zbr->len); } else { err = 0; } zbr->ldv_26076.znode = zn; zbr->lnum = 0; zbr->offs = 0; zbr->len = 0; tmp___7 = ldv__builtin_expect(err != 0, 0L); if (tmp___7 != 0L) { tmp___6 = ERR_PTR((long )err); return ((struct ubifs_znode *)tmp___6); } else { } return (zn); } } static int lnc_add(struct ubifs_info *c , struct ubifs_zbranch *zbr , void const *node ) { int err ; void *lnc_node ; struct ubifs_dent_node const *dent ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; { dent = (struct ubifs_dent_node const *)node; tmp___0 = ldv__builtin_expect((unsigned long )zbr->ldv_26076.leaf != (unsigned long )((void *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lnc_add", 456, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(zbr->len == 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lnc_add", 457, tmp___1->pid); dump_stack(); } else { } tmp___4 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); tmp___5 = ldv__builtin_expect(tmp___4 == 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lnc_add", 458, tmp___3->pid); dump_stack(); } else { } err = ubifs_validate_entry(c, dent); if (err != 0) { dump_stack(); ubifs_dump_node((struct ubifs_info const *)c, (void const *)dent); return (err); } else { } lnc_node = kmemdup(node, (size_t )zbr->len, 80U); if ((unsigned long )lnc_node == (unsigned long )((void *)0)) { return (0); } else { } zbr->ldv_26076.leaf = lnc_node; return (0); } } static int lnc_add_directly(struct ubifs_info *c , struct ubifs_zbranch *zbr , void *node ) { int err ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { tmp___0 = ldv__builtin_expect((unsigned long )zbr->ldv_26076.leaf != (unsigned long )((void *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lnc_add_directly", 490, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(zbr->len == 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lnc_add_directly", 491, tmp___1->pid); dump_stack(); } else { } err = ubifs_validate_entry(c, (struct ubifs_dent_node const *)node); if (err != 0) { dump_stack(); ubifs_dump_node((struct ubifs_info const *)c, (void const *)node); return (err); } else { } zbr->ldv_26076.leaf = node; return (0); } } static void lnc_free(struct ubifs_zbranch *zbr ) { { if ((unsigned long )zbr->ldv_26076.leaf == (unsigned long )((void *)0)) { return; } else { } kfree((void const *)zbr->ldv_26076.leaf); zbr->ldv_26076.leaf = 0; return; } } static int tnc_read_node_nm(struct ubifs_info *c , struct ubifs_zbranch *zbr , void *node ) { int err ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; size_t __len ; void *__ret ; { tmp___0 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_read_node_nm", 533, tmp->pid); dump_stack(); } else { } if ((unsigned long )zbr->ldv_26076.leaf != (unsigned long )((void *)0)) { tmp___3 = ldv__builtin_expect(zbr->len == 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_read_node_nm", 537, tmp___2->pid); dump_stack(); } else { } __len = (size_t )zbr->len; __ret = memcpy(node, (void const *)zbr->ldv_26076.leaf, __len); return (0); } else { } err = ubifs_tnc_read_node(c, zbr, node); if (err != 0) { return (err); } else { } err = lnc_add(c, zbr, (void const *)node); return (err); } } static int try_read_node(struct ubifs_info const *c , void *buf , int type , int len , int lnum , int offs ) { int err ; int node_len ; struct ubifs_ch *ch ; uint32_t crc ; uint32_t node_crc ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; { ch = (struct ubifs_ch *)buf; descriptor.modname = "ubifs"; descriptor.function = "try_read_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d\n"; descriptor.lineno = 582U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_ntype(type); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, %s, length %d\n", tmp___0->pid, lnum, offs, tmp, len); } else { } err = ubifs_leb_read(c, lnum, buf, offs, len, 1); if (err != 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read node type %d from LEB %d:%d, error %d\n", tmp___2->pid, "try_read_node", type, lnum, offs, err); return (err); } else { } if (ch->magic != 101718065U) { return (0); } else { } if ((int )ch->node_type != type) { return (0); } else { } node_len = (int )ch->len; if (node_len != len) { return (0); } else { } if (((type == 1 && (unsigned int )*((unsigned char *)c + 2048UL) != 0U) && (unsigned int )*((unsigned char *)c + 5528UL) == 0U) && (unsigned int )*((unsigned char *)c + 5528UL) == 0U) { return (1); } else { } crc = crc32_le(4294967295U, (unsigned char const *)buf + 8U, (size_t )(node_len + -8)); node_crc = ch->crc; if (crc != node_crc) { return (0); } else { } return (1); } } static int fallible_read_node(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_zbranch *zbr , void *node ) { int ret ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; union ubifs_key node_key ; struct ubifs_dent_node *dent ; int tmp___3 ; char __tmp_key_buf___0[48U] ; struct _ddebug descriptor___0 ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; { descriptor.modname = "ubifs"; descriptor.function = "fallible_read_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): LEB %d:%d, key %s\n"; descriptor.lineno = 628U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): LEB %d:%d, key %s\n", tmp___0->pid, zbr->lnum, zbr->offs, tmp); } else { } tmp___2 = key_type((struct ubifs_info const *)c, key); ret = try_read_node((struct ubifs_info const *)c, node, tmp___2, zbr->len, zbr->lnum, zbr->offs); if (ret == 1) { dent = (struct ubifs_dent_node *)node; key_read((struct ubifs_info const *)c, (void const *)(& dent->key), & node_key); tmp___3 = keys_cmp((struct ubifs_info const *)c, key, (union ubifs_key const *)(& node_key)); if (tmp___3 != 0) { ret = 0; } else { } } else { } if (ret == 0 && (unsigned int )*((unsigned char *)c + 5528UL) != 0U) { descriptor___0.modname = "ubifs"; descriptor___0.function = "fallible_read_node"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG mnt (pid %d): dangling branch LEB %d:%d len %d, key %s\n"; descriptor___0.lineno = 643U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf___0), 48); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG mnt (pid %d): dangling branch LEB %d:%d len %d, key %s\n", tmp___5->pid, zbr->lnum, zbr->offs, zbr->len, tmp___4); } else { } } else { } return (ret); } } static int matches_name(struct ubifs_info *c , struct ubifs_zbranch *zbr , struct qstr const *nm ) { struct ubifs_dent_node *dent ; int nlen ; int err ; void *tmp ; int __min1 ; int __min2 ; { if ((unsigned long )zbr->ldv_26076.leaf == (unsigned long )((void *)0)) { tmp = kmalloc((size_t )zbr->len, 80U); dent = (struct ubifs_dent_node *)tmp; if ((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } err = ubifs_tnc_read_node(c, zbr, (void *)dent); if (err != 0) { goto out_free; } else { } err = lnc_add_directly(c, zbr, (void *)dent); if (err != 0) { goto out_free; } else { } } else { dent = (struct ubifs_dent_node *)zbr->ldv_26076.leaf; } nlen = (int )dent->nlen; __min1 = nlen; __min2 = (int )nm->ldv_7607.ldv_7605.len; err = memcmp((void const *)(& dent->name), (void const *)nm->name, (size_t )(__min1 < __min2 ? __min1 : __min2)); if (err == 0) { if ((unsigned int )nlen == (unsigned int )nm->ldv_7607.ldv_7605.len) { return (1); } else if ((unsigned int )nlen < (unsigned int )nm->ldv_7607.ldv_7605.len) { return (0); } else { return (2); } } else if (err < 0) { return (0); } else { return (2); } out_free: kfree((void const *)dent); return (err); } } static struct ubifs_znode *get_znode(struct ubifs_info *c , struct ubifs_znode *znode , int n ) { struct ubifs_zbranch *zbr ; { zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { znode = zbr->ldv_26076.znode; } else { znode = ubifs_load_znode(c, zbr, znode, n); } return (znode); } } static int tnc_next(struct ubifs_info *c , struct ubifs_znode **zn , int *n ) { struct ubifs_znode *znode ; int nn ; struct ubifs_znode *zp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { znode = *zn; nn = *n; nn = nn + 1; if (znode->child_cnt > nn) { *n = nn; return (0); } else { } ldv_27783: zp = znode->parent; if ((unsigned long )zp == (unsigned long )((struct ubifs_znode *)0)) { return (-2); } else { } nn = znode->iip + 1; znode = zp; if (znode->child_cnt > nn) { znode = get_znode(c, znode, nn); tmp___0 = IS_ERR((void const *)znode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)znode); return ((int )tmp); } else { } goto ldv_27780; ldv_27779: znode = get_znode(c, znode, 0); tmp___2 = IS_ERR((void const *)znode); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)znode); return ((int )tmp___1); } else { } ldv_27780: ; if (znode->level != 0) { goto ldv_27779; } else { } nn = 0; goto ldv_27782; } else { } goto ldv_27783; ldv_27782: *zn = znode; *n = nn; return (0); } } static int tnc_prev(struct ubifs_info *c , struct ubifs_znode **zn , int *n ) { struct ubifs_znode *znode ; int nn ; struct ubifs_znode *zp ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { znode = *zn; nn = *n; if (nn > 0) { *n = nn + -1; return (0); } else { } ldv_27796: zp = znode->parent; if ((unsigned long )zp == (unsigned long )((struct ubifs_znode *)0)) { return (-2); } else { } nn = znode->iip + -1; znode = zp; if (nn >= 0) { znode = get_znode(c, znode, nn); tmp___0 = IS_ERR((void const *)znode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)znode); return ((int )tmp); } else { } goto ldv_27793; ldv_27792: nn = znode->child_cnt + -1; znode = get_znode(c, znode, nn); tmp___2 = IS_ERR((void const *)znode); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)znode); return ((int )tmp___1); } else { } ldv_27793: ; if (znode->level != 0) { goto ldv_27792; } else { } nn = znode->child_cnt + -1; goto ldv_27795; } else { } goto ldv_27796; ldv_27795: *zn = znode; *n = nn; return (0); } } static int resolve_collision(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_znode **zn , int *n , struct qstr const *nm ) { int err ; long tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; int nn ; struct ubifs_znode *znode ; int tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; { err = matches_name(c, (struct ubifs_zbranch *)(& (*zn)->zbranch) + (unsigned long )*n, nm); tmp = ldv__builtin_expect(err < 0, 0L); if (tmp != 0L) { return (err); } else { } if (err == 1) { return (1); } else { } if (err == 2) { ldv_27806: err = tnc_prev(c, zn, n); if (err == -2) { tmp___1 = ldv__builtin_expect(*n != 0, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "resolve_collision", 844, tmp___0->pid); dump_stack(); } else { } *n = -1; return (0); } else { } if (err < 0) { return (err); } else { } tmp___5 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& (*zn)->zbranch[*n].key), key); if (tmp___5 != 0) { if (*n == (*zn)->child_cnt + -1) { err = tnc_next(c, zn, n); if (err != 0) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "resolve_collision", 884, tmp___2->pid); dump_stack(); if (err == -2) { err = -22; } else { } return (err); } else { } tmp___4 = ldv__builtin_expect(*n != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "resolve_collision", 889, tmp___3->pid); dump_stack(); } else { } *n = -1; } else { } return (0); } else { } err = matches_name(c, (struct ubifs_zbranch *)(& (*zn)->zbranch) + (unsigned long )*n, nm); if (err < 0) { return (err); } else { } if (err == 0) { return (0); } else { } if (err == 1) { return (1); } else { } tmp___7 = ldv__builtin_expect(err != 2, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "resolve_collision", 901, tmp___6->pid); dump_stack(); } else { } goto ldv_27806; } else { nn = *n; znode = *zn; ldv_27809: err = tnc_next(c, & znode, & nn); if (err == -2) { return (0); } else { } if (err < 0) { return (err); } else { } tmp___8 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[nn].key), key); if (tmp___8 != 0) { return (0); } else { } err = matches_name(c, (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )nn, nm); if (err < 0) { return (err); } else { } if (err == 2) { return (0); } else { } *zn = znode; *n = nn; if (err == 1) { return (1); } else { } tmp___10 = ldv__builtin_expect(err != 0, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "resolve_collision", 925, tmp___9->pid); dump_stack(); } else { } goto ldv_27809; } } } static int fallible_matches_name(struct ubifs_info *c , struct ubifs_zbranch *zbr , struct qstr const *nm ) { struct ubifs_dent_node *dent ; int nlen ; int err ; void *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; int __min1 ; int __min2 ; { if ((unsigned long )zbr->ldv_26076.leaf == (unsigned long )((void *)0)) { tmp = kmalloc((size_t )zbr->len, 80U); dent = (struct ubifs_dent_node *)tmp; if ((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } err = fallible_read_node(c, (union ubifs_key const *)(& zbr->key), zbr, (void *)dent); if (err < 0) { goto out_free; } else { } if (err == 0) { err = 3; goto out_free; } else { } tmp___1 = ldv__builtin_expect(err != 1, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fallible_matches_name", 966, tmp___0->pid); dump_stack(); } else { } err = lnc_add_directly(c, zbr, (void *)dent); if (err != 0) { goto out_free; } else { } } else { dent = (struct ubifs_dent_node *)zbr->ldv_26076.leaf; } nlen = (int )dent->nlen; __min1 = nlen; __min2 = (int )nm->ldv_7607.ldv_7605.len; err = memcmp((void const *)(& dent->name), (void const *)nm->name, (size_t )(__min1 < __min2 ? __min1 : __min2)); if (err == 0) { if ((unsigned int )nlen == (unsigned int )nm->ldv_7607.ldv_7605.len) { return (1); } else if ((unsigned int )nlen < (unsigned int )nm->ldv_7607.ldv_7605.len) { return (0); } else { return (2); } } else if (err < 0) { return (0); } else { return (2); } out_free: kfree((void const *)dent); return (err); } } static int fallible_resolve_collision(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_znode **zn , int *n , struct qstr const *nm , int adding ) { struct ubifs_znode *o_znode ; struct ubifs_znode *znode ; int o_n ; int err ; int cmp ; int unsure ; int nn ; long tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; int tmp___6 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; { o_znode = 0; znode = *zn; o_n = o_n; unsure = 0; nn = *n; cmp = fallible_matches_name(c, (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )nn, nm); tmp = ldv__builtin_expect(cmp < 0, 0L); if (tmp != 0L) { return (cmp); } else { } if (cmp == 1) { return (1); } else { } if (cmp == 3) { o_znode = znode; o_n = nn; unsure = 1; } else if (adding == 0) { unsure = 1; } else { } if (cmp == 2 || unsure != 0) { ldv_27841: err = tnc_prev(c, zn, n); if (err == -2) { tmp___1 = ldv__builtin_expect(*n != 0, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fallible_resolve_collision", 1045, tmp___0->pid); dump_stack(); } else { } *n = -1; goto ldv_27839; } else { } if (err < 0) { return (err); } else { } tmp___5 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& (*zn)->zbranch[*n].key), key); if (tmp___5 != 0) { if (*n == (*zn)->child_cnt + -1) { err = tnc_next(c, zn, n); if (err != 0) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fallible_resolve_collision", 1057, tmp___2->pid); dump_stack(); if (err == -2) { err = -22; } else { } return (err); } else { } tmp___4 = ldv__builtin_expect(*n != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fallible_resolve_collision", 1062, tmp___3->pid); dump_stack(); } else { } *n = -1; } else { } goto ldv_27839; } else { } err = fallible_matches_name(c, (struct ubifs_zbranch *)(& (*zn)->zbranch) + (unsigned long )*n, nm); if (err < 0) { return (err); } else { } if (err == 1) { return (1); } else { } if (err == 3) { o_znode = *zn; o_n = *n; goto ldv_27840; } else { } if (adding == 0) { goto ldv_27840; } else { } if (err == 0) { goto ldv_27839; } else { unsure = 0; } ldv_27840: ; goto ldv_27841; ldv_27839: ; } else { } if (cmp == 0 || unsure != 0) { *zn = znode; *n = nn; ldv_27843: err = tnc_next(c, & znode, & nn); if (err == -2) { goto ldv_27842; } else { } if (err < 0) { return (err); } else { } tmp___6 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[nn].key), key); if (tmp___6 != 0) { goto ldv_27842; } else { } err = fallible_matches_name(c, (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )nn, nm); if (err < 0) { return (err); } else { } if (err == 2) { goto ldv_27842; } else { } *zn = znode; *n = nn; if (err == 1) { return (1); } else { } if (err == 3) { o_znode = znode; o_n = nn; } else { } goto ldv_27843; ldv_27842: ; } else { } if (adding != 0 || (unsigned long )o_znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } descriptor.modname = "ubifs"; descriptor.function = "fallible_resolve_collision"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): dangling match LEB %d:%d len %d key %s\n"; descriptor.lineno = 1120U; descriptor.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___7 = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___8 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): dangling match LEB %d:%d len %d key %s\n", tmp___8->pid, o_znode->zbranch[o_n].lnum, o_znode->zbranch[o_n].offs, o_znode->zbranch[o_n].len, tmp___7); } else { } *zn = o_znode; *n = o_n; return (1); } } static int matches_position(struct ubifs_zbranch *zbr , int lnum , int offs ) { { if (zbr->lnum == lnum && zbr->offs == offs) { return (1); } else { return (0); } } } static int resolve_collision_directly(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_znode **zn , int *n , int lnum , int offs ) { struct ubifs_znode *znode ; int nn ; int err ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { znode = *zn; nn = *n; tmp = matches_position((struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )nn, lnum, offs); if (tmp != 0) { return (1); } else { } ldv_27863: err = tnc_prev(c, & znode, & nn); if (err == -2) { goto ldv_27862; } else { } if (err < 0) { return (err); } else { } tmp___0 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[nn].key), key); if (tmp___0 != 0) { goto ldv_27862; } else { } tmp___1 = matches_position((struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )nn, lnum, offs); if (tmp___1 != 0) { *zn = znode; *n = nn; return (1); } else { } goto ldv_27863; ldv_27862: znode = *zn; nn = *n; ldv_27864: err = tnc_next(c, & znode, & nn); if (err == -2) { return (0); } else { } if (err < 0) { return (err); } else { } tmp___2 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[nn].key), key); if (tmp___2 != 0) { return (0); } else { } *zn = znode; *n = nn; tmp___3 = matches_position((struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )nn, lnum, offs); if (tmp___3 != 0) { return (1); } else { } goto ldv_27864; } } static struct ubifs_znode *dirty_cow_bottom_up(struct ubifs_info *c , struct ubifs_znode *znode ) { struct ubifs_znode *zp ; int *path ; int p ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; void *tmp___3 ; void *tmp___4 ; int n ; struct task_struct *tmp___5 ; long tmp___6 ; int tmp___7 ; int tmp___8 ; struct ubifs_zbranch *zbr ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; long tmp___15 ; struct task_struct *tmp___16 ; long tmp___17 ; struct task_struct *tmp___18 ; long tmp___19 ; { path = c->bottom_up_buf; p = 0; tmp___0 = ldv__builtin_expect((unsigned long )c->zroot.ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1222, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1223, tmp___1->pid); dump_stack(); } else { } if ((c->zroot.ldv_26076.znode)->level > 64) { kfree((void const *)c->bottom_up_buf); tmp___3 = kmalloc((unsigned long )(c->zroot.ldv_26076.znode)->level * 4UL, 80U); c->bottom_up_buf = (int *)tmp___3; if ((unsigned long )c->bottom_up_buf == (unsigned long )((int *)0)) { tmp___4 = ERR_PTR(-12L); return ((struct ubifs_znode *)tmp___4); } else { } path = c->bottom_up_buf; } else { } if ((c->zroot.ldv_26076.znode)->level != 0) { ldv_27875: zp = znode->parent; if ((unsigned long )zp == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_27874; } else { } n = znode->iip; tmp___6 = ldv__builtin_expect((c->zroot.ldv_26076.znode)->level <= p, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1241, tmp___5->pid); dump_stack(); } else { } tmp___7 = p; p = p + 1; *(path + (unsigned long )tmp___7) = n; if ((unsigned long )zp->cnext == (unsigned long )((struct ubifs_znode *)0)) { tmp___8 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___8 != 0) { goto ldv_27874; } else { } } else { } znode = zp; goto ldv_27875; ldv_27874: ; } else { } ldv_27878: zp = znode->parent; if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { tmp___10 = ldv__builtin_expect(*(path + ((unsigned long )p + 0xffffffffffffffffUL)) < 0, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1255, tmp___9->pid); dump_stack(); } else { } tmp___12 = ldv__builtin_expect(*(path + ((unsigned long )p + 0xffffffffffffffffUL)) >= zp->child_cnt, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1256, tmp___11->pid); dump_stack(); } else { } p = p - 1; zbr = (struct ubifs_zbranch *)(& zp->zbranch) + (unsigned long )*(path + (unsigned long )p); znode = dirty_cow_znode(c, zbr); } else { tmp___14 = ldv__builtin_expect((unsigned long )c->zroot.ldv_26076.znode != (unsigned long )znode, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1260, tmp___13->pid); dump_stack(); } else { } znode = dirty_cow_znode(c, & c->zroot); } tmp___15 = IS_ERR((void const *)znode); if (tmp___15 != 0L || p == 0) { goto ldv_27877; } else { } tmp___17 = ldv__builtin_expect(*(path + ((unsigned long )p + 0xffffffffffffffffUL)) < 0, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1265, tmp___16->pid); dump_stack(); } else { } tmp___19 = ldv__builtin_expect(*(path + ((unsigned long )p + 0xffffffffffffffffUL)) >= znode->child_cnt, 0L); if (tmp___19 != 0L) { tmp___18 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_bottom_up", 1266, tmp___18->pid); dump_stack(); } else { } znode = znode->zbranch[*(path + ((unsigned long )p + 0xffffffffffffffffUL))].ldv_26076.znode; goto ldv_27878; ldv_27877: ; return (znode); } } int ubifs_lookup_level0(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_znode **zn , int *n ) { int err ; int exact ; struct ubifs_znode *znode ; unsigned long time ; unsigned long tmp ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; struct ubifs_zbranch *zbr ; long tmp___9 ; long tmp___10 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___11 ; long tmp___12 ; int tmp___13 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___14 ; long tmp___15 ; long tmp___16 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___17 ; long tmp___18 ; int tmp___19 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___20 ; long tmp___21 ; { tmp = get_seconds(); time = tmp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_lookup_level0"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): search key %s\n"; descriptor.lineno = 1302U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): search key %s\n", tmp___1->pid, tmp___0); } else { } tmp___4 = key_type((struct ubifs_info const *)c, key); tmp___5 = ldv__builtin_expect(tmp___4 > 3, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lookup_level0", 1303, tmp___3->pid); dump_stack(); } else { } znode = c->zroot.ldv_26076.znode; tmp___8 = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___8 != 0L) { znode = ubifs_load_znode(c, & c->zroot, 0, 0); tmp___7 = IS_ERR((void const *)znode); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)znode); return ((int )tmp___6); } else { } } else { } znode->time = time; ldv_27895: exact = ubifs_search_zbranch((struct ubifs_info const *)c, (struct ubifs_znode const *)znode, key, n); if (znode->level == 0) { goto ldv_27893; } else { } if (*n < 0) { *n = 0; } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )*n; if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { znode->time = time; znode = zbr->ldv_26076.znode; goto ldv_27894; } else { } znode = ubifs_load_znode(c, zbr, znode, *n); tmp___10 = IS_ERR((void const *)znode); if (tmp___10 != 0L) { tmp___9 = PTR_ERR((void const *)znode); return ((int )tmp___9); } else { } ldv_27894: ; goto ldv_27895; ldv_27893: *zn = znode; if (exact != 0) { goto _L; } else { tmp___13 = is_hash_key((struct ubifs_info const *)c, key); if (tmp___13 == 0) { goto _L; } else if (*n != -1) { _L: /* CIL Label */ descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_lookup_level0"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): found %d, lvl %d, n %d\n"; descriptor___0.lineno = 1340U; descriptor___0.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): found %d, lvl %d, n %d\n", tmp___11->pid, exact, znode->level, *n); } else { } return (exact); } else { } } err = tnc_prev(c, & znode, n); if (err == -2) { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_lookup_level0"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___1.format = "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n"; descriptor___1.lineno = 1389U; descriptor___1.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n", tmp___14->pid, znode->level); } else { } *n = -1; return (0); } else { } tmp___16 = ldv__builtin_expect(err < 0, 0L); if (tmp___16 != 0L) { return (err); } else { } tmp___19 = keys_cmp((struct ubifs_info const *)c, key, (union ubifs_key const *)(& znode->zbranch[*n].key)); if (tmp___19 != 0) { descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_lookup_level0"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___2.format = "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n"; descriptor___2.lineno = 1396U; descriptor___2.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n", tmp___17->pid, znode->level); } else { } *n = -1; return (0); } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_lookup_level0"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___3.format = "UBIFS DBG tnc (pid %d): found 1, lvl %d, n %d\n"; descriptor___3.lineno = 1401U; descriptor___3.flags = 0U; tmp___21 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___21 != 0L) { tmp___20 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG tnc (pid %d): found 1, lvl %d, n %d\n", tmp___20->pid, znode->level, *n); } else { } *zn = znode; return (1); } } static int lookup_level0_dirty(struct ubifs_info *c , union ubifs_key const *key , struct ubifs_znode **zn , int *n ) { int err ; int exact ; struct ubifs_znode *znode ; unsigned long time ; unsigned long tmp ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; struct ubifs_zbranch *zbr ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___14 ; long tmp___15 ; int tmp___16 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___17 ; long tmp___18 ; long tmp___19 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___20 ; long tmp___21 ; int tmp___22 ; long tmp___23 ; long tmp___24 ; int tmp___25 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___26 ; long tmp___27 ; { tmp = get_seconds(); time = tmp; descriptor.modname = "ubifs"; descriptor.function = "lookup_level0_dirty"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): search and dirty key %s\n"; descriptor.lineno = 1438U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): search and dirty key %s\n", tmp___1->pid, tmp___0); } else { } znode = c->zroot.ldv_26076.znode; tmp___5 = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___5 != 0L) { znode = ubifs_load_znode(c, & c->zroot, 0, 0); tmp___4 = IS_ERR((void const *)znode); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)znode); return ((int )tmp___3); } else { } } else { } znode = dirty_cow_znode(c, & c->zroot); tmp___7 = IS_ERR((void const *)znode); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)znode); return ((int )tmp___6); } else { } znode->time = time; ldv_27916: exact = ubifs_search_zbranch((struct ubifs_info const *)c, (struct ubifs_znode const *)znode, key, n); if (znode->level == 0) { goto ldv_27914; } else { } if (*n < 0) { *n = 0; } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )*n; if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { znode->time = time; znode = dirty_cow_znode(c, zbr); tmp___9 = IS_ERR((void const *)znode); if (tmp___9 != 0L) { tmp___8 = PTR_ERR((void const *)znode); return ((int )tmp___8); } else { } goto ldv_27915; } else { } znode = ubifs_load_znode(c, zbr, znode, *n); tmp___11 = IS_ERR((void const *)znode); if (tmp___11 != 0L) { tmp___10 = PTR_ERR((void const *)znode); return ((int )tmp___10); } else { } znode = dirty_cow_znode(c, zbr); tmp___13 = IS_ERR((void const *)znode); if (tmp___13 != 0L) { tmp___12 = PTR_ERR((void const *)znode); return ((int )tmp___12); } else { } ldv_27915: ; goto ldv_27916; ldv_27914: *zn = znode; if (exact != 0) { goto _L; } else { tmp___16 = is_hash_key((struct ubifs_info const *)c, key); if (tmp___16 == 0) { goto _L; } else if (*n != -1) { _L: /* CIL Label */ descriptor___0.modname = "ubifs"; descriptor___0.function = "lookup_level0_dirty"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): found %d, lvl %d, n %d\n"; descriptor___0.lineno = 1484U; descriptor___0.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): found %d, lvl %d, n %d\n", tmp___14->pid, exact, znode->level, *n); } else { } return (exact); } else { } } err = tnc_prev(c, & znode, n); if (err == -2) { *n = -1; descriptor___1.modname = "ubifs"; descriptor___1.function = "lookup_level0_dirty"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___1.format = "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n"; descriptor___1.lineno = 1495U; descriptor___1.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n", tmp___17->pid, znode->level); } else { } return (0); } else { } tmp___19 = ldv__builtin_expect(err < 0, 0L); if (tmp___19 != 0L) { return (err); } else { } tmp___22 = keys_cmp((struct ubifs_info const *)c, key, (union ubifs_key const *)(& znode->zbranch[*n].key)); if (tmp___22 != 0) { *n = -1; descriptor___2.modname = "ubifs"; descriptor___2.function = "lookup_level0_dirty"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___2.format = "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n"; descriptor___2.lineno = 1502U; descriptor___2.flags = 0U; tmp___21 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___21 != 0L) { tmp___20 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG tnc (pid %d): found 0, lvl %d, n -1\n", tmp___20->pid, znode->level); } else { } return (0); } else { } if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { goto _L___0; } else { tmp___25 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___25 == 0) { _L___0: /* CIL Label */ znode = dirty_cow_bottom_up(c, znode); tmp___24 = IS_ERR((void const *)znode); if (tmp___24 != 0L) { tmp___23 = PTR_ERR((void const *)znode); return ((int )tmp___23); } else { } } else { } } descriptor___3.modname = "ubifs"; descriptor___3.function = "lookup_level0_dirty"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___3.format = "UBIFS DBG tnc (pid %d): found 1, lvl %d, n %d\n"; descriptor___3.lineno = 1512U; descriptor___3.flags = 0U; tmp___27 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG tnc (pid %d): found 1, lvl %d, n %d\n", tmp___26->pid, znode->level, *n); } else { } *zn = znode; return (1); } } static int maybe_leb_gced(struct ubifs_info *c , int lnum , int gc_seq1 ) { int gc_seq2 ; int gced_lnum ; { gced_lnum = c->gced_lnum; __asm__ volatile ("": : : "memory"); gc_seq2 = c->gc_seq; if (gc_seq1 == gc_seq2) { return (0); } else { } if (gc_seq1 + 1 != gc_seq2) { return (1); } else { } __asm__ volatile ("": : : "memory"); if (c->gced_lnum != gced_lnum) { return (1); } else { } if (gced_lnum == lnum) { return (1); } else { } return (0); } } int ubifs_tnc_locate(struct ubifs_info *c , union ubifs_key const *key , void *node , int *lnum , int *offs ) { int found ; int n ; int err ; int safely ; int gc_seq1 ; struct ubifs_znode *znode ; struct ubifs_zbranch zbr ; struct ubifs_zbranch *zt ; int tmp ; struct ubifs_wbuf *tmp___0 ; int tmp___1 ; { safely = 0; again: ldv_mutex_lock_293(& c->tnc_mutex); found = ubifs_lookup_level0(c, key, & znode, & n); if (found == 0) { err = -2; goto out; } else if (found < 0) { err = found; goto out; } else { } zt = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if ((unsigned long )lnum != (unsigned long )((int *)0)) { *lnum = zt->lnum; *offs = zt->offs; } else { } tmp = is_hash_key((struct ubifs_info const *)c, key); if (tmp != 0) { err = tnc_read_node_nm(c, zt, node); goto out; } else { } if (safely != 0) { err = ubifs_tnc_read_node(c, zt, node); goto out; } else { } zbr = znode->zbranch[n]; gc_seq1 = c->gc_seq; ldv_mutex_unlock_294(& c->tnc_mutex); tmp___0 = ubifs_get_wbuf(c, zbr.lnum); if ((unsigned long )tmp___0 != (unsigned long )((struct ubifs_wbuf *)0)) { err = ubifs_tnc_read_node(c, & zbr, node); return (err); } else { } err = fallible_read_node(c, key, & zbr, node); if (err <= 0) { safely = 1; goto again; } else { tmp___1 = maybe_leb_gced(c, zbr.lnum, gc_seq1); if (tmp___1 != 0) { safely = 1; goto again; } else { } } return (0); out: ldv_mutex_unlock_295(& c->tnc_mutex); return (err); } } int ubifs_tnc_get_bu_keys(struct ubifs_info *c , struct bu_info *bu ) { int n ; int err ; int lnum ; int offs ; int len ; unsigned int block ; unsigned int tmp ; struct ubifs_znode *znode ; int tmp___0 ; struct ubifs_zbranch *zbr ; union ubifs_key *key ; unsigned int next_block ; ino_t tmp___1 ; ino_t tmp___2 ; int tmp___3 ; int tmp___4 ; unsigned int tmp___5 ; unsigned int tmp___6 ; { err = 0; lnum = -1; offs = offs; len = len; tmp = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& bu->key)); block = tmp; bu->cnt = 0; bu->blk_cnt = 0; bu->eof = 0; ldv_mutex_lock_296(& c->tnc_mutex); err = ubifs_lookup_level0(c, (union ubifs_key const *)(& bu->key), & znode, & n); if (err < 0) { goto out; } else { } if (err != 0) { len = znode->zbranch[n].len; if (bu->buf_len < len) { err = -22; goto out; } else { } tmp___0 = bu->cnt; bu->cnt = bu->cnt + 1; bu->zbranch[tmp___0] = znode->zbranch[n]; bu->blk_cnt = bu->blk_cnt + 1; lnum = znode->zbranch[n].lnum; offs = ((znode->zbranch[n].offs + len) + 7) & -8; } else { } ldv_27960: err = tnc_next(c, & znode, & n); if (err != 0) { goto out; } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; key = & zbr->key; tmp___1 = key_inum((struct ubifs_info const *)c, (void const *)key); tmp___2 = key_inum((struct ubifs_info const *)c, (void const *)(& bu->key)); if (tmp___1 != tmp___2) { err = -2; goto out; } else { tmp___3 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key); if (tmp___3 != 1) { err = -2; goto out; } else { } } if (lnum < 0) { lnum = zbr->lnum; offs = ((zbr->offs + zbr->len) + 7) & -8; len = zbr->len; if (bu->buf_len < len) { err = -22; goto out; } else { } } else { if (zbr->lnum != lnum || zbr->offs != offs) { goto out; } else { } offs = ((zbr->len + 7) & -8) + offs; len = ((len + 7) & -8) + zbr->len; if (bu->buf_len < len) { goto out; } else { } } next_block = key_block((struct ubifs_info const *)c, (union ubifs_key const *)key); bu->blk_cnt = (int )(((unsigned int )bu->blk_cnt + (next_block - block)) - 1U); if (bu->blk_cnt > 31) { goto out; } else { } block = next_block; tmp___4 = bu->cnt; bu->cnt = bu->cnt + 1; bu->zbranch[tmp___4] = *zbr; bu->blk_cnt = bu->blk_cnt + 1; if (bu->cnt > 31) { goto out; } else { } if (bu->blk_cnt > 31) { goto out; } else { } goto ldv_27960; out: ; if (err == -2) { bu->eof = 1; err = 0; } else { } bu->gc_seq = c->gc_seq; ldv_mutex_unlock_297(& c->tnc_mutex); if (err != 0) { return (err); } else { } if (bu->blk_cnt > 32) { bu->blk_cnt = 32; } else { } return (0); if (bu->eof != 0) { bu->blk_cnt = bu->blk_cnt; return (0); } else { } tmp___5 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& bu->key)); block = tmp___5 + (unsigned int )bu->blk_cnt; block = block; goto ldv_27963; ldv_27962: tmp___6 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& bu->zbranch[bu->cnt + -1].key)); if (tmp___6 < block) { goto ldv_27961; } else { } bu->cnt = bu->cnt + -1; ldv_27963: ; if (bu->cnt != 0) { goto ldv_27962; } else { } ldv_27961: ; return (0); } } static int read_wbuf(struct ubifs_wbuf *wbuf , void *buf , int len , int lnum , int offs ) { struct ubifs_info const *c ; int rlen ; int overlap ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; long tmp___5 ; int tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; int tmp___13 ; size_t __len ; void *__ret ; int tmp___14 ; { c = (struct ubifs_info const *)wbuf->c; descriptor.modname = "ubifs"; descriptor.function = "read_wbuf"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG io (pid %d): LEB %d:%d, length %d\n"; descriptor.lineno = 1778U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG io (pid %d): LEB %d:%d, length %d\n", tmp->pid, lnum, offs, len); } else { } tmp___2 = ldv__builtin_expect((unsigned long )wbuf == (unsigned long )((struct ubifs_wbuf *)0), 0L); if (tmp___2 != 0L) { tmp___4 = 1; } else { tmp___3 = ldv__builtin_expect(lnum < 0, 0L); if (tmp___3 != 0L) { tmp___4 = 1; } else { tmp___4 = 0; } } if (tmp___4 != 0) { tmp___6 = 1; } else { tmp___5 = ldv__builtin_expect((int )c->leb_cnt <= lnum, 0L); if (tmp___5 != 0L) { tmp___6 = 1; } else { tmp___6 = 0; } } if (tmp___6 != 0) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "read_wbuf", 1779, tmp___1->pid); dump_stack(); } else { tmp___7 = ldv__builtin_expect(offs < 0, 0L); if (tmp___7 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "read_wbuf", 1779, tmp___1->pid); dump_stack(); } else { } } tmp___9 = ldv__builtin_expect((offs & 7) != 0, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "read_wbuf", 1780, tmp___8->pid); dump_stack(); } else { tmp___10 = ldv__builtin_expect((int )c->leb_size <= offs, 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "read_wbuf", 1780, tmp___8->pid); dump_stack(); } else { } } tmp___12 = ldv__builtin_expect(offs + len > (int )c->leb_size, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "read_wbuf", 1781, tmp___11->pid); dump_stack(); } else { } spin_lock(& wbuf->lock); overlap = wbuf->lnum == lnum && offs + len > wbuf->offs; if (overlap == 0) { spin_unlock(& wbuf->lock); tmp___13 = ubifs_leb_read(c, lnum, buf, offs, len, 0); return (tmp___13); } else { } rlen = wbuf->offs - offs; if (rlen < 0) { rlen = 0; } else { } __len = (size_t )(len - rlen); __ret = memcpy(buf + (unsigned long )rlen, (void const *)(wbuf->buf + (((unsigned long )offs + (unsigned long )rlen) - (unsigned long )wbuf->offs)), __len); spin_unlock(& wbuf->lock); if (rlen > 0) { tmp___14 = ubifs_leb_read(c, lnum, buf, offs, rlen, 0); return (tmp___14); } else { } return (0); } } static int validate_data_node(struct ubifs_info *c , void *buf , struct ubifs_zbranch *zbr ) { union ubifs_key key1 ; struct ubifs_ch *ch ; int err ; int len ; struct task_struct *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; char __tmp_key_buf___0[48U] ; struct _ddebug descriptor___0 ; char const *tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; int tmp___9 ; struct task_struct *tmp___10 ; { ch = (struct ubifs_ch *)buf; if ((unsigned int )ch->node_type != 1U) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type (%d but expected %d)\n", tmp->pid, "validate_data_node", (int )ch->node_type, 1); goto out_err; } else { } err = ubifs_check_node((struct ubifs_info const *)c, (void const *)buf, zbr->lnum, zbr->offs, 0, 0); if (err != 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: expected node type %d\n", tmp___0->pid, "validate_data_node", 1); goto out; } else { } len = (int )ch->len; if (zbr->len != len) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node length %d, expected %d\n", tmp___1->pid, "validate_data_node", len, zbr->len); goto out_err; } else { } key_read((struct ubifs_info const *)c, (void const *)buf + 24U, & key1); tmp___9 = keys_eq((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key), (union ubifs_key const *)(& key1)); if (tmp___9 == 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: bad key in node at LEB %d:%d\n", tmp___2->pid, "validate_data_node", zbr->lnum, zbr->offs); descriptor.modname = "ubifs"; descriptor.function = "validate_data_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): looked for key %s\n"; descriptor.lineno = 1845U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___3 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key), (char *)(& __tmp_key_buf), 48); tmp___4 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): looked for key %s\n", tmp___4->pid, tmp___3); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "validate_data_node"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): found node\'s key %s\n"; descriptor___0.lineno = 1846U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___6 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& key1), (char *)(& __tmp_key_buf___0), 48); tmp___7 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): found node\'s key %s\n", tmp___7->pid, tmp___6); } else { } goto out_err; } else { } return (0); out_err: err = -22; out: tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node at LEB %d:%d\n", tmp___10->pid, "validate_data_node", zbr->lnum, zbr->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)buf); dump_stack(); return (err); } } int ubifs_tnc_bulk_read(struct ubifs_info *c , struct bu_info *bu ) { int lnum ; int offs ; int len ; int err ; int i ; struct ubifs_wbuf *wbuf ; void *buf ; struct task_struct *tmp ; int tmp___0 ; struct task_struct *tmp___1 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; { lnum = bu->zbranch[0].lnum; offs = bu->zbranch[0].offs; len = bu->zbranch[bu->cnt + -1].offs; len = (bu->zbranch[bu->cnt + -1].len - offs) + len; if (bu->buf_len < len) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: buffer too small %d vs %d\n", tmp->pid, "ubifs_tnc_bulk_read", bu->buf_len, len); return (-22); } else { } wbuf = ubifs_get_wbuf(c, lnum); if ((unsigned long )wbuf != (unsigned long )((struct ubifs_wbuf *)0)) { err = read_wbuf(wbuf, bu->buf, len, lnum, offs); } else { err = ubifs_leb_read((struct ubifs_info const *)c, lnum, bu->buf, offs, len, 0); } tmp___0 = maybe_leb_gced(c, lnum, bu->gc_seq); if (tmp___0 != 0) { return (-11); } else { } if (err != 0 && err != -74) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: failed to read from LEB %d:%d, error %d\n", tmp___1->pid, "ubifs_tnc_bulk_read", lnum, offs, err); dump_stack(); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_bulk_read"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): key %s\n"; descriptor.lineno = 1899U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___2 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& bu->key), (char *)(& __tmp_key_buf), 48); tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): key %s\n", tmp___3->pid, tmp___2); } else { } return (err); } else { } buf = bu->buf; i = 0; goto ldv_28010; ldv_28009: err = validate_data_node(c, buf, (struct ubifs_zbranch *)(& bu->zbranch) + (unsigned long )i); if (err != 0) { return (err); } else { } buf = buf + (unsigned long )((bu->zbranch[i].len + 7) & -8); i = i + 1; ldv_28010: ; if (bu->cnt > i) { goto ldv_28009; } else { } return (0); } } static int do_lookup_nm(struct ubifs_info *c , union ubifs_key const *key , void *node , struct qstr const *nm ) { int found ; int n ; int err ; struct ubifs_znode *znode ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; { descriptor.modname = "ubifs"; descriptor.function = "do_lookup_nm"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): name \'%.*s\' key %s\n"; descriptor.lineno = 1934U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): name \'%.*s\' key %s\n", tmp___0->pid, nm->ldv_7607.ldv_7605.len, nm->name, tmp); } else { } ldv_mutex_lock_298(& c->tnc_mutex); found = ubifs_lookup_level0(c, key, & znode, & n); if (found == 0) { err = -2; goto out_unlock; } else if (found < 0) { err = found; goto out_unlock; } else { } tmp___3 = ldv__builtin_expect(n < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_lookup_nm", 1945, tmp___2->pid); dump_stack(); } else { } err = resolve_collision(c, key, & znode, & n, nm); descriptor___0.modname = "ubifs"; descriptor___0.function = "do_lookup_nm"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n"; descriptor___0.lineno = 1948U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n", tmp___4->pid, err, znode, n); } else { } tmp___6 = ldv__builtin_expect(err < 0, 0L); if (tmp___6 != 0L) { goto out_unlock; } else { } if (err == 0) { err = -2; goto out_unlock; } else { } err = tnc_read_node_nm(c, (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n, node); out_unlock: ldv_mutex_unlock_299(& c->tnc_mutex); return (err); } } int ubifs_tnc_lookup_nm(struct ubifs_info *c , union ubifs_key const *key , void *node , struct qstr const *nm ) { int err ; int len ; struct ubifs_dent_node const *dent ; int tmp ; int tmp___0 ; { dent = (struct ubifs_dent_node const *)node; err = ubifs_tnc_lookup(c, key, node); if (err != 0) { return (err); } else { } len = (int )dent->nlen; if ((unsigned int )nm->ldv_7607.ldv_7605.len == (unsigned int )len) { tmp = memcmp((void const *)(& dent->name), (void const *)nm->name, (size_t )len); if (tmp == 0) { return (0); } else { } } else { } tmp___0 = do_lookup_nm(c, key, node, nm); return (tmp___0); } } static void correct_parent_keys(struct ubifs_info const *c , struct ubifs_znode *znode ) { union ubifs_key *key ; union ubifs_key *key1 ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; int tmp___3 ; { tmp___0 = ldv__builtin_expect((unsigned long )znode->parent == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "correct_parent_keys", 2015, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(znode->iip != 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "correct_parent_keys", 2016, tmp___1->pid); dump_stack(); } else { } key = & znode->zbranch[0].key; key1 = & (znode->parent)->zbranch[0].key; goto ldv_28045; ldv_28044: key_copy(c, (union ubifs_key const *)key, key1); znode = znode->parent; znode->alt = 1; if ((unsigned long )znode->parent == (unsigned long )((struct ubifs_znode *)0) || znode->iip != 0) { goto ldv_28043; } else { } key1 = & (znode->parent)->zbranch[0].key; ldv_28045: tmp___3 = keys_cmp(c, (union ubifs_key const *)key, (union ubifs_key const *)key1); if (tmp___3 < 0) { goto ldv_28044; } else { } ldv_28043: ; return; } } static void insert_zbranch(struct ubifs_znode *znode , struct ubifs_zbranch const *zbr , int n ) { int i ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; { tmp___0 = ubifs_zn_dirty((struct ubifs_znode const *)znode); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "insert_zbranch", 2047, tmp->pid); dump_stack(); } else { } if (znode->level != 0) { i = znode->child_cnt; goto ldv_28054; ldv_28053: znode->zbranch[i] = znode->zbranch[i + -1]; if ((unsigned long )znode->zbranch[i].ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { (znode->zbranch[i].ldv_26076.znode)->iip = i; } else { } i = i - 1; ldv_28054: ; if (i > n) { goto ldv_28053; } else { } if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode */* const */)0)) { (zbr->ldv_26076.znode)->iip = n; } else { } } else { i = znode->child_cnt; goto ldv_28057; ldv_28056: znode->zbranch[i] = znode->zbranch[i + -1]; i = i - 1; ldv_28057: ; if (i > n) { goto ldv_28056; } else { } } znode->zbranch[n] = *zbr; znode->child_cnt = znode->child_cnt + 1; if (n == 0) { znode->alt = 1; } else { } return; } } static int tnc_insert(struct ubifs_info *c , struct ubifs_znode *znode , struct ubifs_zbranch *zbr , int n ) { struct ubifs_znode *zn ; struct ubifs_znode *zi ; struct ubifs_znode *zp ; int i ; int keep ; int move ; int appending ; union ubifs_key *key ; union ubifs_key *key1 ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; char __tmp_key_buf___0[48U] ; struct _ddebug descriptor___0 ; char const *tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; void *tmp___10 ; ino_t tmp___11 ; ino_t tmp___12 ; int tmp___13 ; ino_t tmp___14 ; ino_t tmp___15 ; int tmp___16 ; ino_t tmp___17 ; ino_t tmp___18 ; int tmp___19 ; int tmp___20 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___21 ; long tmp___22 ; char __tmp_key_buf___1[48U] ; struct _ddebug descriptor___2 ; char const *tmp___23 ; struct task_struct *tmp___24 ; long tmp___25 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___26 ; long tmp___27 ; void *tmp___28 ; { appending = 0; key = & zbr->key; tmp___0 = ldv__builtin_expect(n < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_insert", 2101, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(c->fanout < n, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_insert", 2101, tmp->pid); dump_stack(); } else { } } again: zp = znode->parent; if (znode->child_cnt < c->fanout) { tmp___3 = ldv__builtin_expect(c->fanout == n, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_insert", 2107, tmp___2->pid); dump_stack(); } else { } descriptor.modname = "ubifs"; descriptor.function = "tnc_insert"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): inserted at %d level %d, key %s\n"; descriptor.lineno = 2108U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf), 48); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): inserted at %d level %d, key %s\n", tmp___5->pid, n, znode->level, tmp___4); } else { } insert_zbranch(znode, (struct ubifs_zbranch const *)zbr, n); if ((n == 0 && (unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) && znode->iip == 0) { correct_parent_keys((struct ubifs_info const *)c, znode); } else { } return (0); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "tnc_insert"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): splitting level %d, key %s\n"; descriptor___0.lineno = 2123U; descriptor___0.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___7 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf___0), 48); tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): splitting level %d, key %s\n", tmp___8->pid, znode->level, tmp___7); } else { } if (znode->alt != 0) { ins_clr_old_idx_znode(c, znode); } else { } tmp___10 = kzalloc((size_t )c->max_znode_sz, 80U); zn = (struct ubifs_znode *)tmp___10; if ((unsigned long )zn == (unsigned long )((struct ubifs_znode *)0)) { return (-12); } else { } zn->parent = zp; zn->level = znode->level; if (znode->level == 0) { tmp___20 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key); if (tmp___20 == 1) { if (c->fanout == n) { key1 = & znode->zbranch[n + -1].key; tmp___11 = key_inum((struct ubifs_info const *)c, (void const *)key1); tmp___12 = key_inum((struct ubifs_info const *)c, (void const *)key); if (tmp___11 == tmp___12) { tmp___13 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key1); if (tmp___13 == 1) { appending = 1; } else { } } else { } } else { goto check_split; } } else { goto _L; } } else _L: /* CIL Label */ if (appending != 0 && c->fanout != n) { appending = 0; check_split: ; if ((c->fanout + 1) / 2 <= n) { key1 = & znode->zbranch[0].key; tmp___17 = key_inum((struct ubifs_info const *)c, (void const *)key1); tmp___18 = key_inum((struct ubifs_info const *)c, (void const *)key); if (tmp___17 == tmp___18) { tmp___19 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key1); if (tmp___19 == 1) { key1 = & znode->zbranch[n].key; tmp___14 = key_inum((struct ubifs_info const *)c, (void const *)key1); tmp___15 = key_inum((struct ubifs_info const *)c, (void const *)key); if (tmp___14 != tmp___15) { keep = n; move = c->fanout - keep; zi = znode; goto do_split; } else { tmp___16 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key1); if (tmp___16 != 1) { keep = n; move = c->fanout - keep; zi = znode; goto do_split; } else { } } } else { } } else { } } else { } } else { } if (appending != 0) { keep = c->fanout; move = 0; } else { keep = (c->fanout + 1) / 2; move = c->fanout - keep; } if (n < keep) { zi = znode; move = move + 1; keep = keep + -1; } else { zi = zn; n = n - keep; if (zn->level != 0) { (zbr->ldv_26076.znode)->parent = zn; } else { } } do_split: __set_bit(0, (unsigned long volatile *)(& zn->flags)); atomic_long_inc(& c->dirty_zn_cnt); zn->child_cnt = move; znode->child_cnt = keep; descriptor___1.modname = "ubifs"; descriptor___1.function = "tnc_insert"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___1.format = "UBIFS DBG tnc (pid %d): moving %d, keeping %d\n"; descriptor___1.lineno = 2203U; descriptor___1.flags = 0U; tmp___22 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___22 != 0L) { tmp___21 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG tnc (pid %d): moving %d, keeping %d\n", tmp___21->pid, move, keep); } else { } i = 0; goto ldv_28084; ldv_28083: zn->zbranch[i] = znode->zbranch[keep + i]; if (zn->level != 0) { if ((unsigned long )zn->zbranch[i].ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { (zn->zbranch[i].ldv_26076.znode)->parent = zn; (zn->zbranch[i].ldv_26076.znode)->iip = i; } else { } } else { } i = i + 1; ldv_28084: ; if (i < move) { goto ldv_28083; } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "tnc_insert"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___2.format = "UBIFS DBG tnc (pid %d): inserting at %d level %d, key %s\n"; descriptor___2.lineno = 2217U; descriptor___2.flags = 0U; tmp___25 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___25 != 0L) { tmp___23 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf___1), 48); tmp___24 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG tnc (pid %d): inserting at %d level %d, key %s\n", tmp___24->pid, n, zn->level, tmp___23); } else { } insert_zbranch(zi, (struct ubifs_zbranch const *)zbr, n); if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { if ((n == 0 && (unsigned long )zi == (unsigned long )znode) && znode->iip == 0) { correct_parent_keys((struct ubifs_info const *)c, znode); } else { } n = znode->iip + 1; zbr->key = zn->zbranch[0].key; zbr->ldv_26076.znode = zn; zbr->lnum = 0; zbr->offs = 0; zbr->len = 0; znode = zp; goto again; } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "tnc_insert"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___3.format = "UBIFS DBG tnc (pid %d): creating new zroot at level %d\n"; descriptor___3.lineno = 2241U; descriptor___3.flags = 0U; tmp___27 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG tnc (pid %d): creating new zroot at level %d\n", tmp___26->pid, znode->level + 1); } else { } tmp___28 = kzalloc((size_t )c->max_znode_sz, 80U); zi = (struct ubifs_znode *)tmp___28; if ((unsigned long )zi == (unsigned long )((struct ubifs_znode *)0)) { return (-12); } else { } zi->child_cnt = 2; zi->level = znode->level + 1; __set_bit(0, (unsigned long volatile *)(& zi->flags)); atomic_long_inc(& c->dirty_zn_cnt); zi->zbranch[0].key = znode->zbranch[0].key; zi->zbranch[0].ldv_26076.znode = znode; zi->zbranch[0].lnum = c->zroot.lnum; zi->zbranch[0].offs = c->zroot.offs; zi->zbranch[0].len = c->zroot.len; zi->zbranch[1].key = zn->zbranch[0].key; zi->zbranch[1].ldv_26076.znode = zn; c->zroot.lnum = 0; c->zroot.offs = 0; c->zroot.len = 0; c->zroot.ldv_26076.znode = zi; zn->parent = zi; zn->iip = 1; znode->parent = zi; znode->iip = 0; return (0); } } int ubifs_tnc_add(struct ubifs_info *c , union ubifs_key const *key , int lnum , int offs , int len ) { int found ; int n ; int err ; struct ubifs_znode *znode ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct ubifs_zbranch zbr ; struct ubifs_zbranch *zbr___0 ; { err = 0; ldv_mutex_lock_300(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_add"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): %d:%d, len %d, key %s\n"; descriptor.lineno = 2293U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): %d:%d, len %d, key %s\n", tmp___0->pid, lnum, offs, len, tmp); } else { } found = lookup_level0_dirty(c, key, & znode, & n); if (found == 0) { zbr.ldv_26076.znode = 0; zbr.lnum = lnum; zbr.offs = offs; zbr.len = len; key_copy((struct ubifs_info const *)c, key, & zbr.key); err = tnc_insert(c, znode, & zbr, n + 1); } else if (found == 1) { zbr___0 = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; lnc_free(zbr___0); err = ubifs_add_dirt(c, zbr___0->lnum, zbr___0->len); zbr___0->lnum = lnum; zbr___0->offs = offs; zbr___0->len = len; } else { err = found; } if (err == 0) { err = dbg_check_tnc(c, 0); } else { } ldv_mutex_unlock_301(& c->tnc_mutex); return (err); } } int ubifs_tnc_replace(struct ubifs_info *c , union ubifs_key const *key , int old_lnum , int old_offs , int lnum , int offs , int len ) { int found ; int n ; int err ; struct ubifs_znode *znode ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct ubifs_zbranch *zbr ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; int tmp___6 ; int tmp___7 ; { err = 0; ldv_mutex_lock_302(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_replace"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): old LEB %d:%d, new LEB %d:%d, len %d, key %s\n"; descriptor.lineno = 2343U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): old LEB %d:%d, new LEB %d:%d, len %d, key %s\n", tmp___0->pid, old_lnum, old_offs, lnum, offs, len, tmp); } else { } found = lookup_level0_dirty(c, key, & znode, & n); if (found < 0) { err = found; goto out_unlock; } else { } if (found == 1) { zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; found = 0; if (zbr->lnum == old_lnum && zbr->offs == old_offs) { lnc_free(zbr); err = ubifs_add_dirt(c, zbr->lnum, zbr->len); if (err != 0) { goto out_unlock; } else { } zbr->lnum = lnum; zbr->offs = offs; zbr->len = len; found = 1; } else { tmp___7 = is_hash_key((struct ubifs_info const *)c, key); if (tmp___7 != 0) { found = resolve_collision_directly(c, key, & znode, & n, old_lnum, old_offs); descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_replace"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d, LEB %d:%d\n"; descriptor___0.lineno = 2367U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d, LEB %d:%d\n", tmp___2->pid, found, znode, n, old_lnum, old_offs); } else { } if (found < 0) { err = found; goto out_unlock; } else { } if (found != 0) { if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { goto _L; } else { tmp___6 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___6 == 0) { _L: /* CIL Label */ znode = dirty_cow_bottom_up(c, znode); tmp___5 = IS_ERR((void const *)znode); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)znode); err = (int )tmp___4; goto out_unlock; } else { } } else { } } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; lnc_free(zbr); err = ubifs_add_dirt(c, zbr->lnum, zbr->len); if (err != 0) { goto out_unlock; } else { } zbr->lnum = lnum; zbr->offs = offs; zbr->len = len; } else { } } else { } } } else { } if (found == 0) { err = ubifs_add_dirt(c, lnum, len); } else { } if (err == 0) { err = dbg_check_tnc(c, 0); } else { } out_unlock: ldv_mutex_unlock_303(& c->tnc_mutex); return (err); } } int ubifs_tnc_add_nm(struct ubifs_info *c , union ubifs_key const *key , int lnum , int offs , int len , struct qstr const *nm ) { int found ; int n ; int err ; struct ubifs_znode *znode ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; int tmp___6 ; struct ubifs_zbranch *zbr ; struct ubifs_zbranch zbr___0 ; struct qstr noname ; int tmp___7 ; { err = 0; ldv_mutex_lock_304(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_add_nm"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): LEB %d:%d, name \'%.*s\', key %s\n"; descriptor.lineno = 2426U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): LEB %d:%d, name \'%.*s\', key %s\n", tmp___0->pid, lnum, offs, nm->ldv_7607.ldv_7605.len, nm->name, tmp); } else { } found = lookup_level0_dirty(c, key, & znode, & n); if (found < 0) { err = found; goto out_unlock; } else { } if (found == 1) { if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { found = fallible_resolve_collision(c, key, & znode, & n, nm, 1); } else { found = resolve_collision(c, key, & znode, & n, nm); } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_add_nm"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n"; descriptor___0.lineno = 2439U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n", tmp___2->pid, found, znode, n); } else { } if (found < 0) { err = found; goto out_unlock; } else { } if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { goto _L; } else { tmp___6 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___6 == 0) { _L: /* CIL Label */ znode = dirty_cow_bottom_up(c, znode); tmp___5 = IS_ERR((void const *)znode); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)znode); err = (int )tmp___4; goto out_unlock; } else { } } else { } } if (found == 1) { zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; lnc_free(zbr); err = ubifs_add_dirt(c, zbr->lnum, zbr->len); zbr->lnum = lnum; zbr->offs = offs; zbr->len = len; goto out_unlock; } else { } } else { } if (found == 0) { zbr___0.ldv_26076.znode = 0; zbr___0.lnum = lnum; zbr___0.offs = offs; zbr___0.len = len; key_copy((struct ubifs_info const *)c, key, & zbr___0.key); err = tnc_insert(c, znode, & zbr___0, n + 1); if (err != 0) { goto out_unlock; } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { noname.ldv_7607.ldv_7605.hash = 0U; noname.ldv_7607.ldv_7605.len = 0U; noname.name = (unsigned char const *)""; err = dbg_check_tnc(c, 0); ldv_mutex_unlock_305(& c->tnc_mutex); if (err != 0) { return (err); } else { } tmp___7 = ubifs_tnc_remove_nm(c, key, (struct qstr const *)(& noname)); return (tmp___7); } else { } } else { } out_unlock: ; if (err == 0) { err = dbg_check_tnc(c, 0); } else { } ldv_mutex_unlock_306(& c->tnc_mutex); return (err); } } static int tnc_delete(struct ubifs_info *c , struct ubifs_znode *znode , int n ) { struct ubifs_zbranch *zbr ; struct ubifs_znode *zp ; int i ; int err ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; int tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; int tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; long tmp___15 ; long tmp___16 ; long tmp___17 ; long tmp___18 ; struct task_struct *tmp___19 ; int tmp___20 ; long tmp___21 ; struct task_struct *tmp___22 ; int tmp___23 ; long tmp___24 ; { tmp___0 = ldv__builtin_expect(znode->level != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2517, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(n < 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2518, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(c->fanout <= n, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2518, tmp___1->pid); dump_stack(); } else { } } descriptor.modname = "ubifs"; descriptor.function = "tnc_delete"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): deleting key %s\n"; descriptor.lineno = 2519U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[n].key), (char *)(& __tmp_key_buf), 48); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): deleting key %s\n", tmp___5->pid, tmp___4); } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; lnc_free(zbr); err = ubifs_add_dirt(c, zbr->lnum, zbr->len); if (err != 0) { ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); return (err); } else { } i = n; goto ldv_28157; ldv_28156: znode->zbranch[i] = znode->zbranch[i + 1]; i = i + 1; ldv_28157: ; if (znode->child_cnt + -1 > i) { goto ldv_28156; } else { } znode->child_cnt = znode->child_cnt + -1; if (znode->child_cnt > 0) { return (0); } else { } ldv_28159: tmp___8 = ubifs_zn_obsolete((struct ubifs_znode const *)znode); tmp___9 = ldv__builtin_expect(tmp___8 != 0, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2544, tmp___7->pid); dump_stack(); } else { } tmp___11 = ubifs_zn_dirty((struct ubifs_znode const *)znode); tmp___12 = ldv__builtin_expect(tmp___11 == 0, 0L); if (tmp___12 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2545, tmp___10->pid); dump_stack(); } else { } zp = znode->parent; n = znode->iip; atomic_long_dec(& c->dirty_zn_cnt); err = insert_old_idx_znode(c, znode); if (err != 0) { return (err); } else { } if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { __set_bit(2, (unsigned long volatile *)(& znode->flags)); atomic_long_inc(& c->clean_zn_cnt); atomic_long_inc(& ubifs_clean_zn_cnt); } else { kfree((void const *)znode); } znode = zp; if (znode->child_cnt == 1) { goto ldv_28159; } else { } znode->child_cnt = znode->child_cnt + -1; tmp___14 = ldv__builtin_expect(znode->level == 0, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2567, tmp___13->pid); dump_stack(); } else { } i = n; goto ldv_28162; ldv_28161: znode->zbranch[i] = znode->zbranch[i + 1]; if ((unsigned long )znode->zbranch[i].ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { (znode->zbranch[i].ldv_26076.znode)->iip = i; } else { } i = i + 1; ldv_28162: ; if (znode->child_cnt > i) { goto ldv_28161; } else { } if ((unsigned long )znode->parent == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_28165; ldv_28164: zp = znode; zbr = (struct ubifs_zbranch *)(& znode->zbranch); znode = get_znode(c, znode, 0); tmp___16 = IS_ERR((void const *)znode); if (tmp___16 != 0L) { tmp___15 = PTR_ERR((void const *)znode); return ((int )tmp___15); } else { } znode = dirty_cow_znode(c, zbr); tmp___18 = IS_ERR((void const *)znode); if (tmp___18 != 0L) { tmp___17 = PTR_ERR((void const *)znode); return ((int )tmp___17); } else { } znode->parent = 0; znode->iip = 0; if (c->zroot.len != 0) { err = insert_old_idx(c, c->zroot.lnum, c->zroot.offs); if (err != 0) { return (err); } else { } } else { } c->zroot.lnum = zbr->lnum; c->zroot.offs = zbr->offs; c->zroot.len = zbr->len; c->zroot.ldv_26076.znode = znode; tmp___20 = ubifs_zn_obsolete((struct ubifs_znode const *)zp); tmp___21 = ldv__builtin_expect(tmp___20 != 0, 0L); if (tmp___21 != 0L) { tmp___19 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2600, tmp___19->pid); dump_stack(); } else { } tmp___23 = ubifs_zn_dirty((struct ubifs_znode const *)zp); tmp___24 = ldv__builtin_expect(tmp___23 == 0, 0L); if (tmp___24 != 0L) { tmp___22 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_delete", 2601, tmp___22->pid); dump_stack(); } else { } atomic_long_dec(& c->dirty_zn_cnt); if ((unsigned long )zp->cnext != (unsigned long )((struct ubifs_znode *)0)) { __set_bit(2, (unsigned long volatile *)(& zp->flags)); atomic_long_inc(& c->clean_zn_cnt); atomic_long_inc(& ubifs_clean_zn_cnt); } else { kfree((void const *)zp); } ldv_28165: ; if (znode->child_cnt == 1 && znode->level != 0) { goto ldv_28164; } else { } } else { } return (0); } } int ubifs_tnc_remove(struct ubifs_info *c , union ubifs_key const *key ) { int found ; int n ; int err ; struct ubifs_znode *znode ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; { err = 0; ldv_mutex_lock_307(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_remove"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): key %s\n"; descriptor.lineno = 2629U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): key %s\n", tmp___0->pid, tmp); } else { } found = lookup_level0_dirty(c, key, & znode, & n); if (found < 0) { err = found; goto out_unlock; } else { } if (found == 1) { err = tnc_delete(c, znode, n); } else { } if (err == 0) { err = dbg_check_tnc(c, 0); } else { } out_unlock: ldv_mutex_unlock_308(& c->tnc_mutex); return (err); } } int ubifs_tnc_remove_nm(struct ubifs_info *c , union ubifs_key const *key , struct qstr const *nm ) { int n ; int err ; struct ubifs_znode *znode ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; int tmp___6 ; { ldv_mutex_lock_309(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_remove_nm"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): %.*s, key %s\n"; descriptor.lineno = 2660U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): %.*s, key %s\n", tmp___0->pid, nm->ldv_7607.ldv_7605.len, nm->name, tmp); } else { } err = lookup_level0_dirty(c, key, & znode, & n); if (err < 0) { goto out_unlock; } else { } if (err != 0) { if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { err = fallible_resolve_collision(c, key, & znode, & n, nm, 0); } else { err = resolve_collision(c, key, & znode, & n, nm); } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_remove_nm"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n"; descriptor___0.lineno = 2671U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n", tmp___2->pid, err, znode, n); } else { } if (err < 0) { goto out_unlock; } else { } if (err != 0) { if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { goto _L; } else { tmp___6 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___6 == 0) { _L: /* CIL Label */ znode = dirty_cow_bottom_up(c, znode); tmp___5 = IS_ERR((void const *)znode); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)znode); err = (int )tmp___4; goto out_unlock; } else { } } else { } } err = tnc_delete(c, znode, n); } else { } } else { } out_unlock: ; if (err == 0) { err = dbg_check_tnc(c, 0); } else { } ldv_mutex_unlock_310(& c->tnc_mutex); return (err); } } static int key_in_range(struct ubifs_info *c , union ubifs_key *key , union ubifs_key *from_key , union ubifs_key *to_key ) { int tmp ; int tmp___0 ; { tmp = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)key, (union ubifs_key const *)from_key); if (tmp < 0) { return (0); } else { } tmp___0 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)key, (union ubifs_key const *)to_key); if (tmp___0 > 0) { return (0); } else { } return (1); } } int ubifs_tnc_remove_range(struct ubifs_info *c , union ubifs_key *from_key , union ubifs_key *to_key ) { int i ; int n ; int k ; int err ; struct ubifs_znode *znode ; union ubifs_key *key ; int tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; { err = 0; ldv_mutex_lock_311(& c->tnc_mutex); ldv_28219: err = ubifs_lookup_level0(c, (union ubifs_key const *)from_key, & znode, & n); if (err < 0) { goto out_unlock; } else { } if (err != 0) { key = from_key; } else { err = tnc_next(c, & znode, & n); if (err == -2) { err = 0; goto out_unlock; } else { } if (err < 0) { goto out_unlock; } else { } key = & znode->zbranch[n].key; tmp = key_in_range(c, key, from_key, to_key); if (tmp == 0) { err = 0; goto out_unlock; } else { } } if ((unsigned long )znode->cnext != (unsigned long )((struct ubifs_znode *)0)) { goto _L; } else { tmp___2 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___2 == 0) { _L: /* CIL Label */ znode = dirty_cow_bottom_up(c, znode); tmp___1 = IS_ERR((void const *)znode); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)znode); err = (int )tmp___0; goto out_unlock; } else { } } else { } } i = n + 1; k = 0; goto ldv_28215; ldv_28214: key = & znode->zbranch[i].key; tmp___3 = key_in_range(c, key, from_key, to_key); if (tmp___3 == 0) { goto ldv_28210; } else { } lnc_free((struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )i); err = ubifs_add_dirt(c, znode->zbranch[i].lnum, znode->zbranch[i].len); if (err != 0) { ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); goto out_unlock; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_remove_range"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): removing key %s\n"; descriptor.lineno = 2775U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf), 48); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): removing key %s\n", tmp___5->pid, tmp___4); } else { } i = i + 1; k = k + 1; ldv_28215: ; if (znode->child_cnt > i) { goto ldv_28214; } else { } ldv_28210: ; if (k != 0) { i = (n + 1) + k; goto ldv_28217; ldv_28216: znode->zbranch[i - k] = znode->zbranch[i]; i = i + 1; ldv_28217: ; if (znode->child_cnt > i) { goto ldv_28216; } else { } znode->child_cnt = znode->child_cnt - k; } else { } err = tnc_delete(c, znode, n); if (err != 0) { goto out_unlock; } else { } goto ldv_28219; out_unlock: ; if (err == 0) { err = dbg_check_tnc(c, 0); } else { } ldv_mutex_unlock_312(& c->tnc_mutex); return (err); } } int ubifs_tnc_remove_ino(struct ubifs_info *c , ino_t inum ) { union ubifs_key key1 ; union ubifs_key key2 ; struct ubifs_dent_node *xent ; struct ubifs_dent_node *pxent ; struct qstr nm ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; ino_t xattr_inum ; int err ; long tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; { pxent = 0; nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = 0U; nm.name = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_remove_ino"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): ino %lu\n"; descriptor.lineno = 2811U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): ino %lu\n", tmp->pid, inum); } else { } lowest_xent_key((struct ubifs_info const *)c, & key1, inum); ldv_28235: xent = ubifs_tnc_next_ent(c, & key1, (struct qstr const *)(& nm)); tmp___2 = IS_ERR((void const *)xent); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)xent); err = (int )tmp___1; if (err == -2) { goto ldv_28233; } else { } return (err); } else { } xattr_inum = (ino_t )xent->inum; descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_remove_ino"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): xent \'%s\', ino %lu\n"; descriptor___0.lineno = 2832U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): xent \'%s\', ino %lu\n", tmp___3->pid, (__u8 *)(& xent->name), xattr_inum); } else { } nm.name = (unsigned char const *)(& xent->name); nm.ldv_7607.ldv_7605.len = (u32 )xent->nlen; err = ubifs_tnc_remove_nm(c, (union ubifs_key const *)(& key1), (struct qstr const *)(& nm)); if (err != 0) { kfree((void const *)xent); return (err); } else { } ino_key_init((struct ubifs_info const *)c, & key1, xattr_inum); highest_ino_key((struct ubifs_info const *)c, & key2, xattr_inum); err = ubifs_tnc_remove_range(c, & key1, & key2); if (err != 0) { kfree((void const *)xent); return (err); } else { } kfree((void const *)pxent); pxent = xent; key_read((struct ubifs_info const *)c, (void const *)(& xent->key), & key1); goto ldv_28235; ldv_28233: kfree((void const *)pxent); ino_key_init((struct ubifs_info const *)c, & key1, inum); highest_ino_key((struct ubifs_info const *)c, & key2, inum); tmp___5 = ubifs_tnc_remove_range(c, & key1, & key2); return (tmp___5); } } struct ubifs_dent_node *ubifs_tnc_next_ent(struct ubifs_info *c , union ubifs_key *key , struct qstr const *nm ) { int n ; int err ; int type ; int tmp ; struct ubifs_znode *znode ; struct ubifs_dent_node *dent ; struct ubifs_zbranch *zbr ; union ubifs_key *dkey ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; long tmp___10 ; void *tmp___11 ; long tmp___12 ; ino_t tmp___13 ; ino_t tmp___14 ; int tmp___15 ; long tmp___16 ; void *tmp___17 ; { tmp = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key); type = tmp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_next_ent"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): %s %s\n"; descriptor.lineno = 2895U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf), 48); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): %s %s\n", tmp___1->pid, (unsigned long )nm->name != (unsigned long )((unsigned char const */* const */)0) ? (char *)nm->name : (char *)"(lowest)", tmp___0); } else { } tmp___4 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)key); tmp___5 = ldv__builtin_expect(tmp___4 == 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_next_ent", 2896, tmp___3->pid); dump_stack(); } else { } ldv_mutex_lock_313(& c->tnc_mutex); err = ubifs_lookup_level0(c, (union ubifs_key const *)key, & znode, & n); tmp___6 = ldv__builtin_expect(err < 0, 0L); if (tmp___6 != 0L) { goto out_unlock; } else { } if ((unsigned long )nm->name != (unsigned long )((unsigned char const */* const */)0)) { if (err != 0) { err = resolve_collision(c, (union ubifs_key const *)key, & znode, & n, nm); descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_next_ent"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n"; descriptor___0.lineno = 2908U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): rc returned %d, znode %p, n %d\n", tmp___7->pid, err, znode, n); } else { } tmp___9 = ldv__builtin_expect(err < 0, 0L); if (tmp___9 != 0L) { goto out_unlock; } else { } } else { } err = tnc_next(c, & znode, & n); tmp___10 = ldv__builtin_expect(err != 0, 0L); if (tmp___10 != 0L) { goto out_unlock; } else { } } else if (err == 0) { err = tnc_next(c, & znode, & n); if (err != 0) { goto out_unlock; } else { } } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; tmp___11 = kmalloc((size_t )zbr->len, 80U); dent = (struct ubifs_dent_node *)tmp___11; tmp___12 = ldv__builtin_expect((unsigned long )dent == (unsigned long )((struct ubifs_dent_node *)0), 0L); if (tmp___12 != 0L) { err = -12; goto out_unlock; } else { } dkey = & zbr->key; tmp___13 = key_inum((struct ubifs_info const *)c, (void const *)dkey); tmp___14 = key_inum((struct ubifs_info const *)c, (void const *)key); if (tmp___13 != tmp___14) { err = -2; goto out_free; } else { tmp___15 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)dkey); if (tmp___15 != type) { err = -2; goto out_free; } else { } } err = tnc_read_node_nm(c, zbr, (void *)dent); tmp___16 = ldv__builtin_expect(err != 0, 0L); if (tmp___16 != 0L) { goto out_free; } else { } ldv_mutex_unlock_314(& c->tnc_mutex); return (dent); out_free: kfree((void const *)dent); out_unlock: ldv_mutex_unlock_315(& c->tnc_mutex); tmp___17 = ERR_PTR((long )err); return ((struct ubifs_dent_node *)tmp___17); } } static void tnc_destroy_cnext(struct ubifs_info *c ) { struct ubifs_znode *cnext ; struct task_struct *tmp ; long tmp___0 ; struct ubifs_znode *znode ; int tmp___1 ; { if ((unsigned long )c->cnext == (unsigned long )((struct ubifs_znode *)0)) { return; } else { } tmp___0 = ldv__builtin_expect(c->cmt_state != 5, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "tnc_destroy_cnext", 2979, tmp->pid); dump_stack(); } else { } cnext = c->cnext; ldv_28260: znode = cnext; cnext = cnext->cnext; tmp___1 = ubifs_zn_obsolete((struct ubifs_znode const *)znode); if (tmp___1 != 0) { kfree((void const *)znode); } else { } if ((unsigned long )cnext != (unsigned long )((struct ubifs_znode *)0) && (unsigned long )c->cnext != (unsigned long )cnext) { goto ldv_28260; } else { } return; } } void ubifs_tnc_close(struct ubifs_info *c ) { long n ; { tnc_destroy_cnext(c); if ((unsigned long )c->zroot.ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { ubifs_destroy_tnc_subtree(c->zroot.ldv_26076.znode); n = atomic_long_read(& c->clean_zn_cnt); atomic_long_sub(n, & ubifs_clean_zn_cnt); } else { } kfree((void const *)c->gap_lebs); kfree((void const *)c->ilebs); destroy_old_idx(c); return; } } static struct ubifs_znode *left_znode(struct ubifs_info *c , struct ubifs_znode *znode ) { int level ; int n ; long tmp ; long tmp___0 ; { level = znode->level; ldv_28276: n = znode->iip + -1; znode = znode->parent; if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } if (n >= 0) { znode = get_znode(c, znode, n); tmp = IS_ERR((void const *)znode); if (tmp != 0L) { return (znode); } else { } goto ldv_28273; ldv_28272: n = znode->child_cnt + -1; znode = get_znode(c, znode, n); tmp___0 = IS_ERR((void const *)znode); if (tmp___0 != 0L) { return (znode); } else { } ldv_28273: ; if (znode->level != level) { goto ldv_28272; } else { } goto ldv_28275; } else { } goto ldv_28276; ldv_28275: ; return (znode); } } static struct ubifs_znode *right_znode(struct ubifs_info *c , struct ubifs_znode *znode ) { int level ; int n ; long tmp ; long tmp___0 ; { level = znode->level; ldv_28287: n = znode->iip + 1; znode = znode->parent; if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } if (znode->child_cnt > n) { znode = get_znode(c, znode, n); tmp = IS_ERR((void const *)znode); if (tmp != 0L) { return (znode); } else { } goto ldv_28284; ldv_28283: znode = get_znode(c, znode, 0); tmp___0 = IS_ERR((void const *)znode); if (tmp___0 != 0L) { return (znode); } else { } ldv_28284: ; if (znode->level != level) { goto ldv_28283; } else { } goto ldv_28286; } else { } goto ldv_28287; ldv_28286: ; return (znode); } } static struct ubifs_znode *lookup_znode(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs ) { struct ubifs_znode *znode ; struct ubifs_znode *zn ; int n ; int nn ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; void *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; long tmp___7 ; struct ubifs_znode *tmp___8 ; int tmp___9 ; long tmp___10 ; struct ubifs_znode *tmp___11 ; int tmp___12 ; long tmp___13 ; struct ubifs_znode *tmp___14 ; int tmp___15 ; { tmp___0 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key); tmp___1 = ldv__builtin_expect(tmp___0 > 3, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lookup_znode", 3114, tmp->pid); dump_stack(); } else { } if (level < 0) { tmp___2 = ERR_PTR(-22L); return ((struct ubifs_znode *)tmp___2); } else { } znode = c->zroot.ldv_26076.znode; if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { znode = ubifs_load_znode(c, & c->zroot, 0, 0); tmp___3 = IS_ERR((void const *)znode); if (tmp___3 != 0L) { return (znode); } else { } } else { } if (c->zroot.lnum == lnum && c->zroot.offs == offs) { return (znode); } else { } if (znode->level <= level) { return (0); } else { } ldv_28301: ubifs_search_zbranch((struct ubifs_info const *)c, (struct ubifs_znode const *)znode, (union ubifs_key const *)key, & n); if (n < 0) { znode = left_znode(c, znode); if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } tmp___4 = IS_ERR((void const *)znode); if (tmp___4 != 0L) { return (znode); } else { } ubifs_search_zbranch((struct ubifs_info const *)c, (struct ubifs_znode const *)znode, (union ubifs_key const *)key, & n); tmp___6 = ldv__builtin_expect(n < 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lookup_znode", 3153, tmp___5->pid); dump_stack(); } else { } } else { } if (znode->level == level + 1) { goto ldv_28300; } else { } znode = get_znode(c, znode, n); tmp___7 = IS_ERR((void const *)znode); if (tmp___7 != 0L) { return (znode); } else { } goto ldv_28301; ldv_28300: ; if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) { tmp___8 = get_znode(c, znode, n); return (tmp___8); } else { } tmp___9 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)key); if (tmp___9 == 0) { return (0); } else { } zn = znode; nn = n; ldv_28303: ; if (n != 0) { n = n + -1; } else { znode = left_znode(c, znode); if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_28302; } else { } tmp___10 = IS_ERR((void const *)znode); if (tmp___10 != 0L) { return (znode); } else { } n = znode->child_cnt + -1; } if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) { tmp___11 = get_znode(c, znode, n); return (tmp___11); } else { } tmp___12 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[n].key), (union ubifs_key const *)key); if (tmp___12 < 0) { goto ldv_28302; } else { } goto ldv_28303; ldv_28302: znode = zn; n = nn; ldv_28305: n = n + 1; if (n >= znode->child_cnt) { znode = right_znode(c, znode); if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_28304; } else { } tmp___13 = IS_ERR((void const *)znode); if (tmp___13 != 0L) { return (znode); } else { } n = 0; } else { } if (znode->zbranch[n].lnum == lnum && znode->zbranch[n].offs == offs) { tmp___14 = get_znode(c, znode, n); return (tmp___14); } else { } tmp___15 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[n].key), (union ubifs_key const *)key); if (tmp___15 > 0) { goto ldv_28304; } else { } goto ldv_28305; ldv_28304: ; return (0); } } int is_idx_node_in_tnc(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs ) { struct ubifs_znode *znode ; long tmp ; long tmp___0 ; int tmp___1 ; { znode = lookup_znode(c, key, level, lnum, offs); if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } tmp___0 = IS_ERR((void const *)znode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)znode); return ((int )tmp); } else { } tmp___1 = ubifs_zn_dirty((struct ubifs_znode const *)znode); return (tmp___1 != 0 ? 1 : 2); } } static int is_leaf_node_in_tnc(struct ubifs_info *c , union ubifs_key *key , int lnum , int offs ) { struct ubifs_zbranch *zbr ; struct ubifs_znode *znode ; struct ubifs_znode *zn ; int n ; int found ; int err ; int nn ; int unique ; int tmp ; int tmp___0 ; int tmp___1 ; { tmp = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)key); unique = tmp == 0; found = ubifs_lookup_level0(c, (union ubifs_key const *)key, & znode, & n); if (found < 0) { return (found); } else { } if (found == 0) { return (0); } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if (zbr->lnum == lnum && zbr->offs == offs) { return (1); } else { } if (unique != 0) { return (0); } else { } zn = znode; nn = n; ldv_28329: err = tnc_prev(c, & znode, & n); if (err == -2) { goto ldv_28328; } else { } if (err != 0) { return (err); } else { } tmp___0 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)key, (union ubifs_key const *)(& znode->zbranch[n].key)); if (tmp___0 != 0) { goto ldv_28328; } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if (zbr->lnum == lnum && zbr->offs == offs) { return (1); } else { } goto ldv_28329; ldv_28328: znode = zn; n = nn; ldv_28331: err = tnc_next(c, & znode, & n); if (err != 0) { if (err == -2) { return (0); } else { } return (err); } else { } tmp___1 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)key, (union ubifs_key const *)(& znode->zbranch[n].key)); if (tmp___1 != 0) { goto ldv_28330; } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if (zbr->lnum == lnum && zbr->offs == offs) { return (1); } else { } goto ldv_28331; ldv_28330: ; return (0); } } int ubifs_tnc_has_node(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs , int is_idx ) { int err ; long tmp ; { ldv_mutex_lock_316(& c->tnc_mutex); if (is_idx != 0) { err = is_idx_node_in_tnc(c, key, level, lnum, offs); if (err < 0) { goto out_unlock; } else { } if (err == 1) { err = 0; } else if (err == 2) { err = 1; } else { tmp = ldv__builtin_expect(err != 0, 0L); if (tmp != 0L) { __asm__ volatile ("1:\tud2\n.pushsection __bug_table,\"a\"\n2:\t.long 1b - 2b, %c0 - 2b\n\t.word %c1, 0\n\t.org 2b+%c2\n.popsection": : "i" ((char *)"/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc.c.prepared"), "i" (3350), "i" (12UL)); ldv_28342: ; goto ldv_28342; } else { } } } else { err = is_leaf_node_in_tnc(c, key, lnum, offs); } out_unlock: ldv_mutex_unlock_317(& c->tnc_mutex); return (err); } } int ubifs_dirty_idx_node(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs ) { struct ubifs_znode *znode ; int err ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { err = 0; ldv_mutex_lock_318(& c->tnc_mutex); znode = lookup_znode(c, key, level, lnum, offs); if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { goto out_unlock; } else { } tmp___0 = IS_ERR((void const *)znode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)znode); err = (int )tmp; goto out_unlock; } else { } znode = dirty_cow_bottom_up(c, znode); tmp___2 = IS_ERR((void const *)znode); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)znode); err = (int )tmp___1; goto out_unlock; } else { } out_unlock: ldv_mutex_unlock_319(& c->tnc_mutex); return (err); } } int dbg_check_inode_size(struct ubifs_info *c , struct inode const *inode , loff_t size ) { int err ; int n ; union ubifs_key from_key ; union ubifs_key to_key ; union ubifs_key *key ; struct ubifs_znode *znode ; unsigned int block ; int tmp ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; struct task_struct *tmp___3 ; { if (((int )inode->i_mode & 61440) != 32768) { return (0); } else { } tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } block = (unsigned int )((size + 4095LL) >> 12); data_key_init((struct ubifs_info const *)c, & from_key, inode->i_ino, block); highest_data_key((struct ubifs_info const *)c, & to_key, inode->i_ino); ldv_mutex_lock_320(& c->tnc_mutex); err = ubifs_lookup_level0(c, (union ubifs_key const *)(& from_key), & znode, & n); if (err < 0) { goto out_unlock; } else { } if (err != 0) { err = -22; key = & from_key; goto out_dump; } else { } err = tnc_next(c, & znode, & n); if (err == -2) { err = 0; goto out_unlock; } else { } if (err < 0) { goto out_unlock; } else { } tmp___1 = ldv__builtin_expect(err != 0, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dbg_check_inode_size", 3445, tmp___0->pid); dump_stack(); } else { } key = & znode->zbranch[n].key; tmp___2 = key_in_range(c, key, & from_key, & to_key); if (tmp___2 == 0) { goto out_unlock; } else { } out_dump: block = key_block((struct ubifs_info const *)c, (union ubifs_key const *)key); tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu has size %lld, but there are data at offset %lld\n", tmp___3->pid, "dbg_check_inode_size", inode->i_ino, size, (long long )block << 12); ldv_mutex_unlock_321(& c->tnc_mutex); ubifs_dump_inode(c, inode); dump_stack(); return (-22); out_unlock: ldv_mutex_unlock_322(& c->tnc_mutex); return (err); } } void ldv_main7_sequence_infinite_withcheck_stateful(void) { int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_28387; ldv_28386: tmp = __VERIFIER_nondet_int(); switch (tmp) { default: ; goto ldv_28385; } ldv_28385: ; ldv_28387: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_28386; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_285(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_286(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_287(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_288(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_289(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_290(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_291(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_292(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_293(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_294(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_295(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_296(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_297(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_298(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_299(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_300(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_301(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_302(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_303(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_304(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_305(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_306(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_307(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_308(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_309(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_310(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_311(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_312(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_313(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_314(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_315(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_316(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_317(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_318(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_319(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_320(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_321(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_322(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_365(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_362(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_364(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_366(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_368(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_361(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_363(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_367(struct mutex *ldv_func_arg1 ) ; struct ubifs_scan_leb *ubifs_scan(struct ubifs_info const *c , int lnum , int offs , void *sbuf , int quiet ) ; void ubifs_scan_destroy(struct ubifs_scan_leb *sleb ) ; int ubifs_recover_master_node(struct ubifs_info *c ) ; int dbg_old_index_check_init(struct ubifs_info *c , struct ubifs_zbranch *zroot ) ; static int scan_for_master(struct ubifs_info *c ) { struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; int lnum ; int offs ; int nodes_cnt ; long tmp ; long tmp___0 ; struct list_head const *__mptr ; size_t __len ; void *__ret ; long tmp___1 ; long tmp___2 ; struct list_head const *__mptr___0 ; int tmp___3 ; struct task_struct *tmp___4 ; { offs = 0; lnum = 1; sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, c->sbuf, 1); tmp___0 = IS_ERR((void const *)sleb); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)sleb); return ((int )tmp); } else { } nodes_cnt = sleb->nodes_cnt; if (nodes_cnt > 0) { __mptr = (struct list_head const *)sleb->nodes.prev; snod = (struct ubifs_scan_node *)__mptr; if (snod->type != 7) { goto out_dump; } else { } __len = (size_t )snod->len; __ret = memcpy((void *)c->mst_node, (void const *)snod->node, __len); offs = snod->offs; } else { } ubifs_scan_destroy(sleb); lnum = lnum + 1; sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, c->sbuf, 1); tmp___2 = IS_ERR((void const *)sleb); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)sleb); return ((int )tmp___1); } else { } if (sleb->nodes_cnt != nodes_cnt) { goto out; } else { } if (sleb->nodes_cnt == 0) { goto out; } else { } __mptr___0 = (struct list_head const *)sleb->nodes.prev; snod = (struct ubifs_scan_node *)__mptr___0; if (snod->type != 7) { goto out_dump; } else { } if (snod->offs != offs) { goto out; } else { } tmp___3 = memcmp((void const *)c->mst_node + 24U, (void const *)snod->node + 24U, 488UL); if (tmp___3 != 0) { goto out; } else { } c->mst_offs = offs; ubifs_scan_destroy(sleb); return (0); out: ubifs_scan_destroy(sleb); return (-117); out_dump: tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected node type %d master LEB %d:%d\n", tmp___4->pid, "scan_for_master", snod->type, lnum, snod->offs); ubifs_scan_destroy(sleb); return (-22); } } static int validate_master(struct ubifs_info const *c ) { long long main_sz ; int err ; struct task_struct *tmp ; { if ((unsigned long long )c->max_sqnum > 0xfffffffffeffffffULL) { err = 1; goto out; } else { } if ((unsigned long long )c->cmt_no >= (unsigned long long )c->max_sqnum) { err = 2; goto out; } else { } if ((unsigned long )c->highest_inum > 4294967039UL) { err = 3; goto out; } else { } if (((((int )c->lhead_lnum <= 2 || (int )c->lhead_lnum >= (int )c->log_lebs + 3) || (int )c->lhead_offs < 0) || (int )c->lhead_offs >= (int )c->leb_size) || ((int )c->lhead_offs & ((int )c->min_io_size + -1)) != 0) { err = 4; goto out; } else { } if ((((int )c->zroot.lnum >= (int )c->leb_cnt || (int )c->zroot.lnum < (int )c->main_first) || (int )c->zroot.offs >= (int )c->leb_size) || ((int )c->zroot.offs & 7) != 0) { err = 5; goto out; } else { } if ((int )c->zroot.len < (int )c->ranges[9].ldv_26105.min_len || (int )c->zroot.len > (int )c->ranges[9].max_len) { err = 6; goto out; } else { } if ((int )c->gc_lnum >= (int )c->leb_cnt || (int )c->gc_lnum < (int )c->main_first) { err = 7; goto out; } else { } if ((((((int )c->ihead_lnum >= (int )c->leb_cnt || (int )c->ihead_lnum < (int )c->main_first) || (int )c->ihead_offs % (int )c->min_io_size != 0) || (int )c->ihead_offs < 0) || (int )c->ihead_offs > (int )c->leb_size) || ((int )c->ihead_offs & 7) != 0) { err = 8; goto out; } else { } main_sz = (long long )c->main_lebs * (long long )c->leb_size; if (((unsigned long long )c->bi.old_idx_sz & 7ULL) != 0ULL || (unsigned long long )c->bi.old_idx_sz >= (unsigned long long )main_sz) { err = 9; goto out; } else { } if ((((int )c->lpt_lnum < (int )c->lpt_first || (int )c->lpt_lnum > (int )c->lpt_last) || (int )c->lpt_offs < 0) || (int )c->lpt_offs + (int )c->nnode_sz > (int )c->leb_size) { err = 10; goto out; } else { } if (((((int )c->nhead_lnum < (int )c->lpt_first || (int )c->nhead_lnum > (int )c->lpt_last) || (int )c->nhead_offs < 0) || (int )c->nhead_offs % (int )c->min_io_size != 0) || (int )c->nhead_offs > (int )c->leb_size) { err = 11; goto out; } else { } if ((((int )c->ltab_lnum < (int )c->lpt_first || (int )c->ltab_lnum > (int )c->lpt_last) || (int )c->ltab_offs < 0) || (int )c->ltab_offs + (int )c->ltab_sz > (int )c->leb_size) { err = 12; goto out; } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U && ((((int )c->lsave_lnum < (int )c->lpt_first || (int )c->lsave_lnum > (int )c->lpt_last) || (int )c->lsave_offs < 0) || (int )c->lsave_offs + (int )c->lsave_sz > (int )c->leb_size)) { err = 13; goto out; } else { } if ((int )c->lscan_lnum < (int )c->main_first || (int )c->lscan_lnum >= (int )c->leb_cnt) { err = 14; goto out; } else { } if ((int )c->lst.empty_lebs < 0 || (int )c->lst.empty_lebs > (int )c->main_lebs + -2) { err = 15; goto out; } else { } if ((int )c->lst.idx_lebs < 0 || (int )c->lst.idx_lebs > (int )c->main_lebs + -1) { err = 16; goto out; } else { } if (((long long )c->lst.total_free < 0LL || (long long )c->lst.total_free > main_sz) || ((long long )c->lst.total_free & 7LL) != 0LL) { err = 17; goto out; } else { } if ((long long )c->lst.total_dirty < 0LL || ((long long )c->lst.total_dirty & 7LL) != 0LL) { err = 18; goto out; } else { } if ((long long )c->lst.total_used < 0LL || ((long long )c->lst.total_used & 7LL) != 0LL) { err = 19; goto out; } else { } if (((long long )c->lst.total_free + (long long )c->lst.total_dirty) + (long long )c->lst.total_used > main_sz) { err = 20; goto out; } else { } if ((unsigned long long )(((long long )c->lst.total_dead + (long long )c->lst.total_dark) + (long long )c->lst.total_used) + (unsigned long long )c->bi.old_idx_sz > (unsigned long long )main_sz) { err = 21; goto out; } else { } if (((long long )c->lst.total_dead < 0LL || (long long )c->lst.total_dead > (long long )c->lst.total_free + (long long )c->lst.total_dirty) || ((long long )c->lst.total_dead & 7LL) != 0LL) { err = 22; goto out; } else { } if (((long long )c->lst.total_dark < 0LL || (long long )c->lst.total_dark > (long long )c->lst.total_free + (long long )c->lst.total_dirty) || ((long long )c->lst.total_dark & 7LL) != 0LL) { err = 23; goto out; } else { } return (0); out: tmp = get_current(); printk("\vUBIFS error (pid %d): %s: bad master node at offset %d error %d\n", tmp->pid, "validate_master", c->mst_offs, err); ubifs_dump_node(c, (void const *)c->mst_node); return (-22); } } int ubifs_read_master(struct ubifs_info *c ) { int err ; int old_leb_cnt ; void *tmp ; int growth ; struct task_struct *tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { tmp = kzalloc((size_t )c->mst_node_alsz, 208U); c->mst_node = (struct ubifs_mst_node *)tmp; if ((unsigned long )c->mst_node == (unsigned long )((struct ubifs_mst_node *)0)) { return (-12); } else { } err = scan_for_master(c); if (err != 0) { if (err == -117) { err = ubifs_recover_master_node(c); } else { } if (err != 0) { return (err); } else { } } else { } (c->mst_node)->flags = (c->mst_node)->flags & 4294967291U; c->max_sqnum = (c->mst_node)->ch.sqnum; c->highest_inum = (ino_t )(c->mst_node)->highest_inum; c->cmt_no = (c->mst_node)->cmt_no; c->zroot.lnum = (int )(c->mst_node)->root_lnum; c->zroot.offs = (int )(c->mst_node)->root_offs; c->zroot.len = (int )(c->mst_node)->root_len; c->lhead_lnum = (int )(c->mst_node)->log_lnum; c->gc_lnum = (int )(c->mst_node)->gc_lnum; c->ihead_lnum = (int )(c->mst_node)->ihead_lnum; c->ihead_offs = (int )(c->mst_node)->ihead_offs; c->bi.old_idx_sz = (c->mst_node)->index_size; c->lpt_lnum = (int )(c->mst_node)->lpt_lnum; c->lpt_offs = (int )(c->mst_node)->lpt_offs; c->nhead_lnum = (int )(c->mst_node)->nhead_lnum; c->nhead_offs = (int )(c->mst_node)->nhead_offs; c->ltab_lnum = (int )(c->mst_node)->ltab_lnum; c->ltab_offs = (int )(c->mst_node)->ltab_offs; c->lsave_lnum = (int )(c->mst_node)->lsave_lnum; c->lsave_offs = (int )(c->mst_node)->lsave_offs; c->lscan_lnum = (int )(c->mst_node)->lscan_lnum; c->lst.empty_lebs = (int )(c->mst_node)->empty_lebs; c->lst.idx_lebs = (int )(c->mst_node)->idx_lebs; old_leb_cnt = (int )(c->mst_node)->leb_cnt; c->lst.total_free = (long long )(c->mst_node)->total_free; c->lst.total_dirty = (long long )(c->mst_node)->total_dirty; c->lst.total_used = (long long )(c->mst_node)->total_used; c->lst.total_dead = (long long )(c->mst_node)->total_dead; c->lst.total_dark = (long long )(c->mst_node)->total_dark; c->calc_idx_sz = c->bi.old_idx_sz; if (((c->mst_node)->flags & 2U) != 0U) { c->no_orphs = 1; } else { } if (c->leb_cnt != old_leb_cnt) { growth = c->leb_cnt - old_leb_cnt; if (c->leb_cnt < old_leb_cnt || c->leb_cnt <= 16) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad leb_cnt on master node\n", tmp___0->pid, "ubifs_read_master"); ubifs_dump_node((struct ubifs_info const *)c, (void const *)c->mst_node); return (-22); } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_read_master"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/master.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): Auto resizing (master) from %d LEBs to %d LEBs\n"; descriptor.lineno = 444U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): Auto resizing (master) from %d LEBs to %d LEBs\n", tmp___1->pid, old_leb_cnt, c->leb_cnt); } else { } c->lst.empty_lebs = c->lst.empty_lebs + growth; c->lst.total_free = c->lst.total_free + (long long )growth * (long long )c->leb_size; c->lst.total_dark = c->lst.total_dark + (long long )growth * (long long )c->dark_wm; (c->mst_node)->leb_cnt = (unsigned int )c->leb_cnt; (c->mst_node)->empty_lebs = (unsigned int )c->lst.empty_lebs; (c->mst_node)->total_free = (unsigned long long )c->lst.total_free; (c->mst_node)->total_dark = (unsigned long long )c->lst.total_dark; } else { } err = validate_master((struct ubifs_info const *)c); if (err != 0) { return (err); } else { } err = dbg_old_index_check_init(c, & c->zroot); return (err); } } int ubifs_write_master(struct ubifs_info *c ) { int err ; int lnum ; int offs ; int len ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; { tmp___0 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_master", 483, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_write_master", 483, tmp->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { return (-30); } else { } lnum = 1; offs = c->mst_offs + c->mst_node_alsz; len = 512; if ((unsigned long )offs + 512UL > (unsigned long )c->leb_size) { err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } offs = 0; } else { } c->mst_offs = offs; (c->mst_node)->highest_inum = (unsigned long long )c->highest_inum; err = ubifs_write_node(c, (void *)c->mst_node, len, lnum, offs); if (err != 0) { return (err); } else { } lnum = lnum + 1; if (offs == 0) { err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } } else { } err = ubifs_write_node(c, (void *)c->mst_node, len, lnum, offs); return (err); } } void ldv_mutex_lock_361(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_362(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_363(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_364(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_365(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_366(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_367(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_368(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void print_hex_dump(char const * , char const * , int , int , int , void const * , size_t , bool ) ; void ldv_mutex_lock_nested_381(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_378(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_380(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_382(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_384(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_377(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_379(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_383(struct mutex *ldv_func_arg1 ) ; int ubifs_scan_a_node(struct ubifs_info const *c , void *buf , int len , int lnum , int offs , int quiet ) ; struct ubifs_scan_leb *ubifs_start_scan(struct ubifs_info const *c , int lnum , int offs , void *sbuf ) ; void ubifs_end_scan(struct ubifs_info const *c , struct ubifs_scan_leb *sleb , int lnum , int offs ) ; int ubifs_add_snod(struct ubifs_info const *c , struct ubifs_scan_leb *sleb , void *buf , int offs ) ; void ubifs_scanned_corruption(struct ubifs_info const *c , int lnum , int offs , void *buf ) ; __inline static void invalid_key_init(struct ubifs_info const *c , union ubifs_key *key ) { { key->u32[0] = 3735928495U; key->u32[1] = 4U; return; } } static int scan_padding_bytes(void *buf , int len ) { int pad_len ; int max_pad_len ; int __min1 ; int __min2 ; uint8_t *p ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; uint8_t *tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; { pad_len = 0; __min1 = 28; __min2 = len; max_pad_len = __min1 < __min2 ? __min1 : __min2; p = (uint8_t *)buf; descriptor.modname = "ubifs"; descriptor.function = "scan_padding_bytes"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor.format = "UBIFS DBG scan (pid %d): not a node\n"; descriptor.lineno = 164U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG scan (pid %d): not a node\n", tmp->pid); } else { } goto ldv_27499; ldv_27498: pad_len = pad_len + 1; ldv_27499: ; if (pad_len < max_pad_len) { tmp___1 = p; p = p + 1; if ((unsigned int )*tmp___1 == 206U) { goto ldv_27498; } else { goto ldv_27500; } } else { } ldv_27500: ; if (pad_len == 0 || (pad_len & 7) != 0) { return (0); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "scan_padding_bytes"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor___0.format = "UBIFS DBG scan (pid %d): %d padding bytes\n"; descriptor___0.lineno = 172U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG scan (pid %d): %d padding bytes\n", tmp___2->pid, pad_len); } else { } return (pad_len); } } int ubifs_scan_a_node(struct ubifs_info const *c , void *buf , int len , int lnum , int offs , int quiet ) { struct ubifs_ch *ch ; uint32_t magic ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; struct _ddebug descriptor___0 ; char const *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; struct ubifs_pad_node *pad ; int pad_len ; int node_len ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___8 ; long tmp___9 ; { ch = (struct ubifs_ch *)buf; magic = ch->magic; if (magic == 4294967295U) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_scan_a_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor.format = "UBIFS DBG scan (pid %d): hit empty space at LEB %d:%d\n"; descriptor.lineno = 197U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG scan (pid %d): hit empty space at LEB %d:%d\n", tmp->pid, lnum, offs); } else { } return (-1); } else { } if (magic != 101718065U) { tmp___1 = scan_padding_bytes(buf, len); return (tmp___1); } else { } if ((unsigned int )len <= 23U) { return (0); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_scan_a_node"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor___0.format = "UBIFS DBG scan (pid %d): scanning %s at LEB %d:%d\n"; descriptor___0.lineno = 208U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___2 = dbg_ntype((int )ch->node_type); tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG scan (pid %d): scanning %s at LEB %d:%d\n", tmp___3->pid, tmp___2, lnum, offs); } else { } tmp___5 = ubifs_check_node(c, (void const *)buf, lnum, offs, quiet, 1); if (tmp___5 != 0) { return (-3); } else { } if ((unsigned int )ch->node_type == 5U) { pad = (struct ubifs_pad_node *)buf; pad_len = (int )pad->pad_len; node_len = (int )ch->len; if (pad_len < 0 || (offs + node_len) + pad_len > (int )c->leb_size) { if (quiet == 0) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: bad pad node at LEB %d:%d\n", tmp___6->pid, "ubifs_scan_a_node", lnum, offs); ubifs_dump_node(c, (void const *)pad); } else { } return (-4); } else { } if (((node_len + pad_len) & 7) != 0) { if (quiet == 0) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: bad padding length %d - %d\n", tmp___7->pid, "ubifs_scan_a_node", offs, (offs + node_len) + pad_len); } else { } return (-4); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_scan_a_node"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor___1.format = "UBIFS DBG scan (pid %d): %d bytes padded at LEB %d:%d, offset now %d\n"; descriptor___1.lineno = 238U; descriptor___1.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG scan (pid %d): %d bytes padded at LEB %d:%d, offset now %d\n", tmp___8->pid, pad_len, lnum, offs, (((offs + node_len) + pad_len) + 7) & -8); } else { } return (node_len + pad_len); } else { } return (-2); } } struct ubifs_scan_leb *ubifs_start_scan(struct ubifs_info const *c , int lnum , int offs , void *sbuf ) { struct ubifs_scan_leb *sleb ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; struct task_struct *tmp___3 ; void *tmp___4 ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_start_scan"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor.format = "UBIFS DBG scan (pid %d): scan LEB %d:%d\n"; descriptor.lineno = 261U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG scan (pid %d): scan LEB %d:%d\n", tmp->pid, lnum, offs); } else { } tmp___1 = kzalloc(40UL, 80U); sleb = (struct ubifs_scan_leb *)tmp___1; if ((unsigned long )sleb == (unsigned long )((struct ubifs_scan_leb *)0)) { tmp___2 = ERR_PTR(-12L); return ((struct ubifs_scan_leb *)tmp___2); } else { } sleb->lnum = lnum; INIT_LIST_HEAD(& sleb->nodes); sleb->buf = sbuf; err = ubifs_leb_read(c, lnum, sbuf + (unsigned long )offs, offs, (int )c->leb_size - offs, 0); if (err != 0 && err != -74) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read %d bytes from LEB %d:%d, error %d\n", tmp___3->pid, "ubifs_start_scan", (int )c->leb_size - offs, lnum, offs, err); kfree((void const *)sleb); tmp___4 = ERR_PTR((long )err); return ((struct ubifs_scan_leb *)tmp___4); } else { } if (err == -74) { sleb->ecc = 1; } else { } return (sleb); } } void ubifs_end_scan(struct ubifs_info const *c , struct ubifs_scan_leb *sleb , int lnum , int offs ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { lnum = lnum; descriptor.modname = "ubifs"; descriptor.function = "ubifs_end_scan"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor.format = "UBIFS DBG scan (pid %d): stop scanning LEB %d at offset %d\n"; descriptor.lineno = 298U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG scan (pid %d): stop scanning LEB %d at offset %d\n", tmp->pid, lnum, offs); } else { } tmp___2 = ldv__builtin_expect(offs % (int )c->min_io_size != 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_end_scan", 299, tmp___1->pid); dump_stack(); } else { } sleb->endpt = (((int )c->min_io_size + -1) + offs) & - ((int )c->min_io_size); return; } } int ubifs_add_snod(struct ubifs_info const *c , struct ubifs_scan_leb *sleb , void *buf , int offs ) { struct ubifs_ch *ch ; struct ubifs_ino_node *ino ; struct ubifs_scan_node *snod ; void *tmp ; { ch = (struct ubifs_ch *)buf; ino = (struct ubifs_ino_node *)buf; tmp = kmalloc(56UL, 80U); snod = (struct ubifs_scan_node *)tmp; if ((unsigned long )snod == (unsigned long )((struct ubifs_scan_node *)0)) { return (-12); } else { } snod->sqnum = ch->sqnum; snod->type = (int )ch->node_type; snod->offs = offs; snod->len = (int )ch->len; snod->node = buf; switch ((int )ch->node_type) { case 0: ; case 2: ; case 3: ; case 1: key_read(c, (void const *)(& ino->key), & snod->key); goto ldv_27550; default: invalid_key_init(c, & snod->key); goto ldv_27550; } ldv_27550: list_add_tail(& snod->list, & sleb->nodes); sleb->nodes_cnt = sleb->nodes_cnt + 1; return (0); } } void ubifs_scanned_corruption(struct ubifs_info const *c , int lnum , int offs , void *buf ) { int len ; struct task_struct *tmp ; struct task_struct *tmp___0 ; { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: corruption at LEB %d:%d\n", tmp->pid, "ubifs_scanned_corruption", lnum, offs); len = (int )c->leb_size - offs; if (len > 8192) { len = 8192; } else { } tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: first %d bytes from LEB %d:%d\n", tmp___0->pid, "ubifs_scanned_corruption", len, lnum, offs); print_hex_dump("\017", "", 2, 32, 4, (void const *)buf, (size_t )len, 1); return; } } struct ubifs_scan_leb *ubifs_scan(struct ubifs_info const *c , int lnum , int offs , void *sbuf , int quiet ) { void *buf ; int err ; int len ; struct ubifs_scan_leb *sleb ; long tmp ; struct ubifs_ch *ch ; int node_len ; int ret ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; void *tmp___8 ; struct task_struct *tmp___9 ; void *tmp___10 ; { buf = sbuf + (unsigned long )offs; len = (int )c->leb_size - offs; sleb = ubifs_start_scan(c, lnum, offs, sbuf); tmp = IS_ERR((void const *)sleb); if (tmp != 0L) { return (sleb); } else { } goto ldv_27577; ldv_27587: ch = (struct ubifs_ch *)buf; descriptor.modname = "ubifs"; descriptor.function = "ubifs_scan"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared"; descriptor.format = "UBIFS DBG scan (pid %d): look at LEB %d:%d (%d bytes left)\n"; descriptor.lineno = 402U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG scan (pid %d): look at LEB %d:%d (%d bytes left)\n", tmp___0->pid, lnum, offs, len); } else { } __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/scan.c.prepared", 404, 0); _cond_resched(); ret = ubifs_scan_a_node(c, buf, len, lnum, offs, quiet); if (ret > 0) { offs = offs + ret; buf = buf + (unsigned long )ret; len = len - ret; goto ldv_27577; } else { } if (ret == -1) { goto ldv_27578; } else { } switch (ret) { case 0: tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: garbage\n", tmp___2->pid, "ubifs_scan"); goto corrupted; case -2: ; goto ldv_27582; case -3: ; case -4: tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node\n", tmp___3->pid, "ubifs_scan"); goto corrupted; default: tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: unknown\n", tmp___4->pid, "ubifs_scan"); err = -22; goto error; } ldv_27582: err = ubifs_add_snod(c, sleb, buf, offs); if (err != 0) { goto error; } else { } node_len = (int )(ch->len + 7U) & -8; offs = offs + node_len; buf = buf + (unsigned long )node_len; len = len - node_len; ldv_27577: ; if (len > 7) { goto ldv_27587; } else { } ldv_27578: ; if (offs % (int )c->min_io_size != 0) { if (quiet == 0) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: empty space starts at non-aligned offset %d\n", tmp___5->pid, "ubifs_scan", offs); } else { } goto corrupted; } else { } ubifs_end_scan(c, sleb, lnum, offs); goto ldv_27590; ldv_27589: ; if (*((uint32_t *)buf) != 4294967295U) { goto ldv_27588; } else { } offs = offs + 4; buf = buf + 4UL; len = len + -4; ldv_27590: ; if (len > 4) { goto ldv_27589; } else { } ldv_27588: ; goto ldv_27592; ldv_27591: ; if ((unsigned int )*((uint8_t *)buf) != 255U) { if (quiet == 0) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: corrupt empty space at LEB %d:%d\n", tmp___6->pid, "ubifs_scan", lnum, offs); } else { } goto corrupted; } else { } offs = offs + 1; buf = buf + 1; len = len - 1; ldv_27592: ; if (len != 0) { goto ldv_27591; } else { } return (sleb); corrupted: ; if (quiet == 0) { ubifs_scanned_corruption(c, lnum, offs, buf); tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d scanning failed\n", tmp___7->pid, "ubifs_scan", lnum); } else { } err = -117; ubifs_scan_destroy(sleb); tmp___8 = ERR_PTR((long )err); return ((struct ubifs_scan_leb *)tmp___8); error: tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d scanning failed, error %d\n", tmp___9->pid, "ubifs_scan", lnum, err); ubifs_scan_destroy(sleb); tmp___10 = ERR_PTR((long )err); return ((struct ubifs_scan_leb *)tmp___10); } } void ubifs_scan_destroy(struct ubifs_scan_leb *sleb ) { struct ubifs_scan_node *node ; struct list_head *head ; struct list_head const *__mptr ; int tmp ; { head = & sleb->nodes; goto ldv_27602; ldv_27601: __mptr = (struct list_head const *)head->next; node = (struct ubifs_scan_node *)__mptr; list_del(& node->list); kfree((void const *)node); ldv_27602: tmp = list_empty((struct list_head const *)head); if (tmp == 0) { goto ldv_27601; } else { } kfree((void const *)sleb); return; } } void ldv_mutex_lock_377(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_378(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_379(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_380(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_381(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_382(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_383(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_384(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static int list_is_last(struct list_head const *list , struct list_head const *head ) { { return ((unsigned long )((struct list_head const *)list->next) == (unsigned long )head); } } extern __kernel_size_t strnlen(char const * , __kernel_size_t ) ; void ldv_mutex_lock_nested_397(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_394(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_396(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_398(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_400(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_393(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_395(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_399(struct mutex *ldv_func_arg1 ) ; void ubifs_add_bud(struct ubifs_info *c , struct ubifs_bud *bud ) ; struct ubifs_bud *ubifs_search_bud(struct ubifs_info *c , int lnum ) ; struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c , int lnum ) ; struct ubifs_lprops const *ubifs_change_lp(struct ubifs_info *c , struct ubifs_lprops const *lp , int free , int dirty , int flags , int idx_gc_cnt ) ; struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c , int lnum , int offs , void *sbuf , int jhead ) ; struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c , int lnum , int offs , void *sbuf ) ; int ubifs_recover_size_accum(struct ubifs_info *c , union ubifs_key *key , int deletion , loff_t new_size ) ; __inline static void ubifs_get_lprops___0(struct ubifs_info *c ) { { ldv_mutex_lock_399(& c->lp_mutex); return; } } __inline static void ubifs_release_lprops___0(struct ubifs_info *c ) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 280, tmp->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect(c->lst.empty_lebs < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lst.empty_lebs > c->main_lebs, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { } } ldv_mutex_unlock_400(& c->lp_mutex); return; } } __inline static void trun_key_init(struct ubifs_info const *c , union ubifs_key *key , ino_t inum ) { { key->u32[0] = (uint32_t )inum; key->u32[1] = 2147483648U; return; } } __inline static int key_type_flash(struct ubifs_info const *c , void const *k ) { union ubifs_key const *key ; { key = (union ubifs_key const *)k; return ((int )(key->j32[1] >> 29)); } } extern void list_sort(void * , struct list_head * , int (*)(void * , struct list_head * , struct list_head * ) ) ; static int set_bud_lprops(struct ubifs_info *c , struct bud_entry *b ) { struct ubifs_lprops const *lp ; int err ; int dirty ; struct ubifs_lprops *tmp ; long tmp___0 ; long tmp___1 ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; { err = 0; ubifs_get_lprops___0(c); tmp = ubifs_lpt_lookup_dirty(c, (b->bud)->lnum); lp = (struct ubifs_lprops const *)tmp; tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)lp); err = (int )tmp___0; goto out; } else { } dirty = lp->dirty; if ((b->bud)->start == 0 && ((int )lp->free != c->leb_size || (int )lp->dirty != 0)) { descriptor.modname = "ubifs"; descriptor.function = "set_bud_lprops"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): bud LEB %d was GC\'d (%d free, %d dirty)\n"; descriptor.lineno = 251U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): bud LEB %d was GC\'d (%d free, %d dirty)\n", tmp___2->pid, (b->bud)->lnum, lp->free, lp->dirty); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "set_bud_lprops"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor___0.format = "UBIFS DBG gc (pid %d): bud LEB %d was GC\'d (%d free, %d dirty)\n"; descriptor___0.lineno = 253U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gc (pid %d): bud LEB %d was GC\'d (%d free, %d dirty)\n", tmp___4->pid, (b->bud)->lnum, lp->free, lp->dirty); } else { } dirty = ((int )lp->free - c->leb_size) + dirty; if (dirty != 0) { descriptor___1.modname = "ubifs"; descriptor___1.function = "set_bud_lprops"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor___1.format = "UBIFS DBG mnt (pid %d): LEB %d lp: %d free %d dirty replay: %d free %d dirty\n"; descriptor___1.lineno = 265U; descriptor___1.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG mnt (pid %d): LEB %d lp: %d free %d dirty replay: %d free %d dirty\n", tmp___6->pid, (b->bud)->lnum, lp->free, lp->dirty, b->free, b->dirty); } else { } } else { } } else { } lp = ubifs_change_lp(c, lp, b->free, b->dirty + dirty, (int )lp->flags | 16, 0); tmp___9 = IS_ERR((void const *)lp); if (tmp___9 != 0L) { tmp___8 = PTR_ERR((void const *)lp); err = (int )tmp___8; goto out; } else { } err = ubifs_wbuf_seek_nolock(& (c->jheads + (unsigned long )(b->bud)->jhead)->wbuf, (b->bud)->lnum, c->leb_size - b->free); out: ubifs_release_lprops___0(c); return (err); } } static int set_buds_lprops(struct ubifs_info *c ) { struct bud_entry *b ; int err ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)c->replay_buds.next; b = (struct bud_entry *)__mptr; goto ldv_27536; ldv_27535: err = set_bud_lprops(c, b); if (err != 0) { return (err); } else { } __mptr___0 = (struct list_head const *)b->list.next; b = (struct bud_entry *)__mptr___0; ldv_27536: ; if ((unsigned long )(& b->list) != (unsigned long )(& c->replay_buds)) { goto ldv_27535; } else { } return (0); } } static int trun_remove_range(struct ubifs_info *c , struct replay_entry *r ) { unsigned int min_blk ; unsigned int max_blk ; union ubifs_key min_key ; union ubifs_key max_key ; ino_t ino ; int tmp ; { min_blk = (unsigned int )(r->ldv_27507.ldv_27506.new_size / 4096LL); if ((r->ldv_27507.ldv_27506.new_size & 4095LL) != 0LL) { min_blk = min_blk + 1U; } else { } max_blk = (unsigned int )(r->ldv_27507.ldv_27506.old_size / 4096LL); if ((r->ldv_27507.ldv_27506.old_size & 4095LL) == 0LL) { max_blk = max_blk - 1U; } else { } ino = key_inum((struct ubifs_info const *)c, (void const *)(& r->key)); data_key_init((struct ubifs_info const *)c, & min_key, ino, min_blk); data_key_init((struct ubifs_info const *)c, & max_key, ino, max_blk); tmp = ubifs_tnc_remove_range(c, & min_key, & max_key); return (tmp); } } static int apply_replay_entry(struct ubifs_info *c , struct replay_entry *r ) { int err ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; ino_t inum ; ino_t tmp___3 ; int tmp___4 ; { descriptor.modname = "ubifs"; descriptor.function = "apply_replay_entry"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): LEB %d:%d len %d deletion %d sqnum %llu key %s\n"; descriptor.lineno = 343U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& r->key), (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): LEB %d:%d len %d deletion %d sqnum %llu key %s\n", tmp___0->pid, r->lnum, r->offs, r->len, (int )r->deletion, r->sqnum, tmp); } else { } c->replay_sqnum = r->sqnum; tmp___4 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)(& r->key)); if (tmp___4 != 0) { if ((unsigned int )*((unsigned char *)r + 12UL) != 0U) { err = ubifs_tnc_remove_nm(c, (union ubifs_key const *)(& r->key), (struct qstr const *)(& r->ldv_27507.nm)); } else { err = ubifs_tnc_add_nm(c, (union ubifs_key const *)(& r->key), r->lnum, r->offs, r->len, (struct qstr const *)(& r->ldv_27507.nm)); } } else { if ((unsigned int )*((unsigned char *)r + 12UL) != 0U) { tmp___2 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& r->key)); switch (tmp___2) { case 0: tmp___3 = key_inum((struct ubifs_info const *)c, (void const *)(& r->key)); inum = tmp___3; err = ubifs_tnc_remove_ino(c, inum); goto ldv_27557; case 4: err = trun_remove_range(c, r); goto ldv_27557; default: err = ubifs_tnc_remove(c, (union ubifs_key const *)(& r->key)); goto ldv_27557; } ldv_27557: ; } else { err = ubifs_tnc_add(c, (union ubifs_key const *)(& r->key), r->lnum, r->offs, r->len); } if (err != 0) { return (err); } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U) { err = ubifs_recover_size_accum(c, & r->key, (int )r->deletion, r->ldv_27507.ldv_27506.new_size); } else { } } return (err); } } static int replay_entries_cmp(void *priv , struct list_head *a , struct list_head *b ) { struct replay_entry *ra ; struct replay_entry *rb ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp ; long tmp___0 ; { __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared", 400, 0); _cond_resched(); if ((unsigned long )a == (unsigned long )b) { return (0); } else { } __mptr = (struct list_head const *)a; ra = (struct replay_entry *)__mptr + 0xffffffffffffffe8UL; __mptr___0 = (struct list_head const *)b; rb = (struct replay_entry *)__mptr___0 + 0xffffffffffffffe8UL; tmp___0 = ldv__builtin_expect(ra->sqnum == rb->sqnum, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "replay_entries_cmp", 406, tmp->pid); dump_stack(); } else { } if (ra->sqnum > rb->sqnum) { return (1); } else { } return (-1); } } static int apply_replay_list(struct ubifs_info *c ) { struct replay_entry *r ; int err ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { list_sort((void *)c, & c->replay_list, & replay_entries_cmp); __mptr = (struct list_head const *)c->replay_list.next; r = (struct replay_entry *)__mptr + 0xffffffffffffffe8UL; goto ldv_27584; ldv_27583: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared", 427, 0); _cond_resched(); err = apply_replay_entry(c, r); if (err != 0) { return (err); } else { } __mptr___0 = (struct list_head const *)r->list.next; r = (struct replay_entry *)__mptr___0 + 0xffffffffffffffe8UL; ldv_27584: ; if ((unsigned long )(& r->list) != (unsigned long )(& c->replay_list)) { goto ldv_27583; } else { } return (0); } } static void destroy_replay_list(struct ubifs_info *c ) { struct replay_entry *r ; struct replay_entry *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; int tmp___0 ; struct list_head const *__mptr___1 ; { __mptr = (struct list_head const *)c->replay_list.next; r = (struct replay_entry *)__mptr + 0xffffffffffffffe8UL; __mptr___0 = (struct list_head const *)r->list.next; tmp = (struct replay_entry *)__mptr___0 + 0xffffffffffffffe8UL; goto ldv_27598; ldv_27597: tmp___0 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)(& r->key)); if (tmp___0 != 0) { kfree((void const *)r->ldv_27507.nm.name); } else { } list_del(& r->list); kfree((void const *)r); r = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct replay_entry *)__mptr___1 + 0xffffffffffffffe8UL; ldv_27598: ; if ((unsigned long )(& r->list) != (unsigned long )(& c->replay_list)) { goto ldv_27597; } else { } return; } } static int insert_node(struct ubifs_info *c , int lnum , int offs , int len , union ubifs_key *key , unsigned long long sqnum , int deletion , int *used , loff_t old_size , loff_t new_size ) { struct replay_entry *r ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; ino_t tmp___2 ; void *tmp___3 ; { descriptor.modname = "ubifs"; descriptor.function = "insert_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): add LEB %d:%d, key %s\n"; descriptor.lineno = 482U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): add LEB %d:%d, key %s\n", tmp___0->pid, lnum, offs, tmp); } else { } tmp___2 = key_inum((struct ubifs_info const *)c, (void const *)key); if (tmp___2 >= c->highest_inum) { c->highest_inum = key_inum((struct ubifs_info const *)c, (void const *)key); } else { } tmp___3 = kzalloc(64UL, 208U); r = (struct replay_entry *)tmp___3; if ((unsigned long )r == (unsigned long )((struct replay_entry *)0)) { return (-12); } else { } if (deletion == 0) { *used = *used + ((len + 7) & -8); } else { } r->lnum = lnum; r->offs = offs; r->len = len; r->deletion = deletion != 0; r->sqnum = sqnum; key_copy((struct ubifs_info const *)c, (union ubifs_key const *)key, & r->key); r->ldv_27507.ldv_27506.old_size = old_size; r->ldv_27507.ldv_27506.new_size = new_size; list_add_tail(& r->list, & c->replay_list); return (0); } } static int insert_dent(struct ubifs_info *c , int lnum , int offs , int len , union ubifs_key *key , char const *name , int nlen , unsigned long long sqnum , int deletion , int *used ) { struct replay_entry *r ; char *nbuf ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; ino_t tmp___2 ; void *tmp___3 ; void *tmp___4 ; size_t __len ; void *__ret ; { descriptor.modname = "ubifs"; descriptor.function = "insert_dent"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): add LEB %d:%d, key %s\n"; descriptor.lineno = 530U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf), 48); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): add LEB %d:%d, key %s\n", tmp___0->pid, lnum, offs, tmp); } else { } tmp___2 = key_inum((struct ubifs_info const *)c, (void const *)key); if (tmp___2 >= c->highest_inum) { c->highest_inum = key_inum((struct ubifs_info const *)c, (void const *)key); } else { } tmp___3 = kzalloc(64UL, 208U); r = (struct replay_entry *)tmp___3; if ((unsigned long )r == (unsigned long )((struct replay_entry *)0)) { return (-12); } else { } tmp___4 = kmalloc((size_t )(nlen + 1), 208U); nbuf = (char *)tmp___4; if ((unsigned long )nbuf == (unsigned long )((char *)0)) { kfree((void const *)r); return (-12); } else { } if (deletion == 0) { *used = *used + ((len + 7) & -8); } else { } r->lnum = lnum; r->offs = offs; r->len = len; r->deletion = deletion != 0; r->sqnum = sqnum; key_copy((struct ubifs_info const *)c, (union ubifs_key const *)key, & r->key); r->ldv_27507.nm.ldv_7607.ldv_7605.len = (u32 )nlen; __len = (size_t )nlen; __ret = memcpy((void *)nbuf, (void const *)name, __len); *(nbuf + (unsigned long )nlen) = 0; r->ldv_27507.nm.name = (unsigned char const *)nbuf; list_add_tail(& r->list, & c->replay_list); return (0); } } int ubifs_validate_entry(struct ubifs_info *c , struct ubifs_dent_node const *dent ) { int key_type___0 ; int tmp ; int nlen ; struct task_struct *tmp___0 ; __kernel_size_t tmp___1 ; struct task_struct *tmp___2 ; { tmp = key_type_flash((struct ubifs_info const *)c, (void const *)(& dent->key)); key_type___0 = tmp; nlen = (int )dent->nlen; if ((((unsigned long )dent->ch.len != (unsigned long )nlen + 57UL || (unsigned int )((unsigned char )dent->type) > 6U) || nlen > 255) || (unsigned int )dent->name[nlen] != 0U) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad %s node\n", tmp___0->pid, "ubifs_validate_entry", key_type___0 == 2 ? (char *)"directory entry" : (char *)"extended attribute entry"); return (-22); } else { tmp___1 = strnlen((char const *)(& dent->name), (__kernel_size_t )nlen); if (tmp___1 != (__kernel_size_t )nlen) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad %s node\n", tmp___0->pid, "ubifs_validate_entry", key_type___0 == 2 ? (char *)"directory entry" : (char *)"extended attribute entry"); return (-22); } else if ((unsigned long long )dent->inum > 4294967295ULL) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad %s node\n", tmp___0->pid, "ubifs_validate_entry", key_type___0 == 2 ? (char *)"directory entry" : (char *)"extended attribute entry"); return (-22); } else { } } if (key_type___0 != 2 && key_type___0 != 3) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: bad key type %d\n", tmp___2->pid, "ubifs_validate_entry", key_type___0); return (-22); } else { } return (0); } } static int is_last_bud(struct ubifs_info *c , struct ubifs_bud *bud ) { struct ubifs_jhead *jh ; struct ubifs_bud *next ; uint32_t data ; int err ; int tmp ; struct list_head const *__mptr ; int tmp___0 ; { jh = c->jheads + (unsigned long )bud->jhead; tmp = list_is_last((struct list_head const *)(& bud->list), (struct list_head const *)(& jh->buds_list)); if (tmp != 0) { return (1); } else { } __mptr = (struct list_head const *)bud->list.next; next = (struct ubifs_bud *)__mptr + 0xfffffffffffffff0UL; tmp___0 = list_is_last((struct list_head const *)(& next->list), (struct list_head const *)(& jh->buds_list)); if (tmp___0 == 0) { return (0); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, next->lnum, (void *)(& data), next->start, 4, 1); if (err != 0) { return (0); } else { } return (data == 4294967295U); } } static int replay_bud(struct ubifs_info *c , struct bud_entry *b ) { int is_last ; int tmp ; int err ; int used ; int lnum ; int offs ; struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct list_head const *__mptr ; int deletion ; struct task_struct *tmp___4 ; struct ubifs_ino_node *ino ; loff_t new_size ; struct ubifs_data_node *dn ; loff_t new_size___0 ; unsigned int tmp___5 ; struct ubifs_dent_node *dent ; struct ubifs_trun_node *trun ; loff_t old_size ; loff_t new_size___1 ; union ubifs_key key ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; struct list_head const *__mptr___0 ; struct task_struct *tmp___8 ; struct ubifs_bud *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___15 ; long tmp___16 ; struct task_struct *tmp___17 ; { tmp = is_last_bud(c, b->bud); is_last = tmp; err = 0; used = 0; lnum = (b->bud)->lnum; offs = (b->bud)->start; descriptor.modname = "ubifs"; descriptor.function = "replay_bud"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): replay bud LEB %d, head %d, offs %d, is_last %d\n"; descriptor.lineno = 668U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): replay bud LEB %d, head %d, offs %d, is_last %d\n", tmp___0->pid, lnum, (b->bud)->jhead, offs, is_last); } else { } if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U && is_last != 0) { sleb = ubifs_recover_leb(c, lnum, offs, c->sbuf, (b->bud)->jhead); } else { sleb = ubifs_scan((struct ubifs_info const *)c, lnum, offs, c->sbuf, 0); } tmp___3 = IS_ERR((void const *)sleb); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)sleb); return ((int )tmp___2); } else { } __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_27691; ldv_27690: deletion = 0; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared", 708, 0); _cond_resched(); if (snod->sqnum > 0xfffffffffeffffffULL) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: file system\'s life ended\n", tmp___4->pid, "replay_bud"); goto out_dump; } else { } if (snod->sqnum > c->max_sqnum) { c->max_sqnum = snod->sqnum; } else { } switch (snod->type) { case 0: ino = (struct ubifs_ino_node *)snod->node; new_size = (loff_t )ino->size; if (ino->nlink == 0U) { deletion = 1; } else { } err = insert_node(c, lnum, snod->offs, snod->len, & snod->key, snod->sqnum, deletion, & used, 0LL, new_size); goto ldv_27676; case 1: dn = (struct ubifs_data_node *)snod->node; tmp___5 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); new_size___0 = (loff_t )(dn->size + tmp___5 * 4096U); err = insert_node(c, lnum, snod->offs, snod->len, & snod->key, snod->sqnum, deletion, & used, 0LL, new_size___0); goto ldv_27676; case 2: ; case 3: dent = (struct ubifs_dent_node *)snod->node; err = ubifs_validate_entry(c, (struct ubifs_dent_node const *)dent); if (err != 0) { goto out_dump; } else { } err = insert_dent(c, lnum, snod->offs, snod->len, & snod->key, (char const *)(& dent->name), (int )dent->nlen, snod->sqnum, dent->inum == 0ULL, & used); goto ldv_27676; case 4: trun = (struct ubifs_trun_node *)snod->node; old_size = (loff_t )trun->old_size; new_size___1 = (loff_t )trun->new_size; if ((((old_size < 0LL || c->max_inode_sz < old_size) || new_size___1 < 0LL) || c->max_inode_sz < new_size___1) || old_size <= new_size___1) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: bad truncation node\n", tmp___6->pid, "replay_bud"); goto out_dump; } else { } trun_key_init((struct ubifs_info const *)c, & key, (ino_t )trun->inum); err = insert_node(c, lnum, snod->offs, snod->len, & key, snod->sqnum, 1, & used, old_size, new_size___1); goto ldv_27676; default: tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected node type %d in bud LEB %d:%d\n", tmp___7->pid, "replay_bud", snod->type, lnum, snod->offs); err = -22; goto out_dump; } ldv_27676: ; if (err != 0) { goto out; } else { } __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_27691: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27690; } else { } tmp___9 = ubifs_search_bud(c, lnum); tmp___10 = ldv__builtin_expect((unsigned long )tmp___9 == (unsigned long )((struct ubifs_bud *)0), 0L); if (tmp___10 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "replay_bud", 793, tmp___8->pid); dump_stack(); } else { } tmp___12 = ldv__builtin_expect(sleb->endpt - offs < used, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "replay_bud", 794, tmp___11->pid); dump_stack(); } else { } tmp___14 = ldv__builtin_expect(sleb->endpt % c->min_io_size != 0, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "replay_bud", 795, tmp___13->pid); dump_stack(); } else { } b->dirty = (sleb->endpt - offs) - used; b->free = c->leb_size - sleb->endpt; descriptor___0.modname = "ubifs"; descriptor___0.function = "replay_bud"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor___0.format = "UBIFS DBG mnt (pid %d): bud LEB %d replied: dirty %d, free %d\n"; descriptor___0.lineno = 800U; descriptor___0.flags = 0U; tmp___16 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG mnt (pid %d): bud LEB %d replied: dirty %d, free %d\n", tmp___15->pid, lnum, b->dirty, b->free); } else { } out: ubifs_scan_destroy(sleb); return (err); out_dump: tmp___17 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node is at LEB %d:%d\n", tmp___17->pid, "replay_bud", lnum, snod->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)snod->node); ubifs_scan_destroy(sleb); return (-22); } } static int replay_buds(struct ubifs_info *c ) { struct bud_entry *b ; int err ; unsigned long long prev_sqnum ; struct list_head const *__mptr ; struct task_struct *tmp ; long tmp___0 ; struct list_head const *__mptr___0 ; { prev_sqnum = 0ULL; __mptr = (struct list_head const *)c->replay_buds.next; b = (struct bud_entry *)__mptr; goto ldv_27706; ldv_27705: err = replay_bud(c, b); if (err != 0) { return (err); } else { } tmp___0 = ldv__builtin_expect(b->sqnum <= prev_sqnum, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "replay_buds", 831, tmp->pid); dump_stack(); } else { } prev_sqnum = b->sqnum; __mptr___0 = (struct list_head const *)b->list.next; b = (struct bud_entry *)__mptr___0; ldv_27706: ; if ((unsigned long )(& b->list) != (unsigned long )(& c->replay_buds)) { goto ldv_27705; } else { } return (0); } } static void destroy_bud_list(struct ubifs_info *c ) { struct bud_entry *b ; struct list_head const *__mptr ; int tmp ; { goto ldv_27715; ldv_27714: __mptr = (struct list_head const *)c->replay_buds.next; b = (struct bud_entry *)__mptr; list_del(& b->list); kfree((void const *)b); ldv_27715: tmp = list_empty((struct list_head const *)(& c->replay_buds)); if (tmp == 0) { goto ldv_27714; } else { } return; } } static int add_replay_bud(struct ubifs_info *c , int lnum , int offs , int jhead , unsigned long long sqnum ) { struct ubifs_bud *bud ; struct bud_entry *b ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; { descriptor.modname = "ubifs"; descriptor.function = "add_replay_bud"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): add replay bud LEB %d:%d, head %d\n"; descriptor.lineno = 870U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): add replay bud LEB %d:%d, head %d\n", tmp->pid, lnum, offs, jhead); } else { } tmp___1 = kmalloc(56UL, 208U); bud = (struct ubifs_bud *)tmp___1; if ((unsigned long )bud == (unsigned long )((struct ubifs_bud *)0)) { return (-12); } else { } tmp___2 = kmalloc(40UL, 208U); b = (struct bud_entry *)tmp___2; if ((unsigned long )b == (unsigned long )((struct bud_entry *)0)) { kfree((void const *)bud); return (-12); } else { } bud->lnum = lnum; bud->start = offs; bud->jhead = jhead; ubifs_add_bud(c, bud); b->bud = bud; b->sqnum = sqnum; list_add_tail(& b->list, & c->replay_buds); return (0); } } static int validate_ref(struct ubifs_info *c , struct ubifs_ref_node const *ref ) { struct ubifs_bud *bud ; int lnum ; unsigned int offs ; unsigned int jhead ; struct task_struct *tmp ; { lnum = (int )ref->lnum; offs = ref->offs; jhead = ref->jhead; if (((((unsigned int )c->jhead_cnt <= jhead || c->leb_cnt <= lnum) || c->main_first > lnum) || (unsigned int )c->leb_size < offs) || ((unsigned int )(c->min_io_size + -1) & offs) != 0U) { return (-22); } else { } bud = ubifs_search_bud(c, lnum); if ((unsigned long )bud != (unsigned long )((struct ubifs_bud *)0)) { if ((unsigned int )bud->jhead == jhead && (unsigned int )bud->start <= offs) { return (1); } else { } tmp = get_current(); printk("\vUBIFS error (pid %d): %s: bud at LEB %d:%d was already referred\n", tmp->pid, "validate_ref", lnum, offs); return (-22); } else { } return (0); } } static int replay_log_leb(struct ubifs_info *c , int lnum , int offs , void *sbuf ) { int err ; struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; struct ubifs_cs_node const *node ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; struct list_head const *__mptr ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; struct list_head const *__mptr___0 ; struct task_struct *tmp___11 ; struct task_struct *tmp___12 ; struct ubifs_ref_node const *ref ; struct task_struct *tmp___13 ; struct task_struct *tmp___14 ; struct list_head const *__mptr___1 ; struct task_struct *tmp___15 ; { descriptor.modname = "ubifs"; descriptor.function = "replay_log_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): replay log LEB %d:%d\n"; descriptor.lineno = 952U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): replay log LEB %d:%d\n", tmp->pid, lnum, offs); } else { } sleb = ubifs_scan((struct ubifs_info const *)c, lnum, offs, sbuf, (int )c->need_recovery); tmp___5 = IS_ERR((void const *)sleb); if (tmp___5 != 0L) { tmp___2 = PTR_ERR((void const *)sleb); if (tmp___2 != -117L || (unsigned int )*((unsigned char *)c + 5528UL) == 0U) { tmp___1 = PTR_ERR((void const *)sleb); return ((int )tmp___1); } else { } sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf); tmp___4 = IS_ERR((void const *)sleb); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)sleb); return ((int )tmp___3); } else { } } else { } if (sleb->nodes_cnt == 0) { err = 1; goto out; } else { } node = (struct ubifs_cs_node const *)sleb->buf; __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; if (c->cs_sqnum == 0ULL) { if (snod->type != 10) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: first log node at LEB %d:%d is not CS node\n", tmp___6->pid, "replay_log_leb", lnum, offs); goto out_dump; } else { } if ((unsigned long long )node->cmt_no != c->cmt_no) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: first CS node at LEB %d:%d has wrong commit number %llu expected %llu\n", tmp___7->pid, "replay_log_leb", lnum, offs, node->cmt_no, c->cmt_no); goto out_dump; } else { } c->cs_sqnum = node->ch.sqnum; descriptor___0.modname = "ubifs"; descriptor___0.function = "replay_log_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor___0.format = "UBIFS DBG mnt (pid %d): commit start sqnum %llu\n"; descriptor___0.lineno = 996U; descriptor___0.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG mnt (pid %d): commit start sqnum %llu\n", tmp___8->pid, c->cs_sqnum); } else { } } else { } if (snod->sqnum < c->cs_sqnum) { err = 1; goto out; } else { } if (snod->offs != 0) { tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: first node is not at zero offset\n", tmp___10->pid, "replay_log_leb"); goto out_dump; } else { } __mptr___0 = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr___0; goto ldv_27765; ldv_27764: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared", 1018, 0); _cond_resched(); if (snod->sqnum > 0xfffffffffeffffffULL) { tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: file system\'s life ended\n", tmp___11->pid, "replay_log_leb"); goto out_dump; } else { } if (snod->sqnum < c->cs_sqnum) { tmp___12 = get_current(); printk("\vUBIFS error (pid %d): %s: bad sqnum %llu, commit sqnum %llu\n", tmp___12->pid, "replay_log_leb", snod->sqnum, c->cs_sqnum); goto out_dump; } else { } if (snod->sqnum > c->max_sqnum) { c->max_sqnum = snod->sqnum; } else { } switch (snod->type) { case 8: ref = (struct ubifs_ref_node const *)snod->node; err = validate_ref(c, ref); if (err == 1) { goto ldv_27761; } else { } if (err != 0) { goto out_dump; } else { } err = add_replay_bud(c, (int )ref->lnum, (int )ref->offs, (int )ref->jhead, snod->sqnum); if (err != 0) { goto out; } else { } goto ldv_27761; case 10: ; if (snod->offs != 0) { tmp___13 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected node in log\n", tmp___13->pid, "replay_log_leb"); goto out_dump; } else { } goto ldv_27761; default: tmp___14 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected node in log\n", tmp___14->pid, "replay_log_leb"); goto out_dump; } ldv_27761: __mptr___1 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___1; ldv_27765: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27764; } else { } if (sleb->endpt != 0 || c->lhead_offs >= c->leb_size) { c->lhead_lnum = lnum; c->lhead_offs = sleb->endpt; } else { } err = sleb->endpt == 0; out: ubifs_scan_destroy(sleb); return (err); out_dump: tmp___15 = get_current(); printk("\vUBIFS error (pid %d): %s: log error detected while replaying the log at LEB %d:%d\n", tmp___15->pid, "replay_log_leb", lnum, snod->offs + offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)snod->node); ubifs_scan_destroy(sleb); return (-22); } } static int take_ihead(struct ubifs_info *c ) { struct ubifs_lprops const *lp ; int err ; int free ; struct ubifs_lprops *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; { ubifs_get_lprops___0(c); tmp = ubifs_lpt_lookup_dirty(c, c->ihead_lnum); lp = (struct ubifs_lprops const *)tmp; tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)lp); err = (int )tmp___0; goto out; } else { } free = lp->free; lp = ubifs_change_lp(c, lp, -2147483647, -2147483647, (int )lp->flags | 16, 0); tmp___3 = IS_ERR((void const *)lp); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)lp); err = (int )tmp___2; goto out; } else { } err = free; out: ubifs_release_lprops___0(c); return (err); } } int ubifs_replay_journal(struct ubifs_info *c ) { int err ; int lnum ; int free ; struct task_struct *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; { free = take_ihead(c); if (free < 0) { return (free); } else { } if (c->ihead_offs != c->leb_size - free) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: bad index head LEB %d:%d\n", tmp->pid, "ubifs_replay_journal", c->ihead_lnum, c->ihead_offs); return (-22); } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_replay_journal"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): start replaying the journal\n"; descriptor.lineno = 1144U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): start replaying the journal\n", tmp___0->pid); } else { } c->replaying = 1U; tmp___2 = c->lhead_lnum; c->ltail_lnum = tmp___2; lnum = tmp___2; ldv_27784: err = replay_log_leb(c, lnum, 0, c->sbuf); if (err == 1) { goto ldv_27782; } else { } if (err != 0) { goto out; } else { } lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, lnum); if (c->ltail_lnum != lnum) { goto ldv_27784; } else { } ldv_27782: err = replay_buds(c); if (err != 0) { goto out; } else { } err = apply_replay_list(c); if (err != 0) { goto out; } else { } err = set_buds_lprops(c); if (err != 0) { goto out; } else { } tmp___3 = atomic_long_read(& c->dirty_zn_cnt); c->bi.uncommitted_idx = (long long )tmp___3; c->bi.uncommitted_idx = c->bi.uncommitted_idx * (long long )c->max_idx_node_sz; tmp___5 = ldv__builtin_expect(c->bud_bytes > c->max_bud_bytes, 0L); if (tmp___5 != 0L) { tmp___6 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 5528UL) == 0U, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_replay_journal", 1179, tmp___4->pid); dump_stack(); } else { } } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_replay_journal"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/replay.c.prepared"; descriptor___0.format = "UBIFS DBG mnt (pid %d): finished, log head LEB %d:%d, max_sqnum %llu, highest_inum %lu\n"; descriptor___0.lineno = 1182U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG mnt (pid %d): finished, log head LEB %d:%d, max_sqnum %llu, highest_inum %lu\n", tmp___7->pid, c->lhead_lnum, c->lhead_offs, c->max_sqnum, c->highest_inum); } else { } out: destroy_replay_list(c); destroy_bud_list(c); c->replaying = 0U; return (err); } } void ldv_mutex_lock_393(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_394(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_395(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_396(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_397(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_398(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_399(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_400(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void list_add(struct list_head *new , struct list_head *head ) { { __list_add(new, head, head->next); return; } } __inline static void list_move(struct list_head *list , struct list_head *head ) { { __list_del_entry(list); list_add(list, head); return; } } void ldv_mutex_lock_nested_413(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_410(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_412(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_414(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_416(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_418(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_419(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_421(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_423(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_409(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_411(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_415(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_417(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_420(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_422(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_log_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_log_mutex(struct mutex *lock ) ; extern void rb_erase(struct rb_node * , struct rb_root * ) ; extern struct rb_node *rb_next(struct rb_node const * ) ; extern struct rb_node *rb_first(struct rb_root const * ) ; int ubifs_log_start_commit(struct ubifs_info *c , int *ltail_lnum ) ; int ubifs_log_end_commit(struct ubifs_info *c , int ltail_lnum ) ; int ubifs_log_post_commit(struct ubifs_info *c , int old_ltail_lnum ) ; void ubifs_commit_required(struct ubifs_info *c ) ; static int dbg_check_bud_bytes(struct ubifs_info *c ) ; struct ubifs_bud *ubifs_search_bud(struct ubifs_info *c , int lnum ) { struct rb_node *p ; struct ubifs_bud *bud ; struct rb_node const *__mptr ; { spin_lock(& c->buds_lock); p = c->buds.rb_node; goto ldv_27525; ldv_27524: __mptr = (struct rb_node const *)p; bud = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; if (bud->lnum > lnum) { p = p->rb_left; } else if (bud->lnum < lnum) { p = p->rb_right; } else { spin_unlock(& c->buds_lock); return (bud); } ldv_27525: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27524; } else { } spin_unlock(& c->buds_lock); return (0); } } struct ubifs_wbuf *ubifs_get_wbuf(struct ubifs_info *c , int lnum ) { struct rb_node *p ; struct ubifs_bud *bud ; int jhead ; struct rb_node const *__mptr ; { if ((unsigned long )c->jheads == (unsigned long )((struct ubifs_jhead *)0)) { return (0); } else { } spin_lock(& c->buds_lock); p = c->buds.rb_node; goto ldv_27537; ldv_27536: __mptr = (struct rb_node const *)p; bud = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; if (bud->lnum > lnum) { p = p->rb_left; } else if (bud->lnum < lnum) { p = p->rb_right; } else { jhead = bud->jhead; spin_unlock(& c->buds_lock); return (& (c->jheads + (unsigned long )jhead)->wbuf); } ldv_27537: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27536; } else { } spin_unlock(& c->buds_lock); return (0); } } __inline static long long empty_log_bytes(struct ubifs_info const *c ) { long long h ; long long t ; { h = (long long )c->lhead_lnum * (long long )c->leb_size + (long long )c->lhead_offs; t = (long long )c->ltail_lnum * (long long )c->leb_size; if (h >= t) { return (((long long )c->log_bytes - h) + t); } else { return (t - h); } } } void ubifs_add_bud(struct ubifs_info *c , struct ubifs_bud *bud ) { struct rb_node **p ; struct rb_node *parent ; struct ubifs_bud *b ; struct ubifs_jhead *jhead ; struct rb_node const *__mptr ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; { parent = 0; spin_lock(& c->buds_lock); p = & c->buds.rb_node; goto ldv_27556; ldv_27555: parent = *p; __mptr = (struct rb_node const *)parent; b = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; tmp___0 = ldv__builtin_expect(bud->lnum == b->lnum, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_bud", 250, tmp->pid); dump_stack(); } else { } if (bud->lnum < b->lnum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } ldv_27556: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27555; } else { } rb_link_node(& bud->rb, parent, p); rb_insert_color(& bud->rb, & c->buds); if ((unsigned long )c->jheads != (unsigned long )((struct ubifs_jhead *)0)) { jhead = c->jheads + (unsigned long )bud->jhead; list_add_tail(& bud->list, & jhead->buds_list); } else { tmp___2 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 5528UL) == 0U, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_bud", 263, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) == 0U, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_bud", 263, tmp___1->pid); dump_stack(); } else { } } } c->bud_bytes = c->bud_bytes + (long long )(c->leb_size - bud->start); descriptor.modname = "ubifs"; descriptor.function = "ubifs_add_bud"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG log (pid %d): LEB %d:%d, jhead %s, bud_bytes %lld\n"; descriptor.lineno = 274U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = dbg_jhead(bud->jhead); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG log (pid %d): LEB %d:%d, jhead %s, bud_bytes %lld\n", tmp___5->pid, bud->lnum, bud->start, tmp___4, c->bud_bytes); } else { } spin_unlock(& c->buds_lock); return; } } int ubifs_add_bud_to_log(struct ubifs_info *c , int jhead , int lnum , int offs ) { int err ; struct ubifs_bud *bud ; struct ubifs_ref_node *ref ; void *tmp ; void *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; long long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; long long tmp___7 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___8 ; long tmp___9 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___10 ; long tmp___11 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___12 ; long tmp___13 ; { tmp = kmalloc(56UL, 80U); bud = (struct ubifs_bud *)tmp; if ((unsigned long )bud == (unsigned long )((struct ubifs_bud *)0)) { return (-12); } else { } tmp___0 = kzalloc((size_t )c->ref_node_alsz, 80U); ref = (struct ubifs_ref_node *)tmp___0; if ((unsigned long )ref == (unsigned long )((struct ubifs_ref_node *)0)) { kfree((void const *)bud); return (-12); } else { } ldv_mutex_lock_417(& c->log_mutex); tmp___2 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_bud_to_log", 307, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_bud_to_log", 307, tmp___1->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { err = -30; goto out_unlock; } else { } tmp___7 = empty_log_bytes((struct ubifs_info const *)c); if (tmp___7 - (long long )c->ref_node_alsz < (long long )c->min_log_bytes) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_add_bud_to_log"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG log (pid %d): not enough log space - %lld, required %d\n"; descriptor.lineno = 316U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = empty_log_bytes((struct ubifs_info const *)c); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG log (pid %d): not enough log space - %lld, required %d\n", tmp___5->pid, tmp___4, c->min_log_bytes); } else { } ubifs_commit_required(c); err = -11; goto out_unlock; } else { } if ((c->bud_bytes + (long long )c->leb_size) - (long long )offs > c->max_bud_bytes) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_add_bud_to_log"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor___0.format = "UBIFS DBG log (pid %d): bud bytes %lld (%lld max), require commit\n"; descriptor___0.lineno = 333U; descriptor___0.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG log (pid %d): bud bytes %lld (%lld max), require commit\n", tmp___8->pid, c->bud_bytes, c->max_bud_bytes); } else { } ubifs_commit_required(c); err = -11; goto out_unlock; } else { } if (c->bud_bytes >= c->bg_bud_bytes && c->cmt_state == 0) { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_add_bud_to_log"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor___1.format = "UBIFS DBG log (pid %d): bud bytes %lld (%lld max), initiate BG commit\n"; descriptor___1.lineno = 347U; descriptor___1.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG log (pid %d): bud bytes %lld (%lld max), initiate BG commit\n", tmp___10->pid, c->bud_bytes, c->max_bud_bytes); } else { } ubifs_request_bg_commit(c); } else { } bud->lnum = lnum; bud->start = offs; bud->jhead = jhead; ref->ch.node_type = 8U; ref->lnum = (unsigned int )bud->lnum; ref->offs = (unsigned int )bud->start; ref->jhead = (unsigned int )jhead; if (c->lhead_offs > c->leb_size - c->ref_node_alsz) { c->lhead_lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, c->lhead_lnum); c->lhead_offs = 0; } else { } if (c->lhead_offs == 0) { err = ubifs_leb_unmap(c, c->lhead_lnum); if (err != 0) { goto out_unlock; } else { } } else { } if (bud->start == 0) { err = ubifs_leb_map(c, bud->lnum); if (err != 0) { goto out_unlock; } else { } } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_add_bud_to_log"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor___2.format = "UBIFS DBG log (pid %d): write ref LEB %d:%d\n"; descriptor___2.lineno = 386U; descriptor___2.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG log (pid %d): write ref LEB %d:%d\n", tmp___12->pid, c->lhead_lnum, c->lhead_offs); } else { } err = ubifs_write_node(c, (void *)ref, 64, c->lhead_lnum, c->lhead_offs); if (err != 0) { goto out_unlock; } else { } c->lhead_offs = c->lhead_offs + c->ref_node_alsz; ubifs_add_bud(c, bud); ldv_mutex_unlock_418(& c->log_mutex); kfree((void const *)ref); return (0); out_unlock: ldv_mutex_unlock_419(& c->log_mutex); kfree((void const *)ref); kfree((void const *)bud); return (err); } } static void remove_buds(struct ubifs_info *c ) { struct rb_node *p ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct rb_node *p1 ; struct ubifs_bud *bud ; struct ubifs_wbuf *wbuf ; struct rb_node const *__mptr ; struct _ddebug descriptor ; char const *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; char const *tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; { tmp___0 = list_empty((struct list_head const *)(& c->old_buds)); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "remove_buds", 418, tmp->pid); dump_stack(); } else { } c->cmt_bud_bytes = 0LL; spin_lock(& c->buds_lock); p = rb_first((struct rb_root const *)(& c->buds)); goto ldv_27587; ldv_27586: p1 = p; p = rb_next((struct rb_node const *)p); __mptr = (struct rb_node const *)p1; bud = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; wbuf = & (c->jheads + (unsigned long )bud->jhead)->wbuf; if (wbuf->lnum == bud->lnum) { c->cmt_bud_bytes = c->cmt_bud_bytes + (long long )(wbuf->offs - bud->start); descriptor.modname = "ubifs"; descriptor.function = "remove_buds"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG log (pid %d): preserve %d:%d, jhead %s, bud bytes %d, cmt_bud_bytes %lld\n"; descriptor.lineno = 439U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___2 = dbg_jhead(bud->jhead); tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG log (pid %d): preserve %d:%d, jhead %s, bud bytes %d, cmt_bud_bytes %lld\n", tmp___3->pid, bud->lnum, bud->start, tmp___2, wbuf->offs - bud->start, c->cmt_bud_bytes); } else { } bud->start = wbuf->offs; } else { c->cmt_bud_bytes = c->cmt_bud_bytes + (long long )(c->leb_size - bud->start); descriptor___0.modname = "ubifs"; descriptor___0.function = "remove_buds"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor___0.format = "UBIFS DBG log (pid %d): remove %d:%d, jhead %s, bud bytes %d, cmt_bud_bytes %lld\n"; descriptor___0.lineno = 445U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___5 = dbg_jhead(bud->jhead); tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG log (pid %d): remove %d:%d, jhead %s, bud bytes %d, cmt_bud_bytes %lld\n", tmp___6->pid, bud->lnum, bud->start, tmp___5, c->leb_size - bud->start, c->cmt_bud_bytes); } else { } rb_erase(p1, & c->buds); list_move(& bud->list, & c->old_buds); } ldv_27587: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27586; } else { } spin_unlock(& c->buds_lock); return; } } int ubifs_log_start_commit(struct ubifs_info *c , int *ltail_lnum ) { void *buf ; struct ubifs_cs_node *cs ; struct ubifs_ref_node *ref ; int err ; int i ; int max_len ; int len ; void *tmp ; int lnum ; int offs ; struct _ddebug descriptor ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; { err = dbg_check_bud_bytes(c); if (err != 0) { return (err); } else { } max_len = (int )((unsigned int )((unsigned long )c->jhead_cnt) * 64U + 32U); max_len = ((c->min_io_size + -1) + max_len) & - c->min_io_size; tmp = kmalloc((size_t )max_len, 80U); cs = (struct ubifs_cs_node *)tmp; buf = (void *)cs; if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } cs->ch.node_type = 10U; cs->cmt_no = c->cmt_no; ubifs_prepare_node(c, (void *)cs, 32, 0); len = 32; i = 0; goto ldv_27606; ldv_27605: lnum = (c->jheads + (unsigned long )i)->wbuf.lnum; offs = (c->jheads + (unsigned long )i)->wbuf.offs; if (lnum == -1 || c->leb_size == offs) { goto ldv_27602; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_log_start_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG log (pid %d): add ref to LEB %d:%d for jhead %s\n"; descriptor.lineno = 510U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = dbg_jhead(i); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG log (pid %d): add ref to LEB %d:%d for jhead %s\n", tmp___1->pid, lnum, offs, tmp___0); } else { } ref = (struct ubifs_ref_node *)buf + (unsigned long )len; ref->ch.node_type = 8U; ref->lnum = (unsigned int )lnum; ref->offs = (unsigned int )offs; ref->jhead = (unsigned int )i; ubifs_prepare_node(c, (void *)ref, 64, 0); len = (int )((unsigned int )len + 64U); ldv_27602: i = i + 1; ldv_27606: ; if (c->jhead_cnt > i) { goto ldv_27605; } else { } ubifs_pad((struct ubifs_info const *)c, buf + (unsigned long )len, (((c->min_io_size + -1) + len) & - c->min_io_size) - len); if (c->lhead_offs != 0) { c->lhead_lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, c->lhead_lnum); c->lhead_offs = 0; } else { } if (c->lhead_offs == 0) { err = ubifs_leb_unmap(c, c->lhead_lnum); if (err != 0) { goto out; } else { } } else { } len = ((c->min_io_size + -1) + len) & - c->min_io_size; descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_log_start_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor___0.format = "UBIFS DBG log (pid %d): writing commit start at LEB %d:0, len %d\n"; descriptor___0.lineno = 537U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG log (pid %d): writing commit start at LEB %d:0, len %d\n", tmp___3->pid, c->lhead_lnum, len); } else { } err = ubifs_leb_write(c, c->lhead_lnum, (void const *)cs, 0, len); if (err != 0) { goto out; } else { } *ltail_lnum = c->lhead_lnum; c->lhead_offs = c->lhead_offs + len; if (c->lhead_offs == c->leb_size) { c->lhead_lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, c->lhead_lnum); c->lhead_offs = 0; } else { } remove_buds(c); c->min_log_bytes = 0; out: kfree((void const *)buf); return (err); } } int ubifs_log_end_commit(struct ubifs_info *c , int ltail_lnum ) { int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { ldv_mutex_lock_420(& c->log_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_log_end_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG log (pid %d): old tail was LEB %d:0, new tail is LEB %d:0\n"; descriptor.lineno = 585U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG log (pid %d): old tail was LEB %d:0, new tail is LEB %d:0\n", tmp->pid, c->ltail_lnum, ltail_lnum); } else { } c->ltail_lnum = ltail_lnum; c->min_log_bytes = c->leb_size; spin_lock(& c->buds_lock); c->bud_bytes = c->bud_bytes - c->cmt_bud_bytes; spin_unlock(& c->buds_lock); err = dbg_check_bud_bytes(c); ldv_mutex_unlock_421(& c->log_mutex); return (err); } } int ubifs_log_post_commit(struct ubifs_info *c , int old_ltail_lnum ) { int lnum ; int err ; struct ubifs_bud *bud ; struct list_head const *__mptr ; int tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; { err = 0; goto ldv_27627; ldv_27626: __mptr = (struct list_head const *)c->old_buds.next; bud = (struct ubifs_bud *)__mptr + 0xfffffffffffffff0UL; err = ubifs_return_leb(c, bud->lnum); if (err != 0) { return (err); } else { } list_del(& bud->list); kfree((void const *)bud); ldv_27627: tmp = list_empty((struct list_head const *)(& c->old_buds)); if (tmp == 0) { goto ldv_27626; } else { } ldv_mutex_lock_422(& c->log_mutex); lnum = old_ltail_lnum; goto ldv_27633; ldv_27632: descriptor.modname = "ubifs"; descriptor.function = "ubifs_log_post_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG log (pid %d): unmap log LEB %d\n"; descriptor.lineno = 634U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG log (pid %d): unmap log LEB %d\n", tmp___0->pid, lnum); } else { } err = ubifs_leb_unmap(c, lnum); if (err != 0) { goto out; } else { } lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, lnum); ldv_27633: ; if (c->ltail_lnum != lnum) { goto ldv_27632; } else { } out: ldv_mutex_unlock_423(& c->log_mutex); return (err); } } static int done_already(struct rb_root *done_tree , int lnum ) { struct rb_node **p ; struct rb_node *parent ; struct done_ref *dr ; struct rb_node const *__mptr ; void *tmp ; { p = & done_tree->rb_node; parent = 0; goto ldv_27648; ldv_27647: parent = *p; __mptr = (struct rb_node const *)parent; dr = (struct done_ref *)__mptr; if (dr->lnum > lnum) { p = & (*p)->rb_left; } else if (dr->lnum < lnum) { p = & (*p)->rb_right; } else { return (1); } ldv_27648: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27647; } else { } tmp = kzalloc(32UL, 80U); dr = (struct done_ref *)tmp; if ((unsigned long )dr == (unsigned long )((struct done_ref *)0)) { return (-12); } else { } dr->lnum = lnum; rb_link_node(& dr->rb, parent, p); rb_insert_color(& dr->rb, done_tree); return (0); } } static void destroy_done_tree(struct rb_root *done_tree ) { struct rb_node *this ; struct done_ref *dr ; struct rb_node const *__mptr ; { this = done_tree->rb_node; goto ldv_27655; ldv_27658: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; goto ldv_27655; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; goto ldv_27655; } else { } __mptr = (struct rb_node const *)this; dr = (struct done_ref *)__mptr; this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& dr->rb)) { this->rb_left = 0; } else { this->rb_right = 0; } } else { } kfree((void const *)dr); ldv_27655: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_27658; } else { } return; } } static int add_node(struct ubifs_info *c , void *buf , int *lnum , int *offs , void *node ) { struct ubifs_ch *ch ; int len ; int remains ; int sz ; int err ; size_t __len ; void *__ret ; { ch = (struct ubifs_ch *)node; len = (int )ch->len; remains = c->leb_size - *offs; if (len > remains) { sz = (*offs + (c->min_io_size + -1)) & - c->min_io_size; ubifs_pad((struct ubifs_info const *)c, buf + (unsigned long )*offs, sz - *offs); err = ubifs_leb_change(c, *lnum, (void const *)buf, sz); if (err != 0) { return (err); } else { } *lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, *lnum); *offs = 0; } else { } __len = (size_t )len; __ret = memcpy(buf + (unsigned long )*offs, (void const *)node, __len); *offs = *offs + ((len + 7) & -8); return (0); } } int ubifs_consolidate_log(struct ubifs_info *c ) { struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; struct rb_root done_tree ; int lnum ; int err ; int first ; int write_lnum ; int offs ; void *buf ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; struct list_head const *__mptr ; struct ubifs_ref_node *ref ; int ref_lnum ; struct list_head const *__mptr___0 ; int sz ; struct task_struct *tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; { done_tree.rb_node = 0; first = 1; offs = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_consolidate_log"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): log tail LEB %d, log head LEB %d\n"; descriptor.lineno = 769U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): log tail LEB %d, log head LEB %d\n", tmp->pid, c->ltail_lnum, c->lhead_lnum); } else { } buf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } lnum = c->ltail_lnum; write_lnum = lnum; ldv_27705: sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, c->sbuf, 0); tmp___2 = IS_ERR((void const *)sleb); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)sleb); err = (int )tmp___1; goto out_free; } else { } __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_27702; ldv_27701: ; switch (snod->type) { case 8: ref = (struct ubifs_ref_node *)snod->node; ref_lnum = (int )ref->lnum; err = done_already(& done_tree, ref_lnum); if (err < 0) { goto out_scan; } else { } if (err != 1) { err = add_node(c, buf, & write_lnum, & offs, snod->node); if (err != 0) { goto out_scan; } else { } } else { } goto ldv_27699; case 10: ; if (first == 0) { goto ldv_27699; } else { } err = add_node(c, buf, & write_lnum, & offs, snod->node); if (err != 0) { goto out_scan; } else { } first = 0; goto ldv_27699; } ldv_27699: __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_27702: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27701; } else { } ubifs_scan_destroy(sleb); if (c->lhead_lnum == lnum) { goto ldv_27704; } else { } lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, lnum); goto ldv_27705; ldv_27704: ; if (offs != 0) { sz = ((c->min_io_size + -1) + offs) & - c->min_io_size; ubifs_pad((struct ubifs_info const *)c, buf + (unsigned long )offs, sz - offs); err = ubifs_leb_change(c, write_lnum, (void const *)buf, sz); if (err != 0) { goto out_free; } else { } offs = ((c->min_io_size + -1) + offs) & - c->min_io_size; } else { } destroy_done_tree(& done_tree); vfree((void const *)buf); if (c->lhead_lnum == write_lnum) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: log is too full\n", tmp___3->pid, "ubifs_consolidate_log"); return (-22); } else { } lnum = write_lnum; ldv_27707: lnum = ubifs_next_log_lnum((struct ubifs_info const *)c, lnum); err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } if (c->lhead_lnum != lnum) { goto ldv_27707; } else { } c->lhead_lnum = write_lnum; c->lhead_offs = offs; descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_consolidate_log"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/log.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): new log head at %d:%d\n"; descriptor___0.lineno = 839U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): new log head at %d:%d\n", tmp___4->pid, c->lhead_lnum, c->lhead_offs); } else { } return (0); out_scan: ubifs_scan_destroy(sleb); out_free: destroy_done_tree(& done_tree); vfree((void const *)buf); return (err); } } static int dbg_check_bud_bytes(struct ubifs_info *c ) { int i ; int err ; struct ubifs_bud *bud ; long long bud_bytes ; int tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___0 ; { err = 0; bud_bytes = 0LL; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } spin_lock(& c->buds_lock); i = 0; goto ldv_27725; ldv_27724: __mptr = (struct list_head const *)(c->jheads + (unsigned long )i)->buds_list.next; bud = (struct ubifs_bud *)__mptr + 0xfffffffffffffff0UL; goto ldv_27722; ldv_27721: bud_bytes = (long long )(c->leb_size - bud->start) + bud_bytes; __mptr___0 = (struct list_head const *)bud->list.next; bud = (struct ubifs_bud *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27722: ; if ((unsigned long )(& bud->list) != (unsigned long )(& (c->jheads + (unsigned long )i)->buds_list)) { goto ldv_27721; } else { } i = i + 1; ldv_27725: ; if (c->jhead_cnt > i) { goto ldv_27724; } else { } if (c->bud_bytes != bud_bytes) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad bud_bytes %lld, calculated %lld\n", tmp___0->pid, "dbg_check_bud_bytes", c->bud_bytes, bud_bytes); err = -22; } else { } spin_unlock(& c->buds_lock); return (err); } } void ldv_mutex_lock_409(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_410(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_411(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_412(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_413(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_414(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_415(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_416(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_417(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_log_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_418(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_log_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_419(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_log_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_420(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_log_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_421(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_log_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_422(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_log_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_423(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_log_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void __xchg_wrong_size(void) ; void ldv_mutex_lock_nested_443(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_440(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_442(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_444(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_446(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_448(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_439(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_441(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_445(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_447(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_mst_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_mst_mutex(struct mutex *lock ) ; extern void __wake_up(wait_queue_head_t * , unsigned int , int , void * ) ; extern void prepare_to_wait(wait_queue_head_t * , wait_queue_t * , int ) ; extern void finish_wait(wait_queue_head_t * , wait_queue_t * ) ; extern int autoremove_wake_function(wait_queue_t * , unsigned int , int , void * ) ; extern void schedule(void) ; extern atomic_t system_freezing_cnt ; extern bool freezing_slow_path(struct task_struct * ) ; __inline static bool freezing(struct task_struct *p ) { int tmp ; long tmp___0 ; bool tmp___1 ; { tmp = atomic_read((atomic_t const *)(& system_freezing_cnt)); tmp___0 = ldv__builtin_expect(tmp == 0, 1L); if (tmp___0 != 0L) { return (0); } else { } tmp___1 = freezing_slow_path(p); return (tmp___1); } } extern bool __refrigerator(bool ) ; __inline static bool try_to_freeze(void) { struct task_struct *tmp ; bool tmp___0 ; int tmp___1 ; long tmp___2 ; bool tmp___3 ; { __might_sleep("include/linux/freezer.h", 46, 0); tmp = get_current(); tmp___0 = freezing(tmp); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } tmp___2 = ldv__builtin_expect((long )tmp___1, 1L); if (tmp___2 != 0L) { return (0); } else { } tmp___3 = __refrigerator(0); return (tmp___3); } } extern bool set_freezable(void) ; extern bool kthread_should_stop(void) ; int ubifs_tnc_start_commit(struct ubifs_info *c , struct ubifs_zbranch *zroot ) ; int ubifs_tnc_end_commit(struct ubifs_info *c ) ; int ubifs_gc_should_commit(struct ubifs_info *c ) ; int ubifs_gc_start_commit(struct ubifs_info *c ) ; int ubifs_gc_end_commit(struct ubifs_info *c ) ; int ubifs_orphan_start_commit(struct ubifs_info *c ) ; int ubifs_orphan_end_commit(struct ubifs_info *c ) ; int ubifs_lpt_start_commit(struct ubifs_info *c ) ; int ubifs_lpt_end_commit(struct ubifs_info *c ) ; int ubifs_lpt_post_commit(struct ubifs_info *c ) ; void ubifs_get_lp_stats(struct ubifs_info *c , struct ubifs_lp_stats *lst ) ; char const *dbg_cstate(int cmt_state ) ; int dbg_check_old_index(struct ubifs_info *c , struct ubifs_zbranch *zroot ) ; __inline static int ubifs_wbuf_sync___0(struct ubifs_wbuf *wbuf ) { int err ; { ldv_mutex_lock_nested_443(& wbuf->io_mutex, (unsigned int )wbuf->jhead); err = ubifs_wbuf_sync_nolock(wbuf); ldv_mutex_unlock_444(& wbuf->io_mutex); return (err); } } __inline static void *ubifs_idx_key(struct ubifs_info const *c , struct ubifs_idx_node const *idx ) { { return ((void *)(& ((struct ubifs_branch *)(& idx->branches))->key)); } } static int nothing_to_commit(struct ubifs_info *c ) { int tmp ; int tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; { if ((unsigned int )*((unsigned char *)c + 5528UL) != 0U || (unsigned int )*((unsigned char *)c + 5528UL) != 0U) { return (0); } else { } if ((unsigned long )c->zroot.ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { tmp = ubifs_zn_dirty((struct ubifs_znode const *)c->zroot.ldv_26076.znode); if (tmp != 0) { return (0); } else { } } else { } if ((unsigned long )c->nroot != (unsigned long )((struct ubifs_nnode *)0)) { tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& (c->nroot)->flags)); if (tmp___0 != 0) { return (0); } else { } } else { } tmp___2 = atomic_long_read(& c->dirty_zn_cnt); tmp___3 = ldv__builtin_expect(tmp___2 != 0L, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nothing_to_commit", 213, tmp___1->pid); dump_stack(); } else { } tmp___5 = ldv__builtin_expect(c->dirty_pn_cnt != 0, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nothing_to_commit", 214, tmp___4->pid); dump_stack(); } else { } tmp___7 = ldv__builtin_expect(c->dirty_nn_cnt != 0, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nothing_to_commit", 215, tmp___6->pid); dump_stack(); } else { } return (1); } } static int do_commit(struct ubifs_info *c ) { int err ; int new_ltail_lnum ; int old_ltail_lnum ; int i ; struct ubifs_zbranch zroot ; struct ubifs_lp_stats lst ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; int tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; { descriptor.modname = "ubifs"; descriptor.function = "do_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): start\n"; descriptor.lineno = 234U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): start\n", tmp->pid); } else { } tmp___2 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_commit", 235, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_commit", 235, tmp___1->pid); dump_stack(); } else { } } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { err = -30; goto out_up; } else { } tmp___4 = nothing_to_commit(c); if (tmp___4 != 0) { up_write(& c->commit_sem); err = 0; goto out_cancel; } else { } i = 0; goto ldv_27614; ldv_27613: err = ubifs_wbuf_sync___0(& (c->jheads + (unsigned long )i)->wbuf); if (err != 0) { goto out_up; } else { } i = i + 1; ldv_27614: ; if (c->jhead_cnt > i) { goto ldv_27613; } else { } c->cmt_no = c->cmt_no + 1ULL; err = ubifs_gc_start_commit(c); if (err != 0) { goto out_up; } else { } err = dbg_check_lprops(c); if (err != 0) { goto out_up; } else { } err = ubifs_log_start_commit(c, & new_ltail_lnum); if (err != 0) { goto out_up; } else { } err = ubifs_tnc_start_commit(c, & zroot); if (err != 0) { goto out_up; } else { } err = ubifs_lpt_start_commit(c); if (err != 0) { goto out_up; } else { } err = ubifs_orphan_start_commit(c); if (err != 0) { goto out_up; } else { } ubifs_get_lp_stats(c, & lst); up_write(& c->commit_sem); err = ubifs_tnc_end_commit(c); if (err != 0) { goto out; } else { } err = ubifs_lpt_end_commit(c); if (err != 0) { goto out; } else { } err = ubifs_orphan_end_commit(c); if (err != 0) { goto out; } else { } old_ltail_lnum = c->ltail_lnum; err = ubifs_log_end_commit(c, new_ltail_lnum); if (err != 0) { goto out; } else { } err = dbg_check_old_index(c, & zroot); if (err != 0) { goto out; } else { } ldv_mutex_lock_447(& c->mst_mutex); (c->mst_node)->cmt_no = c->cmt_no; (c->mst_node)->log_lnum = (unsigned int )new_ltail_lnum; (c->mst_node)->root_lnum = (unsigned int )zroot.lnum; (c->mst_node)->root_offs = (unsigned int )zroot.offs; (c->mst_node)->root_len = (unsigned int )zroot.len; (c->mst_node)->ihead_lnum = (unsigned int )c->ihead_lnum; (c->mst_node)->ihead_offs = (unsigned int )c->ihead_offs; (c->mst_node)->index_size = c->bi.old_idx_sz; (c->mst_node)->lpt_lnum = (unsigned int )c->lpt_lnum; (c->mst_node)->lpt_offs = (unsigned int )c->lpt_offs; (c->mst_node)->nhead_lnum = (unsigned int )c->nhead_lnum; (c->mst_node)->nhead_offs = (unsigned int )c->nhead_offs; (c->mst_node)->ltab_lnum = (unsigned int )c->ltab_lnum; (c->mst_node)->ltab_offs = (unsigned int )c->ltab_offs; (c->mst_node)->lsave_lnum = (unsigned int )c->lsave_lnum; (c->mst_node)->lsave_offs = (unsigned int )c->lsave_offs; (c->mst_node)->lscan_lnum = (unsigned int )c->lscan_lnum; (c->mst_node)->empty_lebs = (unsigned int )lst.empty_lebs; (c->mst_node)->idx_lebs = (unsigned int )lst.idx_lebs; (c->mst_node)->total_free = (unsigned long long )lst.total_free; (c->mst_node)->total_dirty = (unsigned long long )lst.total_dirty; (c->mst_node)->total_used = (unsigned long long )lst.total_used; (c->mst_node)->total_dead = (unsigned long long )lst.total_dead; (c->mst_node)->total_dark = (unsigned long long )lst.total_dark; if (c->no_orphs != 0) { (c->mst_node)->flags = (c->mst_node)->flags | 2U; } else { (c->mst_node)->flags = (c->mst_node)->flags & 4294967293U; } err = ubifs_write_master(c); ldv_mutex_unlock_448(& c->mst_mutex); if (err != 0) { goto out; } else { } err = ubifs_log_post_commit(c, old_ltail_lnum); if (err != 0) { goto out; } else { } err = ubifs_gc_end_commit(c); if (err != 0) { goto out; } else { } err = ubifs_lpt_post_commit(c); if (err != 0) { goto out; } else { } out_cancel: spin_lock(& c->cs_lock); c->cmt_state = 0; __wake_up(& c->cmt_wq, 3U, 1, 0); descriptor___0.modname = "ubifs"; descriptor___0.function = "do_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): commit end\n"; descriptor___0.lineno = 344U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): commit end\n", tmp___5->pid); } else { } spin_unlock(& c->cs_lock); return (0); out_up: up_write(& c->commit_sem); out: tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: commit failed, error %d\n", tmp___7->pid, "do_commit", err); spin_lock(& c->cs_lock); c->cmt_state = 5; __wake_up(& c->cmt_wq, 3U, 1, 0); spin_unlock(& c->cs_lock); ubifs_ro_mode(c, err); return (err); } } static int run_bg_commit(struct ubifs_info *c ) { int tmp ; { spin_lock(& c->cs_lock); if (c->cmt_state != 1 && c->cmt_state != 2) { goto out; } else { } spin_unlock(& c->cs_lock); down_write(& c->commit_sem); spin_lock(& c->cs_lock); if (c->cmt_state == 2) { c->cmt_state = 4; } else if (c->cmt_state == 1) { c->cmt_state = 3; } else { goto out_cmt_unlock; } spin_unlock(& c->cs_lock); tmp = do_commit(c); return (tmp); out_cmt_unlock: up_write(& c->commit_sem); out: spin_unlock(& c->cs_lock); return (0); } } int ubifs_bg_thread(void *info ) { int err ; struct ubifs_info *c ; struct task_struct *tmp ; bool tmp___0 ; bool tmp___1 ; long volatile __ret ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; bool tmp___6 ; struct task_struct *tmp___7 ; { c = (struct ubifs_info *)info; tmp = get_current(); printk("\rUBIFS: background thread \"%s\" started, PID %d\n", (char *)(& c->bgt_name), tmp->pid); set_freezable(); ldv_27639: tmp___0 = kthread_should_stop(); if ((int )tmp___0) { goto ldv_27628; } else { } tmp___1 = try_to_freeze(); if ((int )tmp___1) { goto ldv_27629; } else { } __ret = 1L; switch (8UL) { case 1UL: tmp___2 = get_current(); __asm__ volatile ("xchgb %b0, %1\n": "+q" (__ret), "+m" (tmp___2->state): : "memory", "cc"); goto ldv_27632; case 2UL: tmp___3 = get_current(); __asm__ volatile ("xchgw %w0, %1\n": "+r" (__ret), "+m" (tmp___3->state): : "memory", "cc"); goto ldv_27632; case 4UL: tmp___4 = get_current(); __asm__ volatile ("xchgl %0, %1\n": "+r" (__ret), "+m" (tmp___4->state): : "memory", "cc"); goto ldv_27632; case 8UL: tmp___5 = get_current(); __asm__ volatile ("xchgq %q0, %1\n": "+r" (__ret), "+m" (tmp___5->state): : "memory", "cc"); goto ldv_27632; default: __xchg_wrong_size(); } ldv_27632: ; if (c->need_bgt == 0) { tmp___6 = kthread_should_stop(); if ((int )tmp___6) { goto ldv_27628; } else { } schedule(); goto ldv_27629; } else { tmp___7 = get_current(); tmp___7->state = 0L; } c->need_bgt = 0; err = ubifs_bg_wbufs_sync(c); if (err != 0) { ubifs_ro_mode(c, err); } else { } run_bg_commit(c); __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared", 447, 0); _cond_resched(); ldv_27629: ; goto ldv_27639; ldv_27628: printk("\rUBIFS: background thread \"%s\" stops\n", (char *)(& c->bgt_name)); return (0); } } void ubifs_commit_required(struct ubifs_info *c ) { struct _ddebug descriptor ; char const *tmp ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; char const *tmp___3 ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; { spin_lock(& c->cs_lock); switch (c->cmt_state) { case 0: ; case 1: descriptor.modname = "ubifs"; descriptor.function = "ubifs_commit_required"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): old: %s, new: %s\n"; descriptor.lineno = 468U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp = dbg_cstate(2); tmp___0 = dbg_cstate(c->cmt_state); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): old: %s, new: %s\n", tmp___1->pid, tmp___0, tmp); } else { } c->cmt_state = 2; goto ldv_27647; case 3: descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_commit_required"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): old: %s, new: %s\n"; descriptor___0.lineno = 473U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___3 = dbg_cstate(4); tmp___4 = dbg_cstate(c->cmt_state); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): old: %s, new: %s\n", tmp___5->pid, tmp___4, tmp___3); } else { } c->cmt_state = 4; goto ldv_27647; case 2: ; case 4: ; case 5: ; goto ldv_27647; } ldv_27647: spin_unlock(& c->cs_lock); return; } } void ubifs_request_bg_commit(struct ubifs_info *c ) { struct _ddebug descriptor ; char const *tmp ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { spin_lock(& c->cs_lock); if (c->cmt_state == 0) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_request_bg_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): old: %s, new: %s\n"; descriptor.lineno = 496U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp = dbg_cstate(1); tmp___0 = dbg_cstate(c->cmt_state); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): old: %s, new: %s\n", tmp___1->pid, tmp___0, tmp); } else { } c->cmt_state = 1; spin_unlock(& c->cs_lock); ubifs_wake_up_bgt(c); } else { spin_unlock(& c->cs_lock); } return; } } static int wait_for_commit(struct ubifs_info *c ) { struct _ddebug descriptor ; struct task_struct *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; wait_queue_t __wait ; struct task_struct *tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; { descriptor.modname = "ubifs"; descriptor.function = "wait_for_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): pid %d goes sleep\n"; descriptor.lineno = 512U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp = get_current(); tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): pid %d goes sleep\n", tmp___0->pid, tmp->pid); } else { } if (c->cmt_state != 3 && c->cmt_state != 4) { goto ldv_27663; } else { } tmp___2 = get_current(); __wait.flags = 0U; __wait.private = (void *)tmp___2; __wait.func = & autoremove_wake_function; __wait.task_list.next = & __wait.task_list; __wait.task_list.prev = & __wait.task_list; ldv_27666: prepare_to_wait(& c->cmt_wq, & __wait, 2); if (c->cmt_state != 3 && c->cmt_state != 4) { goto ldv_27665; } else { } schedule(); goto ldv_27666; ldv_27665: finish_wait(& c->cmt_wq, & __wait); ldv_27663: descriptor___0.modname = "ubifs"; descriptor___0.function = "wait_for_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): commit finished, pid %d woke up\n"; descriptor___0.lineno = 523U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): commit finished, pid %d woke up\n", tmp___4->pid, tmp___3->pid); } else { } return (0); } } int ubifs_run_commit(struct ubifs_info *c ) { int err ; int tmp ; int tmp___0 ; { err = 0; spin_lock(& c->cs_lock); if (c->cmt_state == 5) { err = -30; goto out; } else { } if (c->cmt_state == 3) { c->cmt_state = 4; } else { } if (c->cmt_state == 4) { spin_unlock(& c->cs_lock); tmp = wait_for_commit(c); return (tmp); } else { } spin_unlock(& c->cs_lock); down_write(& c->commit_sem); spin_lock(& c->cs_lock); if (c->cmt_state == 5) { err = -30; goto out_cmt_unlock; } else { } if (c->cmt_state == 3) { c->cmt_state = 4; } else { } if (c->cmt_state == 4) { up_write(& c->commit_sem); spin_unlock(& c->cs_lock); tmp___0 = wait_for_commit(c); return (tmp___0); } else { } c->cmt_state = 4; spin_unlock(& c->cs_lock); err = do_commit(c); return (err); out_cmt_unlock: up_write(& c->commit_sem); out: spin_unlock(& c->cs_lock); return (err); } } int ubifs_gc_should_commit(struct ubifs_info *c ) { int ret ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { ret = 0; spin_lock(& c->cs_lock); if (c->cmt_state == 1) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_gc_should_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): commit required now\n"; descriptor.lineno = 608U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): commit required now\n", tmp->pid); } else { } c->cmt_state = 2; } else { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_gc_should_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): commit not requested\n"; descriptor___0.lineno = 611U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): commit not requested\n", tmp___1->pid); } else { } } if (c->cmt_state == 2) { ret = 1; } else { } spin_unlock(& c->cs_lock); return (ret); } } int dbg_old_index_check_init(struct ubifs_info *c , struct ubifs_zbranch *zroot ) { struct ubifs_idx_node *idx ; int lnum ; int offs ; int len ; int err ; struct ubifs_debug_info *d ; void *tmp ; { err = 0; d = c->dbg; d->old_zroot = *zroot; lnum = d->old_zroot.lnum; offs = d->old_zroot.offs; len = d->old_zroot.len; tmp = kmalloc((size_t )c->max_idx_node_sz, 80U); idx = (struct ubifs_idx_node *)tmp; if ((unsigned long )idx == (unsigned long )((struct ubifs_idx_node *)0)) { return (-12); } else { } err = ubifs_read_node((struct ubifs_info const *)c, (void *)idx, 9, len, lnum, offs); if (err != 0) { goto out; } else { } d->old_zroot_level = (int )idx->level; d->old_zroot_sqnum = idx->ch.sqnum; out: kfree((void const *)idx); return (err); } } int dbg_check_old_index(struct ubifs_info *c , struct ubifs_zbranch *zroot ) { int lnum ; int offs ; int len ; int err ; int last_level ; int child_cnt ; int first ; int iip ; struct ubifs_debug_info *d ; union ubifs_key lower_key ; union ubifs_key upper_key ; union ubifs_key l_key ; union ubifs_key u_key ; unsigned long long last_sqnum ; struct ubifs_idx_node *idx ; struct list_head list ; struct idx_node *i ; size_t sz ; int tmp ; int tmp___0 ; struct ubifs_branch *br ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; int tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; struct list_head const *__mptr ; struct task_struct *tmp___9 ; struct list_head const *__mptr___0 ; struct task_struct *tmp___10 ; int tmp___11 ; struct list_head const *__mptr___1 ; int tmp___12 ; struct task_struct *tmp___13 ; { err = 0; last_level = last_level; first = 1; d = c->dbg; lower_key = lower_key; last_sqnum = last_sqnum; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } INIT_LIST_HEAD(& list); tmp___0 = ubifs_idx_node_sz((struct ubifs_info const *)c, c->fanout); sz = (unsigned long )tmp___0 + 36UL; lnum = d->old_zroot.lnum; offs = d->old_zroot.offs; len = d->old_zroot.len; iip = 0; ldv_27727: tmp___1 = kmalloc(sz, 80U); i = (struct idx_node *)tmp___1; if ((unsigned long )i == (unsigned long )((struct idx_node *)0)) { err = -12; goto out_free; } else { } i->iip = iip; list_add_tail(& i->list, & list); idx = & i->idx; err = ubifs_read_node((struct ubifs_info const *)c, (void *)idx, 9, len, lnum, offs); if (err != 0) { goto out_free; } else { } child_cnt = (int )idx->child_cnt; if (child_cnt <= 0 || c->fanout < child_cnt) { err = 1; goto out_dump; } else { } if (first != 0) { first = 0; if ((int )idx->level != d->old_zroot_level) { err = 2; goto out_dump; } else { } if (idx->ch.sqnum != d->old_zroot_sqnum) { err = 3; goto out_dump; } else { } last_level = (int )idx->level + 1; last_sqnum = idx->ch.sqnum + 1ULL; tmp___2 = ubifs_idx_key((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx); key_read((struct ubifs_info const *)c, (void const *)tmp___2, & lower_key); highest_ino_key((struct ubifs_info const *)c, & upper_key, 4294967040UL); } else { } key_copy((struct ubifs_info const *)c, (union ubifs_key const *)(& upper_key), & i->upper_key); if ((int )idx->level != last_level + -1) { err = 3; goto out_dump; } else { } if (idx->ch.sqnum >= last_sqnum) { err = 4; goto out_dump; } else { } tmp___3 = ubifs_idx_key((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx); key_read((struct ubifs_info const *)c, (void const *)tmp___3, & l_key); br = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, child_cnt + -1); key_read((struct ubifs_info const *)c, (void const *)(& br->key), & u_key); tmp___4 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& lower_key), (union ubifs_key const *)(& l_key)); if (tmp___4 > 0) { err = 5; goto out_dump; } else { } tmp___5 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& upper_key), (union ubifs_key const *)(& u_key)); if (tmp___5 < 0) { err = 6; goto out_dump; } else { } tmp___7 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& upper_key), (union ubifs_key const *)(& u_key)); if (tmp___7 == 0) { tmp___6 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)(& u_key)); if (tmp___6 == 0) { err = 7; goto out_dump; } else { } } else { } if ((unsigned int )idx->level == 0U) { ldv_27726: list_del(& i->list); kfree((void const *)i); tmp___8 = list_empty((struct list_head const *)(& list)); if (tmp___8 != 0) { goto out; } else { } __mptr = (struct list_head const *)list.prev; i = (struct idx_node *)__mptr; idx = & i->idx; if (iip + 1 < (int )idx->child_cnt) { iip = iip + 1; goto ldv_27725; } else { iip = i->iip; } goto ldv_27726; ldv_27725: ; } else { iip = 0; } last_level = (int )idx->level; last_sqnum = idx->ch.sqnum; br = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, iip); lnum = (int )br->lnum; offs = (int )br->offs; len = (int )br->len; key_read((struct ubifs_info const *)c, (void const *)(& br->key), & lower_key); if (iip + 1 < (int )idx->child_cnt) { br = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, iip + 1); key_read((struct ubifs_info const *)c, (void const *)(& br->key), & upper_key); } else { key_copy((struct ubifs_info const *)c, (union ubifs_key const *)(& i->upper_key), & upper_key); } goto ldv_27727; out: err = dbg_old_index_check_init(c, zroot); if (err != 0) { goto out_free; } else { } return (0); out_dump: tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: dumping index node (iip=%d)\n", tmp___9->pid, "dbg_check_old_index", i->iip); ubifs_dump_node((struct ubifs_info const *)c, (void const *)idx); list_del(& i->list); kfree((void const *)i); tmp___11 = list_empty((struct list_head const *)(& list)); if (tmp___11 == 0) { __mptr___0 = (struct list_head const *)list.prev; i = (struct idx_node *)__mptr___0; tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: dumping parent index node\n", tmp___10->pid, "dbg_check_old_index"); ubifs_dump_node((struct ubifs_info const *)c, (void const *)(& i->idx)); } else { } out_free: ; goto ldv_27734; ldv_27733: __mptr___1 = (struct list_head const *)list.next; i = (struct idx_node *)__mptr___1; list_del(& i->list); kfree((void const *)i); ldv_27734: tmp___12 = list_empty((struct list_head const *)(& list)); if (tmp___12 == 0) { goto ldv_27733; } else { } tmp___13 = get_current(); printk("\vUBIFS error (pid %d): %s: failed, error %d\n", tmp___13->pid, "dbg_check_old_index", err); if (err > 0) { err = -22; } else { } return (err); } } void ldv_mutex_lock_439(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_440(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_441(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_442(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_443(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_444(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_445(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_446(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_447(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_mst_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_448(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_mst_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void __list_splice(struct list_head const *list , struct list_head *prev , struct list_head *next ) { struct list_head *first ; struct list_head *last ; { first = list->next; last = list->prev; first->prev = prev; prev->next = first; last->next = next; next->prev = last; return; } } __inline static void list_splice_tail(struct list_head *list , struct list_head *head ) { int tmp ; { tmp = list_empty((struct list_head const *)list); if (tmp == 0) { __list_splice((struct list_head const *)list, head->prev, head); } else { } return; } } void ldv_mutex_lock_nested_463(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_467(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_470(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_460(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_462(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_464(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_466(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_468(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_469(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_471(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_459(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_461(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_465(struct mutex *ldv_func_arg1 ) ; extern int down_write_trylock(struct rw_semaphore * ) ; int ubifs_find_dirty_leb(struct ubifs_info *c , struct ubifs_lprops *ret_lp , int min_space , int pick_free ) ; int ubifs_get_idx_gc_leb(struct ubifs_info *c ) ; int ubifs_garbage_collect_leb(struct ubifs_info *c , struct ubifs_lprops *lp ) ; struct ubifs_lprops const *ubifs_fast_find_freeable(struct ubifs_info *c ) ; struct ubifs_lprops const *ubifs_fast_find_frdi_idx(struct ubifs_info *c ) ; int dbg_check_data_nodes_order(struct ubifs_info *c , struct list_head *head ) ; int dbg_check_nondata_nodes_order(struct ubifs_info *c , struct list_head *head ) ; __inline static int ubifs_wbuf_sync___1(struct ubifs_wbuf *wbuf ) { int err ; { ldv_mutex_lock_nested_463(& wbuf->io_mutex, (unsigned int )wbuf->jhead); err = ubifs_wbuf_sync_nolock(wbuf); ldv_mutex_unlock_464(& wbuf->io_mutex); return (err); } } __inline static void ubifs_get_lprops___1(struct ubifs_info *c ) { { ldv_mutex_lock_465(& c->lp_mutex); return; } } __inline static void ubifs_release_lprops___1(struct ubifs_info *c ) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 280, tmp->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect(c->lst.empty_lebs < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lst.empty_lebs > c->main_lebs, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { } } ldv_mutex_unlock_466(& c->lp_mutex); return; } } __inline static uint32_t key_hash(struct ubifs_info const *c , union ubifs_key const *key ) { { return (key->u32[1] & 536870911U); } } static int switch_gc_head(struct ubifs_info *c ) { int err ; int gc_lnum ; struct ubifs_wbuf *wbuf ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { gc_lnum = c->gc_lnum; wbuf = & (c->jheads)->wbuf; tmp___0 = ldv__builtin_expect(gc_lnum == -1, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "switch_gc_head", 205, tmp->pid); dump_stack(); } else { } descriptor.modname = "ubifs"; descriptor.function = "switch_gc_head"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): switch GC head from LEB %d:%d to LEB %d (waste %d bytes)\n"; descriptor.lineno = 208U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): switch GC head from LEB %d:%d to LEB %d (waste %d bytes)\n", tmp___1->pid, wbuf->lnum, wbuf->offs + wbuf->used, gc_lnum, (c->leb_size - wbuf->offs) - wbuf->used); } else { } err = ubifs_wbuf_sync_nolock(wbuf); if (err != 0) { return (err); } else { } err = ubifs_leb_unmap(c, gc_lnum); if (err != 0) { return (err); } else { } err = ubifs_wbuf_sync_nolock(wbuf); if (err != 0) { return (err); } else { } err = ubifs_add_bud_to_log(c, 0, gc_lnum, 0); if (err != 0) { return (err); } else { } c->gc_lnum = -1; err = ubifs_wbuf_seek_nolock(wbuf, gc_lnum, 0); return (err); } } static int data_nodes_cmp(void *priv , struct list_head *a , struct list_head *b ) { ino_t inuma ; ino_t inumb ; struct ubifs_info *c ; struct ubifs_scan_node *sa ; struct ubifs_scan_node *sb ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; unsigned int blka ; unsigned int tmp___9 ; unsigned int blkb ; unsigned int tmp___10 ; { c = (struct ubifs_info *)priv; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared", 250, 0); _cond_resched(); if ((unsigned long )a == (unsigned long )b) { return (0); } else { } __mptr = (struct list_head const *)a; sa = (struct ubifs_scan_node *)__mptr; __mptr___0 = (struct list_head const *)b; sb = (struct ubifs_scan_node *)__mptr___0; tmp___0 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); tmp___1 = ldv__builtin_expect(tmp___0 != 1, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "data_nodes_cmp", 257, tmp->pid); dump_stack(); } else { } tmp___3 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); tmp___4 = ldv__builtin_expect(tmp___3 != 1, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "data_nodes_cmp", 258, tmp___2->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect(sa->type != 1, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "data_nodes_cmp", 259, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect(sb->type != 1, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "data_nodes_cmp", 260, tmp___7->pid); dump_stack(); } else { } inuma = key_inum((struct ubifs_info const *)c, (void const *)(& sa->key)); inumb = key_inum((struct ubifs_info const *)c, (void const *)(& sb->key)); if (inuma == inumb) { tmp___9 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); blka = tmp___9; tmp___10 = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); blkb = tmp___10; if (blka <= blkb) { return (-1); } else { } } else if (inuma <= inumb) { return (-1); } else { } return (1); } } static int nondata_nodes_cmp(void *priv , struct list_head *a , struct list_head *b ) { ino_t inuma ; ino_t inumb ; struct ubifs_info *c ; struct ubifs_scan_node *sa ; struct ubifs_scan_node *sb ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; int tmp___8 ; long tmp___9 ; int tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; int tmp___13 ; long tmp___14 ; int tmp___15 ; long tmp___16 ; struct task_struct *tmp___17 ; long tmp___18 ; long tmp___19 ; struct task_struct *tmp___20 ; long tmp___21 ; long tmp___22 ; uint32_t hasha ; uint32_t tmp___23 ; uint32_t hashb ; uint32_t tmp___24 ; { c = (struct ubifs_info *)priv; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared", 294, 0); _cond_resched(); if ((unsigned long )a == (unsigned long )b) { return (0); } else { } __mptr = (struct list_head const *)a; sa = (struct ubifs_scan_node *)__mptr; __mptr___0 = (struct list_head const *)b; sb = (struct ubifs_scan_node *)__mptr___0; tmp___0 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); tmp___1 = ldv__builtin_expect(tmp___0 == 1, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 302, tmp->pid); dump_stack(); } else { tmp___2 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); tmp___3 = ldv__builtin_expect(tmp___2 == 1, 0L); if (tmp___3 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 302, tmp->pid); dump_stack(); } else { } } tmp___5 = ldv__builtin_expect(sa->type == 1, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 304, tmp___4->pid); dump_stack(); } else { tmp___6 = ldv__builtin_expect(sb->type == 1, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 304, tmp___4->pid); dump_stack(); } else { } } if (sa->type == 0) { if (sb->type == 0) { return (sb->len - sa->len); } else { } return (-1); } else { } if (sb->type == 0) { return (1); } else { } tmp___8 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); tmp___9 = ldv__builtin_expect(tmp___8 != 2, 0L); if (tmp___9 != 0L) { tmp___10 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); tmp___11 = ldv__builtin_expect(tmp___10 != 3, 0L); if (tmp___11 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 316, tmp___7->pid); dump_stack(); } else { } } else { } tmp___13 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); tmp___14 = ldv__builtin_expect(tmp___13 != 2, 0L); if (tmp___14 != 0L) { tmp___15 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); tmp___16 = ldv__builtin_expect(tmp___15 != 3, 0L); if (tmp___16 != 0L) { tmp___12 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 318, tmp___12->pid); dump_stack(); } else { } } else { } tmp___18 = ldv__builtin_expect(sa->type != 2, 0L); if (tmp___18 != 0L) { tmp___19 = ldv__builtin_expect(sa->type != 3, 0L); if (tmp___19 != 0L) { tmp___17 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 320, tmp___17->pid); dump_stack(); } else { } } else { } tmp___21 = ldv__builtin_expect(sb->type != 2, 0L); if (tmp___21 != 0L) { tmp___22 = ldv__builtin_expect(sb->type != 3, 0L); if (tmp___22 != 0L) { tmp___20 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "nondata_nodes_cmp", 322, tmp___20->pid); dump_stack(); } else { } } else { } inuma = key_inum((struct ubifs_info const *)c, (void const *)(& sa->key)); inumb = key_inum((struct ubifs_info const *)c, (void const *)(& sb->key)); if (inuma == inumb) { tmp___23 = key_hash((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); hasha = tmp___23; tmp___24 = key_hash((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); hashb = tmp___24; if (hasha <= hashb) { return (-1); } else { } } else if (inuma <= inumb) { return (-1); } else { } return (1); } } static int sort_nodes(struct ubifs_info *c , struct ubifs_scan_leb *sleb , struct list_head *nondata , int *min ) { int err ; struct ubifs_scan_node *snod ; struct ubifs_scan_node *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; int tmp___3 ; long tmp___4 ; int tmp___5 ; long tmp___6 ; int tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; int tmp___10 ; long tmp___11 ; int tmp___12 ; long tmp___13 ; int tmp___14 ; int tmp___15 ; long tmp___16 ; int tmp___17 ; int tmp___18 ; long tmp___19 ; int tmp___20 ; struct list_head const *__mptr___1 ; { *min = 2147483647; __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; __mptr___0 = (struct list_head const *)snod->list.next; tmp = (struct ubifs_scan_node *)__mptr___0; goto ldv_27579; ldv_27578: tmp___1 = ldv__builtin_expect(snod->type != 0, 0L); if (tmp___1 != 0L) { tmp___2 = ldv__builtin_expect(snod->type != 1, 0L); if (tmp___2 != 0L) { tmp___3 = 1; } else { tmp___3 = 0; } } else { tmp___3 = 0; } if (tmp___3 != 0) { tmp___4 = ldv__builtin_expect(snod->type != 2, 0L); if (tmp___4 != 0L) { tmp___5 = 1; } else { tmp___5 = 0; } } else { tmp___5 = 0; } if (tmp___5 != 0) { tmp___6 = ldv__builtin_expect(snod->type != 3, 0L); if (tmp___6 != 0L) { tmp___7 = 1; } else { tmp___7 = 0; } } else { tmp___7 = 0; } if (tmp___7 != 0) { tmp___8 = ldv__builtin_expect(snod->type != 4, 0L); if (tmp___8 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "sort_nodes", 380, tmp___0->pid); dump_stack(); } else { } } else { } if (((snod->type != 0 && snod->type != 1) && snod->type != 2) && snod->type != 3) { list_del(& snod->list); kfree((void const *)snod); goto ldv_27577; } else { } tmp___10 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); tmp___11 = ldv__builtin_expect(tmp___10 != 1, 0L); if (tmp___11 != 0L) { tmp___12 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); tmp___13 = ldv__builtin_expect(tmp___12 != 0, 0L); if (tmp___13 != 0L) { tmp___14 = 1; } else { tmp___14 = 0; } } else { tmp___14 = 0; } if (tmp___14 != 0) { tmp___15 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); tmp___16 = ldv__builtin_expect(tmp___15 != 2, 0L); if (tmp___16 != 0L) { tmp___17 = 1; } else { tmp___17 = 0; } } else { tmp___17 = 0; } if (tmp___17 != 0) { tmp___18 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); tmp___19 = ldv__builtin_expect(tmp___18 != 3, 0L); if (tmp___19 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "sort_nodes", 395, tmp___9->pid); dump_stack(); } else { } } else { } err = ubifs_tnc_has_node(c, & snod->key, 0, sleb->lnum, snod->offs, 0); if (err < 0) { return (err); } else { } if (err == 0) { list_del(& snod->list); kfree((void const *)snod); goto ldv_27577; } else { } if (snod->len < *min) { *min = snod->len; } else { } tmp___20 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); if (tmp___20 != 1) { list_move_tail(& snod->list, nondata); } else { } ldv_27577: snod = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct ubifs_scan_node *)__mptr___1; ldv_27579: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27578; } else { } list_sort((void *)c, & sleb->nodes, & data_nodes_cmp); list_sort((void *)c, nondata, & nondata_nodes_cmp); err = dbg_check_data_nodes_order(c, & sleb->nodes); if (err != 0) { return (err); } else { } err = dbg_check_nondata_nodes_order(c, nondata); if (err != 0) { return (err); } else { } return (0); } } static int move_node(struct ubifs_info *c , struct ubifs_scan_leb *sleb , struct ubifs_scan_node *snod , struct ubifs_wbuf *wbuf ) { int err ; int new_lnum ; int new_offs ; { new_lnum = wbuf->lnum; new_offs = wbuf->offs + wbuf->used; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared", 445, 0); _cond_resched(); err = ubifs_wbuf_write_nolock(wbuf, snod->node, snod->len); if (err != 0) { return (err); } else { } err = ubifs_tnc_replace(c, (union ubifs_key const *)(& snod->key), sleb->lnum, snod->offs, new_lnum, new_offs, snod->len); list_del(& snod->list); kfree((void const *)snod); return (err); } } static int move_nodes(struct ubifs_info *c , struct ubifs_scan_leb *sleb ) { int err ; int min ; struct list_head nondata ; struct ubifs_wbuf *wbuf ; int avail ; struct ubifs_scan_node *snod ; struct ubifs_scan_node *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; int tmp___0 ; struct list_head const *__mptr___4 ; int tmp___1 ; int tmp___2 ; { nondata.next = & nondata; nondata.prev = & nondata; wbuf = & (c->jheads)->wbuf; if (wbuf->lnum == -1) { err = switch_gc_head(c); if (err != 0) { return (err); } else { } } else { } err = sort_nodes(c, sleb, & nondata, & min); if (err != 0) { goto out; } else { } ldv_27623: __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; __mptr___0 = (struct list_head const *)snod->list.next; tmp = (struct ubifs_scan_node *)__mptr___0; goto ldv_27611; ldv_27610: avail = (c->leb_size - wbuf->offs) - wbuf->used; if (snod->len > avail) { goto ldv_27609; } else { } err = move_node(c, sleb, snod, wbuf); if (err != 0) { goto out; } else { } snod = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct ubifs_scan_node *)__mptr___1; ldv_27611: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27610; } else { } ldv_27609: __mptr___2 = (struct list_head const *)nondata.next; snod = (struct ubifs_scan_node *)__mptr___2; __mptr___3 = (struct list_head const *)snod->list.next; tmp = (struct ubifs_scan_node *)__mptr___3; goto ldv_27621; ldv_27620: avail = (c->leb_size - wbuf->offs) - wbuf->used; if (avail < min) { goto ldv_27618; } else { } if (snod->len > avail) { tmp___0 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& snod->key)); if (tmp___0 == 2 || snod->len == 160) { goto ldv_27618; } else { } goto ldv_27619; } else { } err = move_node(c, sleb, snod, wbuf); if (err != 0) { goto out; } else { } ldv_27619: snod = tmp; __mptr___4 = (struct list_head const *)tmp->list.next; tmp = (struct ubifs_scan_node *)__mptr___4; ldv_27621: ; if ((unsigned long )(& snod->list) != (unsigned long )(& nondata)) { goto ldv_27620; } else { } ldv_27618: tmp___1 = list_empty((struct list_head const *)(& sleb->nodes)); if (tmp___1 != 0) { tmp___2 = list_empty((struct list_head const *)(& nondata)); if (tmp___2 != 0) { goto ldv_27622; } else { } } else { } err = switch_gc_head(c); if (err != 0) { goto out; } else { } goto ldv_27623; ldv_27622: ; return (0); out: list_splice_tail(& nondata, & sleb->nodes); return (err); } } static int gc_sync_wbufs(struct ubifs_info *c ) { int err ; int i ; { i = 0; goto ldv_27631; ldv_27630: ; if (i == 0) { goto ldv_27629; } else { } err = ubifs_wbuf_sync___1(& (c->jheads + (unsigned long )i)->wbuf); if (err != 0) { return (err); } else { } ldv_27629: i = i + 1; ldv_27631: ; if (c->jhead_cnt > i) { goto ldv_27630; } else { } return (0); } } int ubifs_garbage_collect_leb(struct ubifs_info *c , struct ubifs_lprops *lp ) { struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; struct ubifs_wbuf *wbuf ; int err ; int lnum ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct _ddebug descriptor ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; struct task_struct *tmp___14 ; int tmp___15 ; long tmp___16 ; struct list_head const *__mptr ; struct ubifs_gced_idx_leb *idx_gc ; struct _ddebug descriptor___0 ; struct task_struct *tmp___17 ; long tmp___18 ; struct list_head const *__mptr___0 ; struct ubifs_idx_node *idx ; int level ; struct task_struct *tmp___19 ; long tmp___20 ; void *tmp___21 ; struct list_head const *__mptr___1 ; void *tmp___22 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___23 ; long tmp___24 ; { wbuf = & (c->jheads)->wbuf; err = 0; lnum = lp->lnum; tmp___0 = ldv__builtin_expect(c->gc_lnum == -1, 0L); if (tmp___0 != 0L) { tmp___1 = ldv__builtin_expect(wbuf->offs + wbuf->used != 0, 0L); if (tmp___1 != 0L) { tmp___2 = 1; } else { tmp___2 = 0; } } else { tmp___2 = 0; } if (tmp___2 != 0) { tmp___3 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 5528UL) == 0U, 0L); if (tmp___3 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect_leb", 596, tmp->pid); dump_stack(); } else { } } else { } tmp___5 = ldv__builtin_expect(c->gc_lnum == lnum, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect_leb", 597, tmp___4->pid); dump_stack(); } else { } tmp___7 = ldv__builtin_expect(wbuf->lnum == lnum, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect_leb", 598, tmp___6->pid); dump_stack(); } else { } if (lp->free + lp->dirty == c->leb_size) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_garbage_collect_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): LEB %d is free, return it\n"; descriptor.lineno = 602U; descriptor.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): LEB %d is free, return it\n", tmp___8->pid, lp->lnum); } else { } tmp___11 = ldv__builtin_expect((lp->flags & 32) != 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect_leb", 603, tmp___10->pid); dump_stack(); } else { } if (lp->free != c->leb_size) { err = gc_sync_wbufs(c); if (err != 0) { return (err); } else { } err = ubifs_change_one_lp(c, lp->lnum, c->leb_size, 0, 0, 0, 0); if (err != 0) { return (err); } else { } } else { } err = ubifs_leb_unmap(c, lp->lnum); if (err != 0) { return (err); } else { } if (c->gc_lnum == -1) { c->gc_lnum = lnum; return (2); } else { } return (0); } else { } sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, c->sbuf, 0); tmp___13 = IS_ERR((void const *)sleb); if (tmp___13 != 0L) { tmp___12 = PTR_ERR((void const *)sleb); return ((int )tmp___12); } else { } tmp___15 = list_empty((struct list_head const *)(& sleb->nodes)); tmp___16 = ldv__builtin_expect(tmp___15 != 0, 0L); if (tmp___16 != 0L) { tmp___14 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect_leb", 639, tmp___14->pid); dump_stack(); } else { } __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; if (snod->type == 9) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_garbage_collect_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___0.format = "UBIFS DBG gc (pid %d): indexing LEB %d (free %d, dirty %d)\n"; descriptor___0.lineno = 646U; descriptor___0.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gc (pid %d): indexing LEB %d (free %d, dirty %d)\n", tmp___17->pid, lnum, lp->free, lp->dirty); } else { } __mptr___0 = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr___0; goto ldv_27656; ldv_27655: idx = (struct ubifs_idx_node *)snod->node; level = (int )idx->level; tmp___20 = ldv__builtin_expect(snod->type != 9, 0L); if (tmp___20 != 0L) { tmp___19 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect_leb", 651, tmp___19->pid); dump_stack(); } else { } tmp___21 = ubifs_idx_key((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx); key_read((struct ubifs_info const *)c, (void const *)tmp___21, & snod->key); err = ubifs_dirty_idx_node(c, & snod->key, level, lnum, snod->offs); if (err != 0) { goto out; } else { } __mptr___1 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___1; ldv_27656: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27655; } else { } tmp___22 = kmalloc(24UL, 80U); idx_gc = (struct ubifs_gced_idx_leb *)tmp___22; if ((unsigned long )idx_gc == (unsigned long )((struct ubifs_gced_idx_leb *)0)) { err = -12; goto out; } else { } idx_gc->lnum = lnum; idx_gc->unmap = 0; list_add(& idx_gc->list, & c->idx_gc); err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, 32, 1); if (err != 0) { goto out; } else { } err = 1; } else { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_garbage_collect_leb"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___1.format = "UBIFS DBG gc (pid %d): data LEB %d (free %d, dirty %d)\n"; descriptor___1.lineno = 682U; descriptor___1.flags = 0U; tmp___24 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___24 != 0L) { tmp___23 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gc (pid %d): data LEB %d (free %d, dirty %d)\n", tmp___23->pid, lnum, lp->free, lp->dirty); } else { } err = move_nodes(c, sleb); if (err != 0) { goto out_inc_seq; } else { } err = gc_sync_wbufs(c); if (err != 0) { goto out_inc_seq; } else { } err = ubifs_change_one_lp(c, lnum, c->leb_size, 0, 0, 0, 0); if (err != 0) { goto out_inc_seq; } else { } c->gced_lnum = lnum; __asm__ volatile ("": : : "memory"); c->gc_seq = c->gc_seq + 1; __asm__ volatile ("": : : "memory"); if (c->gc_lnum == -1) { c->gc_lnum = lnum; err = 2; } else { err = ubifs_wbuf_sync_nolock(wbuf); if (err != 0) { goto out; } else { } err = ubifs_leb_unmap(c, lnum); if (err != 0) { goto out; } else { } err = 0; } } out: ubifs_scan_destroy(sleb); return (err); out_inc_seq: c->gced_lnum = lnum; __asm__ volatile ("": : : "memory"); c->gc_seq = c->gc_seq + 1; __asm__ volatile ("": : : "memory"); goto out; } } int ubifs_garbage_collect(struct ubifs_info *c , int anyway ) { int i ; int err ; int ret ; int min_space ; struct ubifs_lprops lp ; struct ubifs_wbuf *wbuf ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; int tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; int space_before ; int space_after ; int tmp___8 ; struct _ddebug descriptor ; struct task_struct *tmp___9 ; long tmp___10 ; int tmp___11 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___12 ; long tmp___13 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___14 ; long tmp___15 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___16 ; long tmp___17 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___18 ; long tmp___19 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___20 ; long tmp___21 ; struct task_struct *tmp___22 ; long tmp___23 ; struct _ddebug descriptor___5 ; struct task_struct *tmp___24 ; long tmp___25 ; struct _ddebug descriptor___6 ; struct task_struct *tmp___26 ; long tmp___27 ; struct _ddebug descriptor___7 ; struct task_struct *tmp___28 ; long tmp___29 ; struct _ddebug descriptor___8 ; struct task_struct *tmp___30 ; long tmp___31 ; struct _ddebug descriptor___9 ; struct task_struct *tmp___32 ; long tmp___33 ; int tmp___34 ; struct task_struct *tmp___35 ; long tmp___36 ; struct task_struct *tmp___37 ; long tmp___38 ; long tmp___39 ; { min_space = c->dead_wm; wbuf = & (c->jheads)->wbuf; tmp___0 = down_write_trylock(& c->commit_sem); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { up_write(& c->commit_sem); printk("\ncommit lock is not locked!\n"); tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 773, tmp->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect((long )*((unsigned char *)c + 4080UL) & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 774, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 774, tmp___2->pid); dump_stack(); } else { } } tmp___5 = ubifs_gc_should_commit(c); if (tmp___5 != 0) { return (-11); } else { } ldv_mutex_lock_nested_467(& wbuf->io_mutex, (unsigned int )wbuf->jhead); if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { ret = -30; goto out_unlock; } else { } tmp___7 = ldv__builtin_expect(wbuf->used != 0, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 787, tmp___6->pid); dump_stack(); } else { } i = 0; ldv_27688: space_before = (c->leb_size - wbuf->offs) - wbuf->used; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared", 793, 0); _cond_resched(); tmp___8 = ubifs_gc_should_commit(c); if (tmp___8 != 0) { ret = -11; goto ldv_27675; } else { } if (i > 4) { tmp___11 = list_empty((struct list_head const *)(& c->idx_gc)); if (tmp___11 == 0) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_garbage_collect"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): soft limit, some index LEBs GC\'ed, -EAGAIN\n"; descriptor.lineno = 806U; descriptor.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): soft limit, some index LEBs GC\'ed, -EAGAIN\n", tmp___9->pid); } else { } ubifs_commit_required(c); ret = -11; goto ldv_27675; } else { } } else { } if (i > 32) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_garbage_collect"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___0.format = "UBIFS DBG gc (pid %d): hard limit, -ENOSPC\n"; descriptor___0.lineno = 817U; descriptor___0.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gc (pid %d): hard limit, -ENOSPC\n", tmp___12->pid); } else { } ret = -28; goto ldv_27675; } else { } ret = ubifs_find_dirty_leb(c, & lp, min_space, anyway == 0); if (ret != 0) { if (ret == -28) { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_garbage_collect"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___1.format = "UBIFS DBG gc (pid %d): no more dirty LEBs\n"; descriptor___1.lineno = 832U; descriptor___1.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gc (pid %d): no more dirty LEBs\n", tmp___14->pid); } else { } } else { } goto ldv_27675; } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_garbage_collect"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___2.format = "UBIFS DBG gc (pid %d): found LEB %d: free %d, dirty %d, sum %d (min. space %d)\n"; descriptor___2.lineno = 838U; descriptor___2.flags = 0U; tmp___17 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG gc (pid %d): found LEB %d: free %d, dirty %d, sum %d (min. space %d)\n", tmp___16->pid, lp.lnum, lp.free, lp.dirty, lp.free + lp.dirty, min_space); } else { } space_before = (c->leb_size - wbuf->offs) - wbuf->used; if (wbuf->lnum == -1) { space_before = 0; } else { } ret = ubifs_garbage_collect_leb(c, & lp); if (ret < 0) { if (ret == -11) { err = ubifs_return_leb(c, lp.lnum); if (err != 0) { ret = err; } else { } goto ldv_27675; } else { } goto out; } else { } if (ret == 0) { descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_garbage_collect"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___3.format = "UBIFS DBG gc (pid %d): LEB %d freed, return\n"; descriptor___3.lineno = 863U; descriptor___3.flags = 0U; tmp___19 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___19 != 0L) { tmp___18 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG gc (pid %d): LEB %d freed, return\n", tmp___18->pid, lp.lnum); } else { } ret = lp.lnum; goto ldv_27675; } else { } if (ret == 1) { descriptor___4.modname = "ubifs"; descriptor___4.function = "ubifs_garbage_collect"; descriptor___4.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___4.format = "UBIFS DBG gc (pid %d): indexing LEB %d freed, continue\n"; descriptor___4.lineno = 875U; descriptor___4.flags = 0U; tmp___21 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___21 != 0L) { tmp___20 = get_current(); __dynamic_pr_debug(& descriptor___4, "UBIFS DBG gc (pid %d): indexing LEB %d freed, continue\n", tmp___20->pid, lp.lnum); } else { } goto ldv_27683; } else { } tmp___23 = ldv__builtin_expect(ret != 2, 0L); if (tmp___23 != 0L) { tmp___22 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 879, tmp___22->pid); dump_stack(); } else { } space_after = (c->leb_size - wbuf->offs) - wbuf->used; descriptor___5.modname = "ubifs"; descriptor___5.function = "ubifs_garbage_collect"; descriptor___5.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___5.format = "UBIFS DBG gc (pid %d): LEB %d retained, freed %d bytes\n"; descriptor___5.lineno = 882U; descriptor___5.flags = 0U; tmp___25 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); if (tmp___25 != 0L) { tmp___24 = get_current(); __dynamic_pr_debug(& descriptor___5, "UBIFS DBG gc (pid %d): LEB %d retained, freed %d bytes\n", tmp___24->pid, lp.lnum, space_after - space_before); } else { } if (space_after > space_before) { min_space = min_space >> 1; if (c->dead_wm > min_space) { min_space = c->dead_wm; } else { } goto ldv_27683; } else { } descriptor___6.modname = "ubifs"; descriptor___6.function = "ubifs_garbage_collect"; descriptor___6.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___6.format = "UBIFS DBG gc (pid %d): did not make progress\n"; descriptor___6.lineno = 892U; descriptor___6.flags = 0U; tmp___27 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); __dynamic_pr_debug(& descriptor___6, "UBIFS DBG gc (pid %d): did not make progress\n", tmp___26->pid); } else { } if (i <= 3) { descriptor___7.modname = "ubifs"; descriptor___7.function = "ubifs_garbage_collect"; descriptor___7.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___7.format = "UBIFS DBG gc (pid %d): try again\n"; descriptor___7.lineno = 911U; descriptor___7.flags = 0U; tmp___29 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); if (tmp___29 != 0L) { tmp___28 = get_current(); __dynamic_pr_debug(& descriptor___7, "UBIFS DBG gc (pid %d): try again\n", tmp___28->pid); } else { } goto ldv_27683; } else { } min_space = min_space << 1; if (c->dark_wm < min_space) { min_space = c->dark_wm; } else { } descriptor___8.modname = "ubifs"; descriptor___8.function = "ubifs_garbage_collect"; descriptor___8.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___8.format = "UBIFS DBG gc (pid %d): set min. space to %d\n"; descriptor___8.lineno = 918U; descriptor___8.flags = 0U; tmp___31 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); if (tmp___31 != 0L) { tmp___30 = get_current(); __dynamic_pr_debug(& descriptor___8, "UBIFS DBG gc (pid %d): set min. space to %d\n", tmp___30->pid, min_space); } else { } ldv_27683: i = i + 1; goto ldv_27688; ldv_27675: ; if (ret == -28) { tmp___34 = list_empty((struct list_head const *)(& c->idx_gc)); if (tmp___34 == 0) { descriptor___9.modname = "ubifs"; descriptor___9.function = "ubifs_garbage_collect"; descriptor___9.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor___9.format = "UBIFS DBG gc (pid %d): no space, some index LEBs GC\'ed, -EAGAIN\n"; descriptor___9.lineno = 922U; descriptor___9.flags = 0U; tmp___33 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); if (tmp___33 != 0L) { tmp___32 = get_current(); __dynamic_pr_debug(& descriptor___9, "UBIFS DBG gc (pid %d): no space, some index LEBs GC\'ed, -EAGAIN\n", tmp___32->pid); } else { } ubifs_commit_required(c); ret = -11; } else { } } else { } err = ubifs_wbuf_sync_nolock(wbuf); if (err == 0) { err = ubifs_leb_unmap(c, c->gc_lnum); } else { } if (err != 0) { ret = err; goto out; } else { } out_unlock: ldv_mutex_unlock_468(& wbuf->io_mutex); return (ret); out: tmp___36 = ldv__builtin_expect(ret >= 0, 0L); if (tmp___36 != 0L) { tmp___35 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 939, tmp___35->pid); dump_stack(); } else { } tmp___38 = ldv__builtin_expect(ret == -28, 0L); if (tmp___38 != 0L) { tmp___37 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 940, tmp___37->pid); dump_stack(); } else { tmp___39 = ldv__builtin_expect(ret == -11, 0L); if (tmp___39 != 0L) { tmp___37 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_garbage_collect", 940, tmp___37->pid); dump_stack(); } else { } } ubifs_wbuf_sync_nolock(wbuf); ubifs_ro_mode(c, ret); ldv_mutex_unlock_469(& wbuf->io_mutex); ubifs_return_leb(c, lp.lnum); return (ret); } } int ubifs_gc_start_commit(struct ubifs_info *c ) { struct ubifs_gced_idx_leb *idx_gc ; struct ubifs_lprops const *lp ; int err ; int flags ; long tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; long tmp___11 ; long tmp___12 ; void *tmp___13 ; struct task_struct *tmp___14 ; long tmp___15 ; struct task_struct *tmp___16 ; long tmp___17 ; long tmp___18 ; long tmp___19 ; struct task_struct *tmp___20 ; long tmp___21 ; struct task_struct *tmp___22 ; long tmp___23 ; { err = 0; ubifs_get_lprops___1(c); ldv_27700: lp = ubifs_fast_find_freeable(c); tmp___0 = IS_ERR((void const *)lp); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)lp); err = (int )tmp; goto out; } else { } if ((unsigned long )lp == (unsigned long )((struct ubifs_lprops const *)0)) { goto ldv_27698; } else { } tmp___2 = ldv__builtin_expect(((int )lp->flags & 16) != 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 979, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(((int )lp->flags & 32) != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 980, tmp___3->pid); dump_stack(); } else { } err = ubifs_leb_unmap(c, lp->lnum); if (err != 0) { goto out; } else { } lp = ubifs_change_lp(c, lp, c->leb_size, 0, lp->flags, 0); tmp___6 = IS_ERR((void const *)lp); if (tmp___6 != 0L) { tmp___5 = PTR_ERR((void const *)lp); err = (int )tmp___5; goto out; } else { } tmp___8 = ldv__builtin_expect(((int )lp->flags & 16) != 0, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 989, tmp___7->pid); dump_stack(); } else { } tmp___10 = ldv__builtin_expect(((int )lp->flags & 32) != 0, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 990, tmp___9->pid); dump_stack(); } else { } goto ldv_27700; ldv_27698: __mptr = (struct list_head const *)c->idx_gc.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr; goto ldv_27706; ldv_27705: idx_gc->unmap = 1; __mptr___0 = (struct list_head const *)idx_gc->list.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr___0; ldv_27706: ; if ((unsigned long )(& idx_gc->list) != (unsigned long )(& c->idx_gc)) { goto ldv_27705; } else { } ldv_27709: lp = ubifs_fast_find_frdi_idx(c); tmp___12 = IS_ERR((void const *)lp); if (tmp___12 != 0L) { tmp___11 = PTR_ERR((void const *)lp); err = (int )tmp___11; goto out; } else { } if ((unsigned long )lp == (unsigned long )((struct ubifs_lprops const *)0)) { goto ldv_27708; } else { } tmp___13 = kmalloc(24UL, 80U); idx_gc = (struct ubifs_gced_idx_leb *)tmp___13; if ((unsigned long )idx_gc == (unsigned long )((struct ubifs_gced_idx_leb *)0)) { err = -12; goto out; } else { } tmp___15 = ldv__builtin_expect(((int )lp->flags & 16) != 0, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 1011, tmp___14->pid); dump_stack(); } else { } tmp___17 = ldv__builtin_expect(((int )lp->flags & 32) == 0, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 1012, tmp___16->pid); dump_stack(); } else { } flags = ((int )lp->flags | 16) ^ 32; lp = ubifs_change_lp(c, lp, c->leb_size, 0, flags, 1); tmp___19 = IS_ERR((void const *)lp); if (tmp___19 != 0L) { tmp___18 = PTR_ERR((void const *)lp); err = (int )tmp___18; kfree((void const *)idx_gc); goto out; } else { } tmp___21 = ldv__builtin_expect(((int )lp->flags & 16) == 0, 0L); if (tmp___21 != 0L) { tmp___20 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 1021, tmp___20->pid); dump_stack(); } else { } tmp___23 = ldv__builtin_expect(((int )lp->flags & 32) != 0, 0L); if (tmp___23 != 0L) { tmp___22 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_gc_start_commit", 1022, tmp___22->pid); dump_stack(); } else { } idx_gc->lnum = lp->lnum; idx_gc->unmap = 1; list_add(& idx_gc->list, & c->idx_gc); goto ldv_27709; ldv_27708: ; out: ubifs_release_lprops___1(c); return (err); } } int ubifs_gc_end_commit(struct ubifs_info *c ) { struct ubifs_gced_idx_leb *idx_gc ; struct ubifs_gced_idx_leb *tmp ; struct ubifs_wbuf *wbuf ; int err ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct list_head const *__mptr___1 ; { err = 0; wbuf = & (c->jheads)->wbuf; ldv_mutex_lock_nested_470(& wbuf->io_mutex, (unsigned int )wbuf->jhead); __mptr = (struct list_head const *)c->idx_gc.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr; __mptr___0 = (struct list_head const *)idx_gc->list.next; tmp = (struct ubifs_gced_idx_leb *)__mptr___0; goto ldv_27727; ldv_27726: ; if (idx_gc->unmap != 0) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_gc_end_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/gc.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): LEB %d\n"; descriptor.lineno = 1048U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): LEB %d\n", tmp___0->pid, idx_gc->lnum); } else { } err = ubifs_leb_unmap(c, idx_gc->lnum); if (err != 0) { goto out; } else { } err = ubifs_change_one_lp(c, idx_gc->lnum, -2147483647, -2147483647, 0, 16, -1); if (err != 0) { goto out; } else { } list_del(& idx_gc->list); kfree((void const *)idx_gc); } else { } idx_gc = tmp; __mptr___1 = (struct list_head const *)tmp->list.next; tmp = (struct ubifs_gced_idx_leb *)__mptr___1; ldv_27727: ; if ((unsigned long )(& idx_gc->list) != (unsigned long )(& c->idx_gc)) { goto ldv_27726; } else { } out: ldv_mutex_unlock_471(& wbuf->io_mutex); return (err); } } void ubifs_destroy_idx_gc(struct ubifs_info *c ) { struct ubifs_gced_idx_leb *idx_gc ; struct list_head const *__mptr ; int tmp ; { goto ldv_27736; ldv_27735: __mptr = (struct list_head const *)c->idx_gc.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr; c->idx_gc_cnt = c->idx_gc_cnt + -1; list_del(& idx_gc->list); kfree((void const *)idx_gc); ldv_27736: tmp = list_empty((struct list_head const *)(& c->idx_gc)); if (tmp == 0) { goto ldv_27735; } else { } return; } } int ubifs_get_idx_gc_leb(struct ubifs_info *c ) { struct ubifs_gced_idx_leb *idx_gc ; int lnum ; int tmp ; struct list_head const *__mptr ; { tmp = list_empty((struct list_head const *)(& c->idx_gc)); if (tmp != 0) { return (-28); } else { } __mptr = (struct list_head const *)c->idx_gc.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr; lnum = idx_gc->lnum; list_del(& idx_gc->list); kfree((void const *)idx_gc); return (lnum); } } void ldv_mutex_lock_459(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_460(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_461(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_462(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_463(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_464(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_465(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_466(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_467(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_468(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_469(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_470(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_471(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_489(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_486(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_488(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_490(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_492(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_485(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_487(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_491(struct mutex *ldv_func_arg1 ) ; extern void *__vmalloc(unsigned long , gfp_t , pgprot_t ) ; int dbg_walk_index(struct ubifs_info *c , int (*leaf_cb)(struct ubifs_info * , struct ubifs_zbranch * , void * ) , int (*znode_cb)(struct ubifs_info * , struct ubifs_znode * , void * ) , void *priv ) ; static int dbg_check_orphans(struct ubifs_info *c ) ; int ubifs_add_orphan(struct ubifs_info *c , ino_t inum ) { struct ubifs_orphan *orphan ; struct ubifs_orphan *o ; struct rb_node **p ; struct rb_node *parent ; void *tmp ; struct rb_node const *__mptr ; struct task_struct *tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { parent = 0; tmp = kzalloc(88UL, 80U); orphan = (struct ubifs_orphan *)tmp; if ((unsigned long )orphan == (unsigned long )((struct ubifs_orphan *)0)) { return (-12); } else { } orphan->inum = inum; orphan->new = 1; spin_lock(& c->orphan_lock); if (c->tot_orphans >= c->max_orphans) { spin_unlock(& c->orphan_lock); kfree((void const *)orphan); return (-23); } else { } p = & c->orph_tree.rb_node; goto ldv_27500; ldv_27499: parent = *p; __mptr = (struct rb_node const *)parent; o = (struct ubifs_orphan *)__mptr; if (o->inum > inum) { p = & (*p)->rb_left; } else if (o->inum < inum) { p = & (*p)->rb_right; } else { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: orphaned twice\n", tmp___0->pid, "ubifs_add_orphan"); spin_unlock(& c->orphan_lock); kfree((void const *)orphan); return (0); } ldv_27500: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27499; } else { } c->tot_orphans = c->tot_orphans + 1; c->new_orphans = c->new_orphans + 1; rb_link_node(& orphan->rb, parent, p); rb_insert_color(& orphan->rb, & c->orph_tree); list_add_tail(& orphan->list, & c->orph_list); list_add_tail(& orphan->new_list, & c->orph_new); spin_unlock(& c->orphan_lock); descriptor.modname = "ubifs"; descriptor.function = "ubifs_add_orphan"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu\n"; descriptor.lineno = 223U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu\n", tmp___1->pid, inum); } else { } return (0); } } void ubifs_delete_orphan(struct ubifs_info *c , ino_t inum ) { struct ubifs_orphan *o ; struct rb_node *p ; struct rb_node const *__mptr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; { spin_lock(& c->orphan_lock); p = c->orph_tree.rb_node; goto ldv_27516; ldv_27515: __mptr = (struct rb_node const *)p; o = (struct ubifs_orphan *)__mptr; if (o->inum > inum) { p = p->rb_left; } else if (o->inum < inum) { p = p->rb_right; } else { if ((unsigned long )o->dnext != (unsigned long )((struct ubifs_orphan *)0)) { spin_unlock(& c->orphan_lock); descriptor.modname = "ubifs"; descriptor.function = "ubifs_delete_orphan"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): deleted twice ino %lu\n"; descriptor.lineno = 251U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): deleted twice ino %lu\n", tmp->pid, inum); } else { } return; } else { } if ((unsigned long )o->cnext != (unsigned long )((struct ubifs_orphan *)0)) { o->dnext = c->orph_dnext; c->orph_dnext = o; spin_unlock(& c->orphan_lock); descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_delete_orphan"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): delete later ino %lu\n"; descriptor___0.lineno = 259U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): delete later ino %lu\n", tmp___1->pid, inum); } else { } return; } else { } rb_erase(p, & c->orph_tree); list_del(& o->list); c->tot_orphans = c->tot_orphans + -1; if (o->new != 0) { list_del(& o->new_list); c->new_orphans = c->new_orphans + -1; } else { } spin_unlock(& c->orphan_lock); kfree((void const *)o); descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_delete_orphan"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___1.format = "UBIFS DBG gen (pid %d): inum %lu\n"; descriptor___1.lineno = 271U; descriptor___1.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gen (pid %d): inum %lu\n", tmp___3->pid, inum); } else { } return; } ldv_27516: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27515; } else { } spin_unlock(& c->orphan_lock); tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: missing orphan ino %lu\n", tmp___5->pid, "ubifs_delete_orphan", inum); dump_stack(); return; } } int ubifs_orphan_start_commit(struct ubifs_info *c ) { struct ubifs_orphan *orphan ; struct ubifs_orphan **last ; struct list_head const *__mptr ; struct task_struct *tmp ; long tmp___0 ; struct list_head const *__mptr___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { spin_lock(& c->orphan_lock); last = & c->orph_cnext; __mptr = (struct list_head const *)c->orph_new.next; orphan = (struct ubifs_orphan *)__mptr + 0xffffffffffffffd8UL; goto ldv_27529; ldv_27528: tmp___0 = ldv__builtin_expect(orphan->new == 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_orphan_start_commit", 293, tmp->pid); dump_stack(); } else { } orphan->new = 0; *last = orphan; last = & orphan->cnext; __mptr___0 = (struct list_head const *)orphan->new_list.next; orphan = (struct ubifs_orphan *)__mptr___0 + 0xffffffffffffffd8UL; ldv_27529: ; if ((unsigned long )(& orphan->new_list) != (unsigned long )(& c->orph_new)) { goto ldv_27528; } else { } *last = 0; c->cmt_orphans = c->new_orphans; c->new_orphans = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_orphan_start_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): %d orphans to commit\n"; descriptor.lineno = 301U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): %d orphans to commit\n", tmp___1->pid, c->cmt_orphans); } else { } INIT_LIST_HEAD(& c->orph_new); if (c->tot_orphans == 0) { c->no_orphs = 1; } else { c->no_orphs = 0; } spin_unlock(& c->orphan_lock); return (0); } } static int avail_orphs(struct ubifs_info *c ) { int avail_lebs ; int avail ; int gap ; { avail_lebs = (c->orph_lebs + (c->orph_first - c->ohead_lnum)) + -1; avail = (int )((unsigned int )((unsigned long )avail_lebs) * (unsigned int )(((unsigned long )c->leb_size - 32UL) / 8UL)); gap = c->leb_size - c->ohead_offs; if ((unsigned int )gap > 39U) { avail = (int )((unsigned int )(((unsigned long )gap - 32UL) / 8UL) + (unsigned int )avail); } else { } return (avail); } } static int tot_avail_orphs(struct ubifs_info *c ) { int avail_lebs ; int avail ; { avail_lebs = c->orph_lebs; avail = (int )((unsigned int )((unsigned long )avail_lebs) * (unsigned int )(((unsigned long )c->leb_size - 32UL) / 8UL)); return (avail / 2); } } static int do_write_orph_node(struct ubifs_info *c , int len , int atomic ) { int err ; struct task_struct *tmp ; long tmp___0 ; { err = 0; if (atomic != 0) { tmp___0 = ldv__builtin_expect(c->ohead_offs != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_write_orph_node", 363, tmp->pid); dump_stack(); } else { } ubifs_prepare_node(c, c->orph_buf, len, 1); len = ((c->min_io_size + -1) + len) & - c->min_io_size; err = ubifs_leb_change(c, c->ohead_lnum, (void const *)c->orph_buf, len); } else { if (c->ohead_offs == 0) { err = ubifs_leb_unmap(c, c->ohead_lnum); if (err != 0) { return (err); } else { } } else { } err = ubifs_write_node(c, c->orph_buf, len, c->ohead_lnum, c->ohead_offs); } return (err); } } static int write_orph_node(struct ubifs_info *c , int atomic ) { struct ubifs_orphan *orphan ; struct ubifs_orphan *cnext ; struct ubifs_orph_node *orph ; int gap ; int err ; int len ; int cnt ; int i ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; { tmp___0 = ldv__builtin_expect(c->cmt_orphans <= 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_orph_node", 395, tmp->pid); dump_stack(); } else { } gap = c->leb_size - c->ohead_offs; if ((unsigned int )gap <= 39U) { c->ohead_lnum = c->ohead_lnum + 1; c->ohead_offs = 0; gap = c->leb_size; if (c->ohead_lnum > c->orph_last) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: out of space in orphan area\n", tmp___1->pid, "write_orph_node"); return (-22); } else { } } else { } cnt = (int )(((unsigned long )gap - 32UL) / 8UL); if (c->cmt_orphans < cnt) { cnt = c->cmt_orphans; } else { } len = (int )((unsigned int )((unsigned long )cnt + 4UL) * 8U); tmp___3 = ldv__builtin_expect((unsigned long )c->orph_buf == (unsigned long )((void *)0), 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_orph_node", 414, tmp___2->pid); dump_stack(); } else { } orph = (struct ubifs_orph_node *)c->orph_buf; orph->ch.node_type = 11U; spin_lock(& c->orphan_lock); cnext = c->orph_cnext; i = 0; goto ldv_27564; ldv_27563: orphan = cnext; orph->inos[i] = (unsigned long long )orphan->inum; cnext = orphan->cnext; orphan->cnext = 0; i = i + 1; ldv_27564: ; if (i < cnt) { goto ldv_27563; } else { } c->orph_cnext = cnext; c->cmt_orphans = c->cmt_orphans - cnt; spin_unlock(& c->orphan_lock); if (c->cmt_orphans != 0) { orph->cmt_no = c->cmt_no; } else { orph->cmt_no = c->cmt_no | 0x8000000000000000ULL; } tmp___5 = ldv__builtin_expect(c->ohead_offs + len > c->leb_size, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_orph_node", 433, tmp___4->pid); dump_stack(); } else { } tmp___7 = ldv__builtin_expect(c->ohead_lnum < c->orph_first, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_orph_node", 434, tmp___6->pid); dump_stack(); } else { } tmp___9 = ldv__builtin_expect(c->ohead_lnum > c->orph_last, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_orph_node", 435, tmp___8->pid); dump_stack(); } else { } err = do_write_orph_node(c, len, atomic); c->ohead_offs = c->ohead_offs + (((c->min_io_size + -1) + len) & - c->min_io_size); c->ohead_offs = (c->ohead_offs + 7) & -8; return (err); } } static int write_orph_nodes(struct ubifs_info *c , int atomic ) { int err ; int lnum ; { goto ldv_27572; ldv_27571: err = write_orph_node(c, atomic); if (err != 0) { return (err); } else { } ldv_27572: ; if (c->cmt_orphans > 0) { goto ldv_27571; } else { } if (atomic != 0) { lnum = c->ohead_lnum + 1; lnum = c->ohead_lnum + 1; goto ldv_27576; ldv_27575: err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } lnum = lnum + 1; ldv_27576: ; if (c->orph_last >= lnum) { goto ldv_27575; } else { } } else { } return (0); } } static int consolidate(struct ubifs_info *c ) { int tot_avail ; int tmp ; int err ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct ubifs_orphan *orphan ; struct ubifs_orphan **last ; int cnt ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; { tmp = tot_avail_orphs(c); tot_avail = tmp; err = 0; spin_lock(& c->orphan_lock); descriptor.modname = "ubifs"; descriptor.function = "consolidate"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): there is space for %d orphans and there are %d\n"; descriptor.lineno = 490U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): there is space for %d orphans and there are %d\n", tmp___0->pid, tot_avail, c->tot_orphans); } else { } if (c->tot_orphans - c->new_orphans <= tot_avail) { cnt = 0; last = & c->orph_cnext; __mptr = (struct list_head const *)c->orph_list.next; orphan = (struct ubifs_orphan *)__mptr + 0xffffffffffffffe8UL; goto ldv_27594; ldv_27593: ; if (orphan->new != 0) { goto ldv_27592; } else { } *last = orphan; last = & orphan->cnext; cnt = cnt + 1; ldv_27592: __mptr___0 = (struct list_head const *)orphan->list.next; orphan = (struct ubifs_orphan *)__mptr___0 + 0xffffffffffffffe8UL; ldv_27594: ; if ((unsigned long )(& orphan->list) != (unsigned long )(& c->orph_list)) { goto ldv_27593; } else { } *last = 0; tmp___3 = ldv__builtin_expect(c->tot_orphans - c->new_orphans != cnt, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "consolidate", 505, tmp___2->pid); dump_stack(); } else { } c->cmt_orphans = cnt; c->ohead_lnum = c->orph_first; c->ohead_offs = 0; } else { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: out of space in orphan area\n", tmp___4->pid, "consolidate"); err = -22; } spin_unlock(& c->orphan_lock); return (err); } } static int commit_orphans(struct ubifs_info *c ) { int avail ; int atomic ; int err ; struct task_struct *tmp ; long tmp___0 ; { atomic = 0; tmp___0 = ldv__builtin_expect(c->cmt_orphans <= 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "commit_orphans", 532, tmp->pid); dump_stack(); } else { } avail = avail_orphs(c); if (c->cmt_orphans > avail) { err = consolidate(c); if (err != 0) { return (err); } else { } atomic = 1; } else { } err = write_orph_nodes(c, atomic); return (err); } } static void erase_deleted(struct ubifs_info *c ) { struct ubifs_orphan *orphan ; struct ubifs_orphan *dnext ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; { spin_lock(& c->orphan_lock); dnext = c->orph_dnext; goto ldv_27611; ldv_27610: orphan = dnext; dnext = orphan->dnext; tmp___0 = ldv__builtin_expect(orphan->new != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "erase_deleted", 563, tmp->pid); dump_stack(); } else { } rb_erase(& orphan->rb, & c->orph_tree); list_del(& orphan->list); c->tot_orphans = c->tot_orphans + -1; descriptor.modname = "ubifs"; descriptor.function = "erase_deleted"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): deleting orphan ino %lu\n"; descriptor.lineno = 567U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): deleting orphan ino %lu\n", tmp___1->pid, orphan->inum); } else { } kfree((void const *)orphan); ldv_27611: ; if ((unsigned long )dnext != (unsigned long )((struct ubifs_orphan *)0)) { goto ldv_27610; } else { } c->orph_dnext = 0; spin_unlock(& c->orphan_lock); return; } } int ubifs_orphan_end_commit(struct ubifs_info *c ) { int err ; { if (c->cmt_orphans != 0) { err = commit_orphans(c); if (err != 0) { return (err); } else { } } else { } erase_deleted(c); err = dbg_check_orphans(c); return (err); } } int ubifs_clear_orphans(struct ubifs_info *c ) { int lnum ; int err ; { lnum = c->orph_first; goto ldv_27623; ldv_27622: err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } lnum = lnum + 1; ldv_27623: ; if (c->orph_last >= lnum) { goto ldv_27622; } else { } c->ohead_lnum = c->orph_first; c->ohead_offs = 0; return (0); } } static int insert_dead_orphan(struct ubifs_info *c , ino_t inum ) { struct ubifs_orphan *orphan ; struct ubifs_orphan *o ; struct rb_node **p ; struct rb_node *parent ; void *tmp ; struct rb_node const *__mptr ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; { parent = 0; tmp = kzalloc(88UL, 208U); orphan = (struct ubifs_orphan *)tmp; if ((unsigned long )orphan == (unsigned long )((struct ubifs_orphan *)0)) { return (-12); } else { } orphan->inum = inum; p = & c->orph_tree.rb_node; goto ldv_27636; ldv_27635: parent = *p; __mptr = (struct rb_node const *)parent; o = (struct ubifs_orphan *)__mptr; if (o->inum > inum) { p = & (*p)->rb_left; } else if (o->inum < inum) { p = & (*p)->rb_right; } else { kfree((void const *)orphan); return (0); } ldv_27636: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27635; } else { } c->tot_orphans = c->tot_orphans + 1; rb_link_node(& orphan->rb, parent, p); rb_insert_color(& orphan->rb, & c->orph_tree); list_add_tail(& orphan->list, & c->orph_list); orphan->dnext = c->orph_dnext; c->orph_dnext = orphan; descriptor.modname = "ubifs"; descriptor.function = "insert_dead_orphan"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG mnt (pid %d): ino %lu, new %d, tot %d\n"; descriptor.lineno = 656U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG mnt (pid %d): ino %lu, new %d, tot %d\n", tmp___0->pid, inum, c->new_orphans, c->tot_orphans); } else { } return (0); } } static int do_kill_orphans(struct ubifs_info *c , struct ubifs_scan_leb *sleb , unsigned long long *last_cmt_no , int *outofdate , int *last_flagged ) { struct ubifs_scan_node *snod ; struct ubifs_orph_node *orph ; unsigned long long cmt_no ; ino_t inum ; int i ; int n ; int err ; int first ; struct list_head const *__mptr ; struct task_struct *tmp ; struct task_struct *tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___5 ; long tmp___6 ; struct list_head const *__mptr___0 ; { first = 1; __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_27667; ldv_27666: ; if (snod->type != 11) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: invalid node type %d in orphan area at %d:%d\n", tmp->pid, "do_kill_orphans", snod->type, sleb->lnum, snod->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)snod->node); return (-22); } else { } orph = (struct ubifs_orph_node *)snod->node; cmt_no = orph->cmt_no & 9223372036854775807ULL; if (c->cmt_no < cmt_no) { c->cmt_no = cmt_no; } else { } if (*last_cmt_no > cmt_no && *last_flagged != 0) { if (first == 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: out of order commit number %llu in orphan node at %d:%d\n", tmp___0->pid, "do_kill_orphans", cmt_no, sleb->lnum, snod->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)snod->node); return (-22); } else { } descriptor.modname = "ubifs"; descriptor.function = "do_kill_orphans"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): out of date LEB %d\n"; descriptor.lineno = 716U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): out of date LEB %d\n", tmp___1->pid, sleb->lnum); } else { } *outofdate = 1; return (0); } else { } if (first != 0) { first = 0; } else { } n = (int )(((unsigned long )orph->ch.len - 32UL) >> 3); i = 0; goto ldv_27663; ldv_27662: inum = (ino_t )orph->inos[i]; descriptor___0.modname = "ubifs"; descriptor___0.function = "do_kill_orphans"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): deleting orphaned inode %lu\n"; descriptor___0.lineno = 728U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): deleting orphaned inode %lu\n", tmp___3->pid, inum); } else { } err = ubifs_tnc_remove_ino(c, inum); if (err != 0) { return (err); } else { } err = insert_dead_orphan(c, inum); if (err != 0) { return (err); } else { } i = i + 1; ldv_27663: ; if (i < n) { goto ldv_27662; } else { } *last_cmt_no = cmt_no; if ((long )orph->cmt_no < 0L) { descriptor___1.modname = "ubifs"; descriptor___1.function = "do_kill_orphans"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___1.format = "UBIFS DBG rcvry (pid %d): last orph node for commit %llu at %d:%d\n"; descriptor___1.lineno = 740U; descriptor___1.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG rcvry (pid %d): last orph node for commit %llu at %d:%d\n", tmp___5->pid, cmt_no, sleb->lnum, snod->offs); } else { } *last_flagged = 1; } else { *last_flagged = 0; } __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_27667: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27666; } else { } return (0); } } static int kill_orphans(struct ubifs_info *c ) { unsigned long long last_cmt_no ; int lnum ; int err ; int outofdate ; int last_flagged ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct ubifs_scan_leb *sleb ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { last_cmt_no = 0ULL; err = 0; outofdate = 0; last_flagged = 0; c->ohead_lnum = c->orph_first; c->ohead_offs = 0; if (c->no_orphs != 0) { descriptor.modname = "ubifs"; descriptor.function = "kill_orphans"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): no orphans\n"; descriptor.lineno = 768U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): no orphans\n", tmp->pid); } else { } return (0); } else { } lnum = c->orph_first; goto ldv_27683; ldv_27682: descriptor___0.modname = "ubifs"; descriptor___0.function = "kill_orphans"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): LEB %d\n"; descriptor___0.lineno = 785U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): LEB %d\n", tmp___1->pid, lnum); } else { } sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, c->sbuf, 1); tmp___6 = IS_ERR((void const *)sleb); if (tmp___6 != 0L) { tmp___3 = PTR_ERR((void const *)sleb); if (tmp___3 == -117L) { sleb = ubifs_recover_leb(c, lnum, 0, c->sbuf, -1); } else { } tmp___5 = IS_ERR((void const *)sleb); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)sleb); err = (int )tmp___4; goto ldv_27681; } else { } } else { } err = do_kill_orphans(c, sleb, & last_cmt_no, & outofdate, & last_flagged); if (err != 0 || outofdate != 0) { ubifs_scan_destroy(sleb); goto ldv_27681; } else { } if (sleb->endpt != 0) { c->ohead_lnum = lnum; c->ohead_offs = sleb->endpt; } else { } ubifs_scan_destroy(sleb); lnum = lnum + 1; ldv_27683: ; if (c->orph_last >= lnum) { goto ldv_27682; } else { } ldv_27681: ; return (err); } } int ubifs_mount_orphans(struct ubifs_info *c , int unclean , int read_only ) { int err ; { err = 0; c->max_orphans = tot_avail_orphs(c); if (read_only == 0) { c->orph_buf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )c->orph_buf == (unsigned long )((void *)0)) { return (-12); } else { } } else { } if (unclean != 0) { err = kill_orphans(c); } else if (read_only == 0) { err = ubifs_clear_orphans(c); } else { } return (err); } } static int dbg_find_orphan(struct ubifs_info *c , ino_t inum ) { struct ubifs_orphan *o ; struct rb_node *p ; struct rb_node const *__mptr ; { spin_lock(& c->orphan_lock); p = c->orph_tree.rb_node; goto ldv_27709; ldv_27708: __mptr = (struct rb_node const *)p; o = (struct ubifs_orphan *)__mptr; if (o->inum > inum) { p = p->rb_left; } else if (o->inum < inum) { p = p->rb_right; } else { spin_unlock(& c->orphan_lock); return (1); } ldv_27709: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27708; } else { } spin_unlock(& c->orphan_lock); return (0); } } static int dbg_ins_check_orphan(struct rb_root *root , ino_t inum ) { struct check_orphan *orphan ; struct check_orphan *o ; struct rb_node **p ; struct rb_node *parent ; void *tmp ; struct rb_node const *__mptr ; { parent = 0; tmp = kzalloc(32UL, 80U); orphan = (struct check_orphan *)tmp; if ((unsigned long )orphan == (unsigned long )((struct check_orphan *)0)) { return (-12); } else { } orphan->inum = inum; p = & root->rb_node; goto ldv_27722; ldv_27721: parent = *p; __mptr = (struct rb_node const *)parent; o = (struct check_orphan *)__mptr; if (o->inum > inum) { p = & (*p)->rb_left; } else if (o->inum < inum) { p = & (*p)->rb_right; } else { kfree((void const *)orphan); return (0); } ldv_27722: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27721; } else { } rb_link_node(& orphan->rb, parent, p); rb_insert_color(& orphan->rb, root); return (0); } } static int dbg_find_check_orphan(struct rb_root *root , ino_t inum ) { struct check_orphan *o ; struct rb_node *p ; struct rb_node const *__mptr ; { p = root->rb_node; goto ldv_27733; ldv_27732: __mptr = (struct rb_node const *)p; o = (struct check_orphan *)__mptr; if (o->inum > inum) { p = p->rb_left; } else if (o->inum < inum) { p = p->rb_right; } else { return (1); } ldv_27733: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27732; } else { } return (0); } } static void dbg_free_check_tree(struct rb_root *root ) { struct rb_node *this ; struct check_orphan *o ; struct rb_node const *__mptr ; { this = root->rb_node; goto ldv_27740; ldv_27743: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; goto ldv_27740; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; goto ldv_27740; } else { } __mptr = (struct rb_node const *)this; o = (struct check_orphan *)__mptr; this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& o->rb)) { this->rb_left = 0; } else { this->rb_right = 0; } } else { } kfree((void const *)o); ldv_27740: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_27743; } else { } return; } } static int dbg_orphan_check(struct ubifs_info *c , struct ubifs_zbranch *zbr , void *priv ) { struct check_info *ci ; ino_t inum ; int err ; int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; int tmp___5 ; { ci = (struct check_info *)priv; inum = key_inum((struct ubifs_info const *)c, (void const *)(& zbr->key)); if (ci->last_ino != inum) { tmp___1 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); if (tmp___1 != 0) { tmp = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: found orphan node ino %lu, type %d\n", tmp___0->pid, "dbg_orphan_check", inum, tmp); } else { } ci->last_ino = inum; ci->tot_inos = ci->tot_inos + 1UL; err = ubifs_tnc_read_node(c, zbr, (void *)ci->node); if (err != 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: node read failed, error %d\n", tmp___2->pid, "dbg_orphan_check", err); return (err); } else { } if ((ci->node)->nlink == 0U) { tmp___4 = dbg_find_check_orphan(& ci->root, inum); if (tmp___4 == 0) { tmp___5 = dbg_find_orphan(c, inum); if (tmp___5 == 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: missing orphan, ino %lu\n", tmp___3->pid, "dbg_orphan_check", inum); ci->missing = ci->missing + 1UL; } else { } } else { } } else { } } else { } ci->leaf_cnt = ci->leaf_cnt + 1ULL; return (0); } } static int dbg_read_orphans(struct check_info *ci , struct ubifs_scan_leb *sleb ) { struct ubifs_scan_node *snod ; struct ubifs_orph_node *orph ; ino_t inum ; int i ; int n ; int err ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_27774; ldv_27773: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared", 993, 0); _cond_resched(); if (snod->type != 11) { goto ldv_27769; } else { } orph = (struct ubifs_orph_node *)snod->node; n = (int )(((unsigned long )orph->ch.len - 32UL) >> 3); i = 0; goto ldv_27771; ldv_27770: inum = (ino_t )orph->inos[i]; err = dbg_ins_check_orphan(& ci->root, inum); if (err != 0) { return (err); } else { } i = i + 1; ldv_27771: ; if (i < n) { goto ldv_27770; } else { } ldv_27769: __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_27774: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27773; } else { } return (0); } } static int dbg_scan_orphans(struct ubifs_info *c , struct check_info *ci ) { int lnum ; int err ; void *buf ; pgprot_t __constr_expr_0 ; struct task_struct *tmp ; struct ubifs_scan_leb *sleb ; long tmp___0 ; long tmp___1 ; { err = 0; if (c->no_orphs != 0) { return (0); } else { } __constr_expr_0.pgprot = 0x8000000000000163UL; buf = __vmalloc((unsigned long )c->leb_size, 80U, __constr_expr_0); if ((unsigned long )buf == (unsigned long )((void *)0)) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: cannot allocate memory to check orphans\n", tmp->pid, "dbg_scan_orphans"); return (0); } else { } lnum = c->orph_first; goto ldv_27788; ldv_27787: sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, buf, 0); tmp___1 = IS_ERR((void const *)sleb); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)sleb); err = (int )tmp___0; goto ldv_27786; } else { } err = dbg_read_orphans(ci, sleb); ubifs_scan_destroy(sleb); if (err != 0) { goto ldv_27786; } else { } lnum = lnum + 1; ldv_27788: ; if (c->orph_last >= lnum) { goto ldv_27787; } else { } ldv_27786: vfree((void const *)buf); return (err); } } static int dbg_check_orphans(struct ubifs_info *c ) { struct check_info ci ; int err ; int tmp ; struct rb_root __constr_expr_0 ; void *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct _ddebug descriptor ; struct task_struct *tmp___4 ; long tmp___5 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___6 ; long tmp___7 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___8 ; long tmp___9 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } ci.last_ino = 0UL; ci.tot_inos = 0UL; ci.missing = 0UL; ci.leaf_cnt = 0ULL; __constr_expr_0.rb_node = 0; ci.root = __constr_expr_0; tmp___0 = kmalloc(4256UL, 80U); ci.node = (struct ubifs_ino_node *)tmp___0; if ((unsigned long )ci.node == (unsigned long )((struct ubifs_ino_node *)0)) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: out of memory\n", tmp___1->pid, "dbg_check_orphans"); return (-12); } else { } err = dbg_scan_orphans(c, & ci); if (err != 0) { goto out; } else { } err = dbg_walk_index(c, & dbg_orphan_check, 0, (void *)(& ci)); if (err != 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot scan TNC, error %d\n", tmp___2->pid, "dbg_check_orphans", err); goto out; } else { } if (ci.missing != 0UL) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: %lu missing orphan(s)\n", tmp___3->pid, "dbg_check_orphans", ci.missing); err = -22; goto out; } else { } descriptor.modname = "ubifs"; descriptor.function = "dbg_check_orphans"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): last inode number is %lu\n"; descriptor.lineno = 1077U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): last inode number is %lu\n", tmp___4->pid, ci.last_ino); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "dbg_check_orphans"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): total number of inodes is %lu\n"; descriptor___0.lineno = 1078U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): total number of inodes is %lu\n", tmp___6->pid, ci.tot_inos); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "dbg_check_orphans"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/orphan.c.prepared"; descriptor___1.format = "UBIFS DBG cmt (pid %d): total number of leaf nodes is %llu\n"; descriptor___1.lineno = 1079U; descriptor___1.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG cmt (pid %d): total number of leaf nodes is %llu\n", tmp___8->pid, ci.leaf_cnt); } else { } out: dbg_free_check_tree(& ci.root); kfree((void const *)ci.node); return (err); } } void ldv_mutex_lock_485(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_486(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_487(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_488(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_489(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_490(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_491(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_492(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_505(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_502(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_504(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_506(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_508(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_501(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_503(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_507(struct mutex *ldv_func_arg1 ) ; extern int debug_lockdep_rcu_enabled(void) ; __inline static bool uid_eq(kuid_t left , kuid_t right ) { uid_t tmp ; uid_t tmp___0 ; { tmp = __kuid_val(left); tmp___0 = __kuid_val(right); return (tmp == tmp___0); } } __inline static bool gid_eq(kgid_t left , kgid_t right ) { gid_t tmp ; gid_t tmp___0 ; { tmp = __kgid_val(left); tmp___0 = __kgid_val(right); return (tmp == tmp___0); } } extern void writeback_inodes_sb(struct super_block * , enum wb_reason ) ; long long ubifs_get_free_space_nolock(struct ubifs_info *c ) ; long long ubifs_calc_available(struct ubifs_info const *c , int min_idx_lebs ) ; static void shrink_liability(struct ubifs_info *c , int nr_to_write ) { { down_read(& (c->vfs_sb)->s_umount); writeback_inodes_sb(c->vfs_sb, 6); up_read(& (c->vfs_sb)->s_umount); return; } } static int run_gc(struct ubifs_info *c ) { int err ; int lnum ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { down_read(& c->commit_sem); lnum = ubifs_garbage_collect(c, 1); up_read(& c->commit_sem); if (lnum < 0) { return (lnum); } else { } descriptor.modname = "ubifs"; descriptor.function = "run_gc"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor.format = "UBIFS DBG budg (pid %d): GC freed LEB %d\n"; descriptor.lineno = 209U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG budg (pid %d): GC freed LEB %d\n", tmp->pid, lnum); } else { } err = ubifs_return_leb(c, lnum); if (err != 0) { return (err); } else { } return (0); } } static long long get_liability(struct ubifs_info *c ) { long long liab ; { spin_lock(& c->space_lock); liab = (c->bi.idx_growth + c->bi.data_growth) + c->bi.dd_growth; spin_unlock(& c->space_lock); return (liab); } } static int make_free_space(struct ubifs_info *c ) { int err ; int retries ; long long liab1 ; long long liab2 ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___5 ; long tmp___6 ; int tmp___7 ; { retries = 0; ldv_27513: liab1 = get_liability(c); descriptor.modname = "ubifs"; descriptor.function = "make_free_space"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor.format = "UBIFS DBG budg (pid %d): liability %lld, run write-back\n"; descriptor.lineno = 262U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG budg (pid %d): liability %lld, run write-back\n", tmp->pid, liab1); } else { } shrink_liability(c, 16); liab2 = get_liability(c); if (liab2 < liab1) { return (-11); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "make_free_space"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___0.format = "UBIFS DBG budg (pid %d): new liability %lld (not shrunk)\n"; descriptor___0.lineno = 269U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG budg (pid %d): new liability %lld (not shrunk)\n", tmp___1->pid, liab2); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "make_free_space"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___1.format = "UBIFS DBG budg (pid %d): Run GC\n"; descriptor___1.lineno = 272U; descriptor___1.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG budg (pid %d): Run GC\n", tmp___3->pid); } else { } err = run_gc(c); if (err == 0) { return (-11); } else { } if (err != -11 && err != -28) { return (err); } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "make_free_space"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___2.format = "UBIFS DBG budg (pid %d): Run commit (retries %d)\n"; descriptor___2.lineno = 281U; descriptor___2.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG budg (pid %d): Run commit (retries %d)\n", tmp___5->pid, retries); } else { } err = ubifs_run_commit(c); if (err != 0) { return (err); } else { } tmp___7 = retries; retries = retries + 1; if (tmp___7 <= 2) { goto ldv_27513; } else { } return (-28); } } int ubifs_calc_min_idx_lebs(struct ubifs_info *c ) { int idx_lebs ; long long idx_size ; u64 tmp ; { idx_size = (long long )((c->bi.old_idx_sz + (unsigned long long )c->bi.idx_growth) + (unsigned long long )c->bi.uncommitted_idx); idx_size = (idx_size << 1) + idx_size; tmp = div_u64((u64 )(((long long )c->idx_leb_size + idx_size) + -1LL), (u32 )c->idx_leb_size); idx_lebs = (int )tmp; idx_lebs = idx_lebs + 1; if (idx_lebs <= 1) { idx_lebs = 2; } else { } return (idx_lebs); } } long long ubifs_calc_available(struct ubifs_info const *c , int min_idx_lebs ) { int subtract_lebs ; long long available ; { available = (long long )c->main_bytes - (long long )c->lst.total_used; subtract_lebs = min_idx_lebs; subtract_lebs = subtract_lebs + 1; subtract_lebs = ((int )c->jhead_cnt + -1) + subtract_lebs; subtract_lebs = subtract_lebs + 1; available = available - (long long )subtract_lebs * (long long )c->leb_size; available = available - (long long )c->lst.total_dead; available = available - (long long )c->lst.total_dark; if ((int )c->lst.idx_lebs > min_idx_lebs) { subtract_lebs = (int )c->lst.idx_lebs - min_idx_lebs; available = available - (long long )((int )c->dark_wm * subtract_lebs); } else { } return (0LL > available ? 0LL : available); } } static int can_use_rp(struct ubifs_info *c ) { int tmp ; struct task_struct *tmp___0 ; bool tmp___1 ; bool tmp___2 ; bool tmp___3 ; int tmp___4 ; int tmp___5 ; { tmp = debug_lockdep_rcu_enabled(); tmp___0 = get_current(); tmp___1 = uid_eq((tmp___0->cred)->fsuid, c->rp_uid); if ((int )tmp___1) { return (1); } else { tmp___2 = capable(24); if ((int )tmp___2) { return (1); } else { tmp___3 = gid_eq(c->rp_gid, 0U); if (tmp___3) { tmp___4 = 0; } else { tmp___4 = 1; } if (tmp___4) { tmp___5 = in_group_p(c->rp_gid); if (tmp___5 != 0) { return (1); } else { } } else { } } } return (0); } } static int do_budget_space(struct ubifs_info *c ) { long long outstanding ; long long available ; int lebs ; int rsvd_idx_lebs ; int min_idx_lebs ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; int tmp___5 ; { min_idx_lebs = ubifs_calc_min_idx_lebs(c); if (c->lst.idx_lebs < min_idx_lebs) { rsvd_idx_lebs = min_idx_lebs - c->lst.idx_lebs; } else { rsvd_idx_lebs = 0; } lebs = ((c->lst.empty_lebs + c->freeable_cnt) + c->idx_gc_cnt) - c->lst.taken_empty_lebs; tmp___1 = ldv__builtin_expect(rsvd_idx_lebs > lebs, 0L); if (tmp___1 != 0L) { descriptor.modname = "ubifs"; descriptor.function = "do_budget_space"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor.format = "UBIFS DBG budg (pid %d): out of indexing space: min_idx_lebs %d (old %d), rsvd_idx_lebs %d\n"; descriptor.lineno = 465U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG budg (pid %d): out of indexing space: min_idx_lebs %d (old %d), rsvd_idx_lebs %d\n", tmp->pid, min_idx_lebs, c->bi.min_idx_lebs, rsvd_idx_lebs); } else { } return (-28); } else { } available = ubifs_calc_available((struct ubifs_info const *)c, min_idx_lebs); outstanding = c->bi.data_growth + c->bi.dd_growth; tmp___4 = ldv__builtin_expect(available < outstanding, 0L); if (tmp___4 != 0L) { descriptor___0.modname = "ubifs"; descriptor___0.function = "do_budget_space"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___0.format = "UBIFS DBG budg (pid %d): out of data space: available %lld, outstanding %lld\n"; descriptor___0.lineno = 474U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG budg (pid %d): out of data space: available %lld, outstanding %lld\n", tmp___2->pid, available, outstanding); } else { } return (-28); } else { } if (available - outstanding <= c->rp_size) { tmp___5 = can_use_rp(c); if (tmp___5 == 0) { return (-28); } else { } } else { } c->bi.min_idx_lebs = min_idx_lebs; return (0); } } static int calc_idx_growth(struct ubifs_info const *c , struct ubifs_budget_req const *req ) { int znodes ; { znodes = ((int )req->new_ino + (int )req->new_page) + (int )req->new_dent; return ((int )c->max_idx_node_sz * znodes); } } static int calc_data_growth(struct ubifs_info const *c , struct ubifs_budget_req const *req ) { int data_growth ; { data_growth = (unsigned int )*((unsigned char *)req + 0UL) != 0U ? c->bi.inode_budget : 0; if ((unsigned int )*((unsigned char *)req + 0UL) != 0U) { data_growth = (int )c->bi.page_budget + data_growth; } else { } if ((unsigned int )*((unsigned char *)req + 0UL) != 0U) { data_growth = (int )c->bi.dent_budget + data_growth; } else { } data_growth = (int )req->new_ino_d + data_growth; return (data_growth); } } static int calc_dd_growth(struct ubifs_info const *c , struct ubifs_budget_req const *req ) { int dd_growth ; { dd_growth = (unsigned int )*((unsigned char *)req + 0UL) != 0U ? c->bi.page_budget : 0; if ((unsigned int )*((unsigned char *)req + 2UL) != 0U) { dd_growth = (int )(c->bi.inode_budget << ((int )req->dirtied_ino + -1)) + dd_growth; } else { } if ((unsigned int )*((unsigned char *)req + 0UL) != 0U) { dd_growth = (int )c->bi.dent_budget + dd_growth; } else { } dd_growth = (int )req->dirtied_ino_d + dd_growth; return (dd_growth); } } int ubifs_budget_space(struct ubifs_info *c , struct ubifs_budget_req *req ) { int cmt_retries ; int wb_retries ; int err ; int idx_growth ; int data_growth ; int dd_growth ; int retried ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; struct task_struct *tmp___15 ; long tmp___16 ; struct task_struct *tmp___17 ; long tmp___18 ; struct task_struct *tmp___19 ; long tmp___20 ; struct task_struct *tmp___21 ; long tmp___22 ; struct task_struct *tmp___23 ; long tmp___24 ; struct _ddebug descriptor ; struct task_struct *tmp___25 ; long tmp___26 ; long tmp___27 ; int tmp___28 ; long tmp___29 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___30 ; long tmp___31 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___32 ; long tmp___33 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___34 ; long tmp___35 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___36 ; long tmp___37 ; int tmp___38 ; struct task_struct *tmp___39 ; { cmt_retries = cmt_retries; wb_retries = wb_retries; retried = 0; tmp___0 = ldv__builtin_expect((int )req->new_page > 1, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 562, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect((int )req->dirtied_page > 1, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 563, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect((int )req->new_dent > 1, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 564, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect((int )req->mod_dent > 1, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 565, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect((int )req->new_ino > 1, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 566, tmp___7->pid); dump_stack(); } else { } tmp___10 = ldv__builtin_expect((int )req->new_ino_d > 4096, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 567, tmp___9->pid); dump_stack(); } else { } tmp___12 = ldv__builtin_expect((int )req->dirtied_ino > 4, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 568, tmp___11->pid); dump_stack(); } else { } tmp___14 = ldv__builtin_expect((int )req->dirtied_ino_d > 16384, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 569, tmp___13->pid); dump_stack(); } else { } tmp___16 = ldv__builtin_expect(((int )req->new_ino_d & 7) != 0, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 570, tmp___15->pid); dump_stack(); } else { } tmp___18 = ldv__builtin_expect(((int )req->dirtied_ino_d & 7) != 0, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 571, tmp___17->pid); dump_stack(); } else { } data_growth = calc_data_growth((struct ubifs_info const *)c, (struct ubifs_budget_req const *)req); dd_growth = calc_dd_growth((struct ubifs_info const *)c, (struct ubifs_budget_req const *)req); if (data_growth == 0 && dd_growth == 0) { return (0); } else { } idx_growth = calc_idx_growth((struct ubifs_info const *)c, (struct ubifs_budget_req const *)req); again: spin_lock(& c->space_lock); tmp___20 = ldv__builtin_expect(c->bi.idx_growth < 0LL, 0L); if (tmp___20 != 0L) { tmp___19 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 581, tmp___19->pid); dump_stack(); } else { } tmp___22 = ldv__builtin_expect(c->bi.data_growth < 0LL, 0L); if (tmp___22 != 0L) { tmp___21 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 582, tmp___21->pid); dump_stack(); } else { } tmp___24 = ldv__builtin_expect(c->bi.dd_growth < 0LL, 0L); if (tmp___24 != 0L) { tmp___23 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_budget_space", 583, tmp___23->pid); dump_stack(); } else { } tmp___27 = ldv__builtin_expect((long )*((unsigned char *)c + 4284UL) & 1L, 0L); if (tmp___27 != 0L) { if ((unsigned int )*((unsigned char *)c + 4284UL) != 0U) { goto _L; } else { tmp___28 = can_use_rp(c); if (tmp___28 == 0) { _L: /* CIL Label */ descriptor.modname = "ubifs"; descriptor.function = "ubifs_budget_space"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor.format = "UBIFS DBG budg (pid %d): no space\n"; descriptor.lineno = 586U; descriptor.flags = 0U; tmp___26 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___26 != 0L) { tmp___25 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG budg (pid %d): no space\n", tmp___25->pid); } else { } spin_unlock(& c->space_lock); return (-28); } else { } } } else { } c->bi.idx_growth = c->bi.idx_growth + (long long )idx_growth; c->bi.data_growth = c->bi.data_growth + (long long )data_growth; c->bi.dd_growth = c->bi.dd_growth + (long long )dd_growth; err = do_budget_space(c); tmp___29 = ldv__builtin_expect(err == 0, 1L); if (tmp___29 != 0L) { req->idx_growth = idx_growth; req->data_growth = data_growth; req->dd_growth = dd_growth; spin_unlock(& c->space_lock); return (0); } else { } c->bi.idx_growth = c->bi.idx_growth - (long long )idx_growth; c->bi.data_growth = c->bi.data_growth - (long long )data_growth; c->bi.dd_growth = c->bi.dd_growth - (long long )dd_growth; spin_unlock(& c->space_lock); if ((unsigned int )*((unsigned char *)req + 0UL) != 0U) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_budget_space"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___0.format = "UBIFS DBG budg (pid %d): no space for fast budgeting\n"; descriptor___0.lineno = 611U; descriptor___0.flags = 0U; tmp___31 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___31 != 0L) { tmp___30 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG budg (pid %d): no space for fast budgeting\n", tmp___30->pid); } else { } return (err); } else { } err = make_free_space(c); __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared", 616, 0); _cond_resched(); if (err == -11) { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_budget_space"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___1.format = "UBIFS DBG budg (pid %d): try again\n"; descriptor___1.lineno = 618U; descriptor___1.flags = 0U; tmp___33 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___33 != 0L) { tmp___32 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG budg (pid %d): try again\n", tmp___32->pid); } else { } goto again; } else if (err == -28) { if (retried == 0) { retried = 1; descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_budget_space"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___2.format = "UBIFS DBG budg (pid %d): -ENOSPC, but anyway try once again\n"; descriptor___2.lineno = 623U; descriptor___2.flags = 0U; tmp___35 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___35 != 0L) { tmp___34 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG budg (pid %d): -ENOSPC, but anyway try once again\n", tmp___34->pid); } else { } goto again; } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_budget_space"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/budget.c.prepared"; descriptor___3.format = "UBIFS DBG budg (pid %d): FS is full, -ENOSPC\n"; descriptor___3.lineno = 626U; descriptor___3.flags = 0U; tmp___37 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___37 != 0L) { tmp___36 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG budg (pid %d): FS is full, -ENOSPC\n", tmp___36->pid); } else { } c->bi.nospace = 1U; tmp___38 = can_use_rp(c); if (tmp___38 != 0 || c->rp_size == 0LL) { c->bi.nospace_rp = 1U; } else { } __asm__ volatile ("": : : "memory"); } else { tmp___39 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot budget space, error %d\n", tmp___39->pid, "ubifs_budget_space", err); } return (err); } } void ubifs_release_budget(struct ubifs_info *c , struct ubifs_budget_req *req ) { struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; struct task_struct *tmp___15 ; long tmp___16 ; struct task_struct *tmp___17 ; long tmp___18 ; struct task_struct *tmp___19 ; long tmp___20 ; struct task_struct *tmp___21 ; long tmp___22 ; struct task_struct *tmp___23 ; long tmp___24 ; unsigned char tmp___25 ; struct task_struct *tmp___26 ; long tmp___27 ; struct task_struct *tmp___28 ; long tmp___29 ; struct task_struct *tmp___30 ; long tmp___31 ; struct task_struct *tmp___32 ; long tmp___33 ; struct task_struct *tmp___34 ; long tmp___35 ; struct task_struct *tmp___36 ; long tmp___37 ; struct task_struct *tmp___38 ; long tmp___39 ; { tmp___0 = ldv__builtin_expect((int )req->new_page > 1, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 649, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect((int )req->dirtied_page > 1, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 650, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect((int )req->new_dent > 1, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 651, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect((int )req->mod_dent > 1, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 652, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect((int )req->new_ino > 1, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 653, tmp___7->pid); dump_stack(); } else { } tmp___10 = ldv__builtin_expect((int )req->new_ino_d > 4096, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 654, tmp___9->pid); dump_stack(); } else { } tmp___12 = ldv__builtin_expect((int )req->dirtied_ino > 4, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 655, tmp___11->pid); dump_stack(); } else { } tmp___14 = ldv__builtin_expect((int )req->dirtied_ino_d > 16384, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 656, tmp___13->pid); dump_stack(); } else { } tmp___16 = ldv__builtin_expect(((int )req->new_ino_d & 7) != 0, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 657, tmp___15->pid); dump_stack(); } else { } tmp___18 = ldv__builtin_expect(((int )req->dirtied_ino_d & 7) != 0, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 658, tmp___17->pid); dump_stack(); } else { } if ((unsigned int )*((unsigned char *)req + 0UL) == 0U) { tmp___20 = ldv__builtin_expect(req->idx_growth < 0, 0L); if (tmp___20 != 0L) { tmp___19 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 660, tmp___19->pid); dump_stack(); } else { } tmp___22 = ldv__builtin_expect(req->data_growth < 0, 0L); if (tmp___22 != 0L) { tmp___21 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 661, tmp___21->pid); dump_stack(); } else { } tmp___24 = ldv__builtin_expect(req->dd_growth < 0, 0L); if (tmp___24 != 0L) { tmp___23 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 662, tmp___23->pid); dump_stack(); } else { } } else { } if ((unsigned int )*((unsigned char *)req + 0UL) != 0U) { req->data_growth = calc_data_growth((struct ubifs_info const *)c, (struct ubifs_budget_req const *)req); req->dd_growth = calc_dd_growth((struct ubifs_info const *)c, (struct ubifs_budget_req const *)req); req->idx_growth = calc_idx_growth((struct ubifs_info const *)c, (struct ubifs_budget_req const *)req); } else { } if (req->data_growth == 0 && req->dd_growth == 0) { return; } else { } tmp___25 = 0U; c->bi.nospace_rp = tmp___25; c->bi.nospace = tmp___25; __asm__ volatile ("": : : "memory"); spin_lock(& c->space_lock); c->bi.idx_growth = c->bi.idx_growth - (long long )req->idx_growth; c->bi.uncommitted_idx = c->bi.uncommitted_idx + (long long )req->idx_growth; c->bi.data_growth = c->bi.data_growth - (long long )req->data_growth; c->bi.dd_growth = c->bi.dd_growth - (long long )req->dd_growth; c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); tmp___27 = ldv__builtin_expect(c->bi.idx_growth < 0LL, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 684, tmp___26->pid); dump_stack(); } else { } tmp___29 = ldv__builtin_expect(c->bi.data_growth < 0LL, 0L); if (tmp___29 != 0L) { tmp___28 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 685, tmp___28->pid); dump_stack(); } else { } tmp___31 = ldv__builtin_expect(c->bi.dd_growth < 0LL, 0L); if (tmp___31 != 0L) { tmp___30 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 686, tmp___30->pid); dump_stack(); } else { } tmp___33 = ldv__builtin_expect(c->bi.min_idx_lebs >= c->main_lebs, 0L); if (tmp___33 != 0L) { tmp___32 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 687, tmp___32->pid); dump_stack(); } else { } tmp___35 = ldv__builtin_expect((c->bi.idx_growth & 7LL) != 0LL, 0L); if (tmp___35 != 0L) { tmp___34 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 688, tmp___34->pid); dump_stack(); } else { } tmp___37 = ldv__builtin_expect((c->bi.data_growth & 7LL) != 0LL, 0L); if (tmp___37 != 0L) { tmp___36 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 689, tmp___36->pid); dump_stack(); } else { } tmp___39 = ldv__builtin_expect((c->bi.dd_growth & 7LL) != 0LL, 0L); if (tmp___39 != 0L) { tmp___38 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_budget", 690, tmp___38->pid); dump_stack(); } else { } spin_unlock(& c->space_lock); return; } } void ubifs_convert_page_budget(struct ubifs_info *c ) { { spin_lock(& c->space_lock); c->bi.idx_growth = c->bi.idx_growth - (long long )c->max_idx_node_sz; c->bi.data_growth = c->bi.data_growth - (long long )c->bi.page_budget; c->bi.dd_growth = c->bi.dd_growth + (long long )c->bi.page_budget; c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); spin_unlock(& c->space_lock); return; } } void ubifs_release_dirty_inode_budget(struct ubifs_info *c , struct ubifs_inode *ui ) { struct ubifs_budget_req req ; { memset((void *)(& req), 0, 20UL); req.dd_growth = c->bi.inode_budget + ((ui->data_len + 7) & -8); ubifs_release_budget(c, & req); return; } } long long ubifs_reported_space(struct ubifs_info const *c , long long free ) { int divisor ; int factor ; int f ; u64 tmp ; { f = (int )c->fanout > 3 ? c->fanout >> 1 : 2; factor = 4096; divisor = 4144; divisor = ((int )c->max_idx_node_sz * 3) / (f + -1) + divisor; free = (long long )factor * free; tmp = div_u64((u64 )free, (u32 )divisor); return ((long long )tmp); } } long long ubifs_get_free_space_nolock(struct ubifs_info *c ) { int rsvd_idx_lebs ; int lebs ; long long available ; long long outstanding ; long long free ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; { tmp___0 = ubifs_calc_min_idx_lebs(c); tmp___1 = ldv__builtin_expect(c->bi.min_idx_lebs != tmp___0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_get_free_space_nolock", 803, tmp->pid); dump_stack(); } else { } outstanding = c->bi.data_growth + c->bi.dd_growth; available = ubifs_calc_available((struct ubifs_info const *)c, c->bi.min_idx_lebs); if (c->bi.min_idx_lebs > c->lst.idx_lebs) { rsvd_idx_lebs = c->bi.min_idx_lebs - c->lst.idx_lebs; } else { rsvd_idx_lebs = 0; } lebs = ((c->lst.empty_lebs + c->freeable_cnt) + c->idx_gc_cnt) - c->lst.taken_empty_lebs; lebs = lebs - rsvd_idx_lebs; available = (long long )((c->dark_wm - c->leb_overhead) * lebs) + available; if (available > outstanding) { free = ubifs_reported_space((struct ubifs_info const *)c, available - outstanding); } else { free = 0LL; } return (free); } } long long ubifs_get_free_space(struct ubifs_info *c ) { long long free ; { spin_lock(& c->space_lock); free = ubifs_get_free_space_nolock(c); spin_unlock(& c->space_lock); return (free); } } void ldv_mutex_lock_501(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_502(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_503(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_504(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_505(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_506(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_507(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_508(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_521(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_518(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_520(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_522(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_524(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_517(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_519(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_523(struct mutex *ldv_func_arg1 ) ; extern void sort(void * , size_t , size_t , int (*)(void const * , void const * ) , void (*)(void * , void * , int ) ) ; int ubifs_find_free_leb_for_idx(struct ubifs_info *c ) ; int ubifs_find_dirty_idx_leb(struct ubifs_info *c ) ; int ubifs_save_dirty_idx_lnums(struct ubifs_info *c ) ; int ubifs_lpt_scan_nolock(struct ubifs_info *c , int start_lnum , int end_lnum , int (*scan_cb)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ) , void *data ) ; struct ubifs_lprops const *ubifs_fast_find_free(struct ubifs_info *c ) ; struct ubifs_lprops const *ubifs_fast_find_empty(struct ubifs_info *c ) ; __inline static void ubifs_get_lprops___2(struct ubifs_info *c ) { { ldv_mutex_lock_523(& c->lp_mutex); return; } } __inline static void ubifs_release_lprops___2(struct ubifs_info *c ) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 280, tmp->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect(c->lst.empty_lebs < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lst.empty_lebs > c->main_lebs, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { } } ldv_mutex_unlock_524(& c->lp_mutex); return; } } static int valuable(struct ubifs_info *c , struct ubifs_lprops const *lprops ) { int n ; int cat ; struct ubifs_lpt_heap *heap ; { cat = (int )lprops->flags & 15; switch (cat) { case 1: ; case 2: ; case 3: heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); if (heap->cnt < heap->max_cnt) { return (1); } else { } if ((int )lprops->free + (int )lprops->dirty >= c->dark_wm) { return (1); } else { } return (0); case 4: n = (c->lst.empty_lebs + c->freeable_cnt) - c->lst.taken_empty_lebs; if (c->lsave_cnt > n) { return (1); } else { } return (0); case 5: ; return (1); case 6: ; return (1); } return (0); } } static int scan_for_dirty_cb(struct ubifs_info *c , struct ubifs_lprops const *lprops , int in_tree , struct scan_data *data ) { int ret ; int tmp ; { ret = 0; if (((int )lprops->flags & 16) != 0) { return (0); } else { } if (in_tree == 0) { tmp = valuable(c, lprops); if (tmp != 0) { ret = ret | 1; } else { } } else { } if ((int )lprops->free + (int )lprops->dirty < data->min_space) { return (ret); } else { } if (data->exclude_index != 0 && ((int )lprops->flags & 32) != 0) { return (ret); } else { } if ((int )lprops->free + (int )lprops->dirty == c->leb_size) { if (data->pick_free == 0) { return (ret); } else if ((int )lprops->dirty < c->dead_wm) { return (ret); } else { } } else { } data->lnum = lprops->lnum; return (3); } } static struct ubifs_lprops const *scan_for_dirty(struct ubifs_info *c , int min_space , int pick_free , int exclude_index ) { struct ubifs_lprops const *lprops ; struct ubifs_lpt_heap *heap ; struct scan_data data ; int err ; int i ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp ; void *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct ubifs_lprops *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; int tmp___14 ; struct task_struct *tmp___15 ; long tmp___16 ; struct task_struct *tmp___17 ; long tmp___18 ; long tmp___19 ; { heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 2UL; i = 0; goto ldv_27535; ldv_27534: lprops = (struct ubifs_lprops const *)*(heap->arr + (unsigned long )i); if ((int )lprops->free + (int )lprops->dirty < min_space) { goto ldv_27533; } else { } if ((int )lprops->dirty < c->dead_wm) { goto ldv_27533; } else { } return (lprops); ldv_27533: i = i + 1; ldv_27535: ; if (heap->cnt > i) { goto ldv_27534; } else { } __mptr = (struct list_head const *)c->uncat_list.next; lprops = (struct ubifs_lprops const *)__mptr + 0xfffffffffffffff0UL; goto ldv_27543; ldv_27542: ; if (((int )lprops->flags & 16) != 0) { goto ldv_27541; } else { } if ((int )lprops->free + (int )lprops->dirty < min_space) { goto ldv_27541; } else { } if (exclude_index != 0 && ((int )lprops->flags & 32) != 0) { goto ldv_27541; } else { } if ((int )lprops->dirty < c->dead_wm) { goto ldv_27541; } else { } return (lprops); ldv_27541: __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops const *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27543: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )((struct list_head const *)(& c->uncat_list))) { goto ldv_27542; } else { } if (c->pnodes_have >= c->pnode_cnt) { tmp = ERR_PTR(-28L); return ((struct ubifs_lprops const *)tmp); } else { } data.min_space = min_space; data.pick_free = pick_free; data.lnum = -1; data.exclude_index = exclude_index; err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, (int (*)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ))(& scan_for_dirty_cb), (void *)(& data)); if (err != 0) { tmp___0 = ERR_PTR((long )err); return ((struct ubifs_lprops const *)tmp___0); } else { } tmp___2 = ldv__builtin_expect(data.lnum < c->main_first, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 305, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(data.lnum >= c->leb_cnt, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 305, tmp___1->pid); dump_stack(); } else { } } c->lscan_lnum = data.lnum; tmp___4 = ubifs_lpt_lookup_dirty(c, data.lnum); lprops = (struct ubifs_lprops const *)tmp___4; tmp___5 = IS_ERR((void const *)lprops); if (tmp___5 != 0L) { return (lprops); } else { } tmp___7 = ldv__builtin_expect((int )lprops->lnum != data.lnum, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 310, tmp___6->pid); dump_stack(); } else { } tmp___9 = ldv__builtin_expect((int )lprops->free + (int )lprops->dirty < min_space, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 311, tmp___8->pid); dump_stack(); } else { } tmp___11 = ldv__builtin_expect((int )lprops->dirty < c->dead_wm, 0L); if (tmp___11 != 0L) { tmp___12 = ldv__builtin_expect(pick_free == 0, 0L); if (tmp___12 != 0L) { tmp___14 = 1; } else { tmp___13 = ldv__builtin_expect((int )lprops->free + (int )lprops->dirty != c->leb_size, 0L); if (tmp___13 != 0L) { tmp___14 = 1; } else { tmp___14 = 0; } } if (tmp___14 != 0) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 314, tmp___10->pid); dump_stack(); } else { } } else { } tmp___16 = ldv__builtin_expect(((int )lprops->flags & 16) != 0, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 315, tmp___15->pid); dump_stack(); } else { } tmp___18 = ldv__builtin_expect(exclude_index != 0, 0L); if (tmp___18 != 0L) { tmp___19 = ldv__builtin_expect(((int )lprops->flags & 32) != 0, 0L); if (tmp___19 != 0L) { tmp___17 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_dirty", 316, tmp___17->pid); dump_stack(); } else { } } else { } return (lprops); } } int ubifs_find_dirty_leb(struct ubifs_info *c , struct ubifs_lprops *ret_lp , int min_space , int pick_free ) { int err ; int sum ; int exclude_index ; struct ubifs_lprops const *lp ; struct ubifs_lprops const *idx_lp ; struct ubifs_lpt_heap *heap ; struct ubifs_lpt_heap *idx_heap ; int lebs ; int rsvd_idx_lebs ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; int tmp___9 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___10 ; long tmp___11 ; long tmp___12 ; long tmp___13 ; size_t __len ; void *__ret ; { err = 0; exclude_index = pick_free == 2; lp = 0; idx_lp = 0; ubifs_get_lprops___2(c); if (pick_free != 0) { rsvd_idx_lebs = 0; spin_lock(& c->space_lock); lebs = c->lst.empty_lebs + c->idx_gc_cnt; lebs = (c->freeable_cnt - c->lst.taken_empty_lebs) + lebs; if (c->bi.min_idx_lebs >= c->lst.idx_lebs) { rsvd_idx_lebs = c->bi.min_idx_lebs - c->lst.idx_lebs; exclude_index = 1; } else { } spin_unlock(& c->space_lock); if (rsvd_idx_lebs < lebs) { lp = ubifs_fast_find_empty(c); if ((unsigned long )lp != (unsigned long )((struct ubifs_lprops const *)0)) { goto found; } else { } lp = ubifs_fast_find_freeable(c); if ((unsigned long )lp != (unsigned long )((struct ubifs_lprops const *)0)) { goto found; } else { } } else { pick_free = 0; } } else { spin_lock(& c->space_lock); exclude_index = c->bi.min_idx_lebs >= c->lst.idx_lebs; spin_unlock(& c->space_lock); } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap); idx_heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 1UL; if (idx_heap->cnt != 0 && exclude_index == 0) { idx_lp = (struct ubifs_lprops const *)*(idx_heap->arr); sum = (int )idx_lp->free + (int )idx_lp->dirty; if (sum < min_space || c->half_leb_size > sum) { idx_lp = 0; } else { } } else { } if (heap->cnt != 0) { lp = (struct ubifs_lprops const *)*(heap->arr); if ((int )lp->dirty + (int )lp->free < min_space) { lp = 0; } else { } } else { } if ((unsigned long )idx_lp != (unsigned long )((struct ubifs_lprops const *)0) && (unsigned long )lp != (unsigned long )((struct ubifs_lprops const *)0)) { if ((int )idx_lp->free + (int )idx_lp->dirty >= (int )lp->free + (int )lp->dirty) { lp = idx_lp; } else if ((unsigned long )idx_lp != (unsigned long )((struct ubifs_lprops const *)0) && (unsigned long )lp == (unsigned long )((struct ubifs_lprops const *)0)) { lp = idx_lp; } else { } } else { } if ((unsigned long )lp != (unsigned long )((struct ubifs_lprops const *)0)) { tmp___0 = ldv__builtin_expect((int )lp->free + (int )lp->dirty < c->dead_wm, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_find_dirty_leb", 437, tmp->pid); dump_stack(); } else { } goto found; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_find_dirty_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): scanning LPT for a dirty LEB\n"; descriptor.lineno = 442U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): scanning LPT for a dirty LEB\n", tmp___1->pid); } else { } lp = scan_for_dirty(c, min_space, pick_free, exclude_index); tmp___4 = IS_ERR((void const *)lp); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)lp); err = (int )tmp___3; goto out; } else { } tmp___6 = ldv__builtin_expect((int )lp->dirty < c->dead_wm, 0L); if (tmp___6 != 0L) { tmp___7 = ldv__builtin_expect(pick_free == 0, 0L); if (tmp___7 != 0L) { tmp___9 = 1; } else { tmp___8 = ldv__builtin_expect((int )lp->free + (int )lp->dirty != c->leb_size, 0L); if (tmp___8 != 0L) { tmp___9 = 1; } else { tmp___9 = 0; } } if (tmp___9 != 0) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_find_dirty_leb", 449, tmp___5->pid); dump_stack(); } else { } } else { } found: descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_find_dirty_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor___0.format = "UBIFS DBG find (pid %d): found LEB %d, free %d, dirty %d, flags %#x\n"; descriptor___0.lineno = 453U; descriptor___0.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG find (pid %d): found LEB %d, free %d, dirty %d, flags %#x\n", tmp___10->pid, lp->lnum, lp->free, lp->dirty, lp->flags); } else { } lp = ubifs_change_lp(c, lp, -2147483647, -2147483647, (int )lp->flags | 16, 0); tmp___13 = IS_ERR((void const *)lp); if (tmp___13 != 0L) { tmp___12 = PTR_ERR((void const *)lp); err = (int )tmp___12; goto out; } else { } __len = 32UL; if (__len > 63UL) { __ret = memcpy((void *)ret_lp, (void const *)lp, __len); } else { __ret = memcpy((void *)ret_lp, (void const *)lp, __len); } out: ubifs_release_lprops___2(c); return (err); } } static int scan_for_free_cb(struct ubifs_info *c , struct ubifs_lprops const *lprops , int in_tree , struct scan_data *data ) { int ret ; int tmp ; { ret = 0; if (((int )lprops->flags & 16) != 0) { return (0); } else { } if (in_tree == 0) { tmp = valuable(c, lprops); if (tmp != 0) { ret = ret | 1; } else { } } else { } if (((int )lprops->flags & 32) != 0) { return (ret); } else { } if ((int )lprops->free < data->min_space) { return (ret); } else { } if (data->pick_free == 0 && (int )lprops->free == c->leb_size) { return (ret); } else { } if ((int )lprops->free + (int )lprops->dirty == c->leb_size && (int )lprops->dirty > 0) { return (ret); } else { } data->lnum = lprops->lnum; return (3); } } static struct ubifs_lprops const *do_find_free_space(struct ubifs_info *c , int min_space , int pick_free , int squeeze ) { struct ubifs_lprops const *lprops ; struct ubifs_lpt_heap *heap ; struct scan_data data ; int err ; int i ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; void *tmp ; void *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct ubifs_lprops *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; long tmp___13 ; { if (squeeze != 0) { lprops = ubifs_fast_find_free(c); if ((unsigned long )lprops != (unsigned long )((struct ubifs_lprops const *)0) && (int )lprops->free >= min_space) { return (lprops); } else { } } else { } if (pick_free != 0) { lprops = ubifs_fast_find_empty(c); if ((unsigned long )lprops != (unsigned long )((struct ubifs_lprops const *)0)) { return (lprops); } else { } } else { } if (squeeze == 0) { lprops = ubifs_fast_find_free(c); if ((unsigned long )lprops != (unsigned long )((struct ubifs_lprops const *)0) && (int )lprops->free >= min_space) { return (lprops); } else { } } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap); i = 0; goto ldv_27588; ldv_27587: lprops = (struct ubifs_lprops const *)*(heap->arr + (unsigned long )i); if ((int )lprops->free >= min_space) { return (lprops); } else { } i = i + 1; ldv_27588: ; if (heap->cnt > i) { goto ldv_27587; } else { } __mptr = (struct list_head const *)c->uncat_list.next; lprops = (struct ubifs_lprops const *)__mptr + 0xfffffffffffffff0UL; goto ldv_27596; ldv_27595: ; if (((int )lprops->flags & 16) != 0) { goto ldv_27594; } else { } if (((int )lprops->flags & 32) != 0) { goto ldv_27594; } else { } if ((int )lprops->free >= min_space) { return (lprops); } else { } ldv_27594: __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops const *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27596: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )((struct list_head const *)(& c->uncat_list))) { goto ldv_27595; } else { } if (c->pnodes_have >= c->pnode_cnt) { tmp = ERR_PTR(-28L); return ((struct ubifs_lprops const *)tmp); } else { } data.min_space = min_space; data.pick_free = pick_free; data.lnum = -1; err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, (int (*)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ))(& scan_for_free_cb), (void *)(& data)); if (err != 0) { tmp___0 = ERR_PTR((long )err); return ((struct ubifs_lprops const *)tmp___0); } else { } tmp___2 = ldv__builtin_expect(data.lnum < c->main_first, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_find_free_space", 584, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(data.lnum >= c->leb_cnt, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_find_free_space", 584, tmp___1->pid); dump_stack(); } else { } } c->lscan_lnum = data.lnum; tmp___4 = ubifs_lpt_lookup_dirty(c, data.lnum); lprops = (struct ubifs_lprops const *)tmp___4; tmp___5 = IS_ERR((void const *)lprops); if (tmp___5 != 0L) { return (lprops); } else { } tmp___7 = ldv__builtin_expect((int )lprops->lnum != data.lnum, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_find_free_space", 589, tmp___6->pid); dump_stack(); } else { } tmp___9 = ldv__builtin_expect((int )lprops->free < min_space, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_find_free_space", 590, tmp___8->pid); dump_stack(); } else { } tmp___11 = ldv__builtin_expect(((int )lprops->flags & 16) != 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_find_free_space", 591, tmp___10->pid); dump_stack(); } else { } tmp___13 = ldv__builtin_expect(((int )lprops->flags & 32) != 0, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "do_find_free_space", 592, tmp___12->pid); dump_stack(); } else { } return (lprops); } } int ubifs_find_free_space(struct ubifs_info *c , int min_space , int *offs , int squeeze ) { struct ubifs_lprops const *lprops ; int lebs ; int rsvd_idx_lebs ; int pick_free ; int err ; int lnum ; int flags ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; { pick_free = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_find_free_space"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): min_space %d\n"; descriptor.lineno = 618U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): min_space %d\n", tmp->pid, min_space); } else { } ubifs_get_lprops___2(c); spin_lock(& c->space_lock); if (c->bi.min_idx_lebs > c->lst.idx_lebs) { rsvd_idx_lebs = c->bi.min_idx_lebs - c->lst.idx_lebs; } else { rsvd_idx_lebs = 0; } lebs = ((c->lst.empty_lebs + c->freeable_cnt) + c->idx_gc_cnt) - c->lst.taken_empty_lebs; if (rsvd_idx_lebs < lebs) { if (c->lst.empty_lebs - c->lst.taken_empty_lebs > 0) { pick_free = 1; c->lst.taken_empty_lebs = c->lst.taken_empty_lebs + 1; } else { } } else { } spin_unlock(& c->space_lock); lprops = do_find_free_space(c, min_space, pick_free, squeeze); tmp___2 = IS_ERR((void const *)lprops); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)lprops); err = (int )tmp___1; goto out; } else { } lnum = lprops->lnum; flags = (int )lprops->flags | 16; lprops = ubifs_change_lp(c, lprops, -2147483647, -2147483647, flags, 0); tmp___4 = IS_ERR((void const *)lprops); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)lprops); err = (int )tmp___3; goto out; } else { } if (pick_free != 0) { spin_lock(& c->space_lock); c->lst.taken_empty_lebs = c->lst.taken_empty_lebs + -1; spin_unlock(& c->space_lock); } else { } *offs = c->leb_size - (int )lprops->free; ubifs_release_lprops___2(c); if (*offs == 0) { err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_find_free_space"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor___0.format = "UBIFS DBG find (pid %d): found LEB %d, free %d\n"; descriptor___0.lineno = 695U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG find (pid %d): found LEB %d, free %d\n", tmp___5->pid, lnum, c->leb_size - *offs); } else { } tmp___8 = ldv__builtin_expect(*offs > c->leb_size - min_space, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_find_free_space", 696, tmp___7->pid); dump_stack(); } else { } return (lnum); out: ; if (pick_free != 0) { spin_lock(& c->space_lock); c->lst.taken_empty_lebs = c->lst.taken_empty_lebs + -1; spin_unlock(& c->space_lock); } else { } ubifs_release_lprops___2(c); return (err); } } static int scan_for_idx_cb(struct ubifs_info *c , struct ubifs_lprops const *lprops , int in_tree , struct scan_data *data ) { int ret ; int tmp ; { ret = 0; if (((int )lprops->flags & 16) != 0) { return (0); } else { } if (in_tree == 0) { tmp = valuable(c, lprops); if (tmp != 0) { ret = ret | 1; } else { } } else { } if (((int )lprops->flags & 32) != 0) { return (ret); } else { } if ((int )lprops->free + (int )lprops->dirty != c->leb_size) { return (ret); } else { } data->lnum = lprops->lnum; return (3); } } static struct ubifs_lprops const *scan_for_leb_for_idx(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct scan_data data ; int err ; void *tmp ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; { data.lnum = -1; err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, (int (*)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ))(& scan_for_idx_cb), (void *)(& data)); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_lprops const *)tmp); } else { } tmp___1 = ldv__builtin_expect(data.lnum < c->main_first, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_leb_for_idx", 764, tmp___0->pid); dump_stack(); } else { tmp___2 = ldv__builtin_expect(data.lnum >= c->leb_cnt, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_leb_for_idx", 764, tmp___0->pid); dump_stack(); } else { } } c->lscan_lnum = data.lnum; lprops = ubifs_lpt_lookup_dirty(c, data.lnum); tmp___3 = IS_ERR((void const *)lprops); if (tmp___3 != 0L) { return ((struct ubifs_lprops const *)lprops); } else { } tmp___5 = ldv__builtin_expect(lprops->lnum != data.lnum, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_leb_for_idx", 769, tmp___4->pid); dump_stack(); } else { } tmp___7 = ldv__builtin_expect(lprops->free + lprops->dirty != c->leb_size, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_leb_for_idx", 770, tmp___6->pid); dump_stack(); } else { } tmp___9 = ldv__builtin_expect((lprops->flags & 16) != 0, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_leb_for_idx", 771, tmp___8->pid); dump_stack(); } else { } tmp___11 = ldv__builtin_expect((lprops->flags & 32) != 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_for_leb_for_idx", 772, tmp___10->pid); dump_stack(); } else { } return ((struct ubifs_lprops const *)lprops); } } int ubifs_find_free_leb_for_idx(struct ubifs_info *c ) { struct ubifs_lprops const *lprops ; int lnum ; int err ; int flags ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; struct _ddebug descriptor ; struct task_struct *tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; { lnum = -1; ubifs_get_lprops___2(c); lprops = ubifs_fast_find_empty(c); if ((unsigned long )lprops == (unsigned long )((struct ubifs_lprops const *)0)) { lprops = ubifs_fast_find_freeable(c); if ((unsigned long )lprops == (unsigned long )((struct ubifs_lprops const *)0)) { if (c->in_a_category_cnt != c->main_lebs || c->lst.empty_lebs - c->lst.taken_empty_lebs > 0) { tmp___0 = ldv__builtin_expect(c->freeable_cnt != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_find_free_leb_for_idx", 812, tmp->pid); dump_stack(); } else { } lprops = scan_for_leb_for_idx(c); tmp___2 = IS_ERR((void const *)lprops); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)lprops); err = (int )tmp___1; goto out; } else { } } else { } } else { } } else { } if ((unsigned long )lprops == (unsigned long )((struct ubifs_lprops const *)0)) { err = -28; goto out; } else { } lnum = lprops->lnum; descriptor.modname = "ubifs"; descriptor.function = "ubifs_find_free_leb_for_idx"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): found LEB %d, free %d, dirty %d, flags %#x\n"; descriptor.lineno = 830U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): found LEB %d, free %d, dirty %d, flags %#x\n", tmp___3->pid, lnum, lprops->free, lprops->dirty, lprops->flags); } else { } flags = (int )lprops->flags | 48; lprops = ubifs_change_lp(c, lprops, c->leb_size, 0, flags, 0); tmp___6 = IS_ERR((void const *)lprops); if (tmp___6 != 0L) { tmp___5 = PTR_ERR((void const *)lprops); err = (int )tmp___5; goto out; } else { } ubifs_release_lprops___2(c); err = ubifs_leb_unmap(c, lnum); if (err != 0) { ubifs_change_one_lp(c, lnum, -2147483647, -2147483647, 0, 48, 0); return (err); } else { } return (lnum); out: ubifs_release_lprops___2(c); return (err); } } static int cmp_dirty_idx(struct ubifs_lprops const **a , struct ubifs_lprops const **b ) { struct ubifs_lprops const *lpa ; struct ubifs_lprops const *lpb ; { lpa = *a; lpb = *b; return ((((int )lpa->dirty + (int )lpa->free) - (int )lpb->dirty) - (int )lpb->free); } } static void swap_dirty_idx(struct ubifs_lprops **a , struct ubifs_lprops **b , int size ) { struct ubifs_lprops *t ; { t = *a; *a = *b; *b = t; return; } } int ubifs_save_dirty_idx_lnums(struct ubifs_info *c ) { int i ; size_t __len ; void *__ret ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { ubifs_get_lprops___2(c); c->dirty_idx.cnt = c->lpt_heap[1].cnt; __len = (unsigned long )c->dirty_idx.cnt * 8UL; __ret = memcpy((void *)c->dirty_idx.arr, (void const *)c->lpt_heap[1].arr, __len); sort((void *)c->dirty_idx.arr, (size_t )c->dirty_idx.cnt, 8UL, (int (*)(void const * , void const * ))(& cmp_dirty_idx), (void (*)(void * , void * , int ))(& swap_dirty_idx)); descriptor.modname = "ubifs"; descriptor.function = "ubifs_save_dirty_idx_lnums"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): found %d dirty index LEBs\n"; descriptor.lineno = 899U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): found %d dirty index LEBs\n", tmp->pid, c->dirty_idx.cnt); } else { } if (c->dirty_idx.cnt != 0) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_save_dirty_idx_lnums"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor___0.format = "UBIFS DBG find (pid %d): dirtiest index LEB is %d with dirty %d and free %d\n"; descriptor___0.lineno = 904U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG find (pid %d): dirtiest index LEB is %d with dirty %d and free %d\n", tmp___1->pid, (*(c->dirty_idx.arr + ((unsigned long )c->dirty_idx.cnt + 0xffffffffffffffffUL)))->lnum, (*(c->dirty_idx.arr + ((unsigned long )c->dirty_idx.cnt + 0xffffffffffffffffUL)))->dirty, (*(c->dirty_idx.arr + ((unsigned long )c->dirty_idx.cnt + 0xffffffffffffffffUL)))->free); } else { } } else { } i = 0; goto ldv_27668; ldv_27667: *(c->dirty_idx.arr + (unsigned long )i) = (struct ubifs_lprops *)((unsigned long )(*(c->dirty_idx.arr + (unsigned long )i))->lnum); i = i + 1; ldv_27668: ; if (c->dirty_idx.cnt > i) { goto ldv_27667; } else { } ubifs_release_lprops___2(c); return (0); } } static int scan_dirty_idx_cb(struct ubifs_info *c , struct ubifs_lprops const *lprops , int in_tree , struct scan_data *data ) { int ret ; int tmp ; { ret = 0; if (((int )lprops->flags & 16) != 0) { return (0); } else { } if (in_tree == 0) { tmp = valuable(c, lprops); if (tmp != 0) { ret = ret | 1; } else { } } else { } if (((int )lprops->flags & 32) == 0) { return (ret); } else { } if ((int )lprops->free + (int )lprops->dirty < c->min_idx_node_sz) { return (ret); } else { } data->lnum = lprops->lnum; return (3); } } static int find_dirty_idx_leb(struct ubifs_info *c ) { struct ubifs_lprops const *lprops ; struct ubifs_lpt_heap *heap ; struct scan_data data ; int err ; int i ; int ret ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct ubifs_lprops *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct _ddebug descriptor ; struct task_struct *tmp___13 ; long tmp___14 ; long tmp___15 ; long tmp___16 ; { data.lnum = -1; heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 1UL; i = 0; goto ldv_27688; ldv_27687: lprops = (struct ubifs_lprops const *)*(heap->arr + (unsigned long )i); ret = scan_dirty_idx_cb(c, lprops, 1, & data); if ((ret & 2) != 0) { goto found; } else { } i = i + 1; ldv_27688: ; if (heap->cnt > i) { goto ldv_27687; } else { } __mptr = (struct list_head const *)c->frdi_idx_list.next; lprops = (struct ubifs_lprops const *)__mptr + 0xfffffffffffffff0UL; goto ldv_27695; ldv_27694: ret = scan_dirty_idx_cb(c, lprops, 1, & data); if ((ret & 2) != 0) { goto found; } else { } __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops const *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27695: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )((struct list_head const *)(& c->frdi_idx_list))) { goto ldv_27694; } else { } __mptr___1 = (struct list_head const *)c->uncat_list.next; lprops = (struct ubifs_lprops const *)__mptr___1 + 0xfffffffffffffff0UL; goto ldv_27702; ldv_27701: ret = scan_dirty_idx_cb(c, lprops, 1, & data); if ((ret & 2) != 0) { goto found; } else { } __mptr___2 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops const *)__mptr___2 + 0xfffffffffffffff0UL; ldv_27702: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )((struct list_head const *)(& c->uncat_list))) { goto ldv_27701; } else { } if (c->pnodes_have >= c->pnode_cnt) { return (-28); } else { } err = ubifs_lpt_scan_nolock(c, -1, c->lscan_lnum, (int (*)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ))(& scan_dirty_idx_cb), (void *)(& data)); if (err != 0) { return (err); } else { } found: tmp___0 = ldv__builtin_expect(data.lnum < c->main_first, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirty_idx_leb", 992, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(data.lnum >= c->leb_cnt, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirty_idx_leb", 992, tmp->pid); dump_stack(); } else { } } c->lscan_lnum = data.lnum; tmp___2 = ubifs_lpt_lookup_dirty(c, data.lnum); lprops = (struct ubifs_lprops const *)tmp___2; tmp___4 = IS_ERR((void const *)lprops); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)lprops); return ((int )tmp___3); } else { } tmp___6 = ldv__builtin_expect((int )lprops->lnum != data.lnum, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirty_idx_leb", 997, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect((int )lprops->free + (int )lprops->dirty < c->min_idx_node_sz, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirty_idx_leb", 998, tmp___7->pid); dump_stack(); } else { } tmp___10 = ldv__builtin_expect(((int )lprops->flags & 16) != 0, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirty_idx_leb", 999, tmp___9->pid); dump_stack(); } else { } tmp___12 = ldv__builtin_expect(((int )lprops->flags & 32) == 0, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirty_idx_leb", 1000, tmp___11->pid); dump_stack(); } else { } descriptor.modname = "ubifs"; descriptor.function = "find_dirty_idx_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): found dirty LEB %d, free %d, dirty %d, flags %#x\n"; descriptor.lineno = 1003U; descriptor.flags = 0U; tmp___14 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): found dirty LEB %d, free %d, dirty %d, flags %#x\n", tmp___13->pid, lprops->lnum, lprops->free, lprops->dirty, lprops->flags); } else { } lprops = ubifs_change_lp(c, lprops, -2147483647, -2147483647, (int )lprops->flags | 16, 0); tmp___16 = IS_ERR((void const *)lprops); if (tmp___16 != 0L) { tmp___15 = PTR_ERR((void const *)lprops); return ((int )tmp___15); } else { } return ((int )lprops->lnum); } } static int get_idx_gc_leb(struct ubifs_info *c ) { struct ubifs_lprops const *lp ; int err ; int lnum ; struct ubifs_lprops *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; struct task_struct *tmp___4 ; long tmp___5 ; { err = ubifs_get_idx_gc_leb(c); if (err < 0) { return (err); } else { } lnum = err; tmp = ubifs_lpt_lookup_dirty(c, lnum); lp = (struct ubifs_lprops const *)tmp; tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)lp); return ((int )tmp___0); } else { } lp = ubifs_change_lp(c, lp, -2147483647, -2147483647, (int )lp->flags | 32, -1); tmp___3 = IS_ERR((void const *)lp); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)lp); return ((int )tmp___2); } else { } descriptor.modname = "ubifs"; descriptor.function = "get_idx_gc_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): LEB %d, dirty %d and free %d flags %#x\n"; descriptor.lineno = 1038U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): LEB %d, dirty %d and free %d flags %#x\n", tmp___4->pid, lp->lnum, lp->dirty, lp->free, lp->flags); } else { } return (lnum); } } static int find_dirtiest_idx_leb(struct ubifs_info *c ) { struct ubifs_lprops const *lp ; int lnum ; struct ubifs_lprops *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; { ldv_27721: ; if (c->dirty_idx.cnt == 0) { return (-28); } else { } c->dirty_idx.cnt = c->dirty_idx.cnt - 1; lnum = (int )((long )*(c->dirty_idx.arr + (unsigned long )c->dirty_idx.cnt)); tmp = ubifs_lpt_lookup(c, lnum); lp = (struct ubifs_lprops const *)tmp; tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)lp); return ((int )tmp___0); } else { } if (((int )lp->flags & 16) != 0 || ((int )lp->flags & 32) == 0) { goto ldv_27719; } else { } lp = ubifs_change_lp(c, lp, -2147483647, -2147483647, (int )lp->flags | 16, 0); tmp___3 = IS_ERR((void const *)lp); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)lp); return ((int )tmp___2); } else { } goto ldv_27720; ldv_27719: ; goto ldv_27721; ldv_27720: descriptor.modname = "ubifs"; descriptor.function = "find_dirtiest_idx_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/find.c.prepared"; descriptor.format = "UBIFS DBG find (pid %d): LEB %d, dirty %d and free %d flags %#x\n"; descriptor.lineno = 1068U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG find (pid %d): LEB %d, dirty %d and free %d flags %#x\n", tmp___4->pid, lp->lnum, lp->dirty, lp->free, lp->flags); } else { } tmp___7 = ldv__builtin_expect(((int )lp->flags & 16) == 0, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirtiest_idx_leb", 1069, tmp___6->pid); dump_stack(); } else { } tmp___9 = ldv__builtin_expect(((int )lp->flags & 32) == 0, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "find_dirtiest_idx_leb", 1070, tmp___8->pid); dump_stack(); } else { } return (lnum); } } int ubifs_find_dirty_idx_leb(struct ubifs_info *c ) { int err ; { ubifs_get_lprops___2(c); err = find_dirtiest_idx_leb(c); if (err == -28) { err = find_dirty_idx_leb(c); } else { } if (err == -28) { err = get_idx_gc_leb(c); } else { } ubifs_release_lprops___2(c); return (err); } } void ldv_mutex_lock_517(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_518(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_519(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_520(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_521(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_522(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_523(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_524(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void *memmove(void * , void const * , size_t ) ; void ldv_mutex_lock_nested_537(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_534(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_536(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_538(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_540(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_542(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_543(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_545(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_533(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_535(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_539(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_541(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_544(struct mutex *ldv_func_arg1 ) ; extern u32 prandom_u32(void) ; int ubifs_read_one_lp(struct ubifs_info *c , int lnum , struct ubifs_lprops *lp ) ; static int make_idx_node(struct ubifs_info *c , struct ubifs_idx_node *idx , struct ubifs_znode *znode , int lnum , int offs , int len ) { struct ubifs_znode *zp ; int i ; int err ; struct ubifs_branch *br ; struct ubifs_branch *tmp ; struct ubifs_zbranch *zbr ; struct task_struct *tmp___0 ; struct ubifs_zbranch *zbr___0 ; struct task_struct *tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; int tmp___5 ; long tmp___6 ; { idx->ch.node_type = 9U; idx->child_cnt = (unsigned short )znode->child_cnt; idx->level = (unsigned short )znode->level; i = 0; goto ldv_27585; ldv_27584: tmp = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, i); br = tmp; zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )i; key_write_idx((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key), (void *)(& br->key)); br->lnum = (unsigned int )zbr->lnum; br->offs = (unsigned int )zbr->offs; br->len = (unsigned int )zbr->len; if (zbr->lnum == 0 || zbr->len == 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad ref in znode\n", tmp___0->pid, "make_idx_node"); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)zbr->ldv_26076.znode); } else { } } else { } i = i + 1; ldv_27585: ; if (znode->child_cnt > i) { goto ldv_27584; } else { } ubifs_prepare_node(c, (void *)idx, len, 0); znode->lnum = lnum; znode->offs = offs; znode->len = len; err = insert_old_idx_znode(c, znode); zp = znode->parent; if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { zbr___0 = (struct ubifs_zbranch *)(& zp->zbranch) + (unsigned long )znode->iip; zbr___0->lnum = lnum; zbr___0->offs = offs; zbr___0->len = len; } else { c->zroot.lnum = lnum; c->zroot.offs = offs; c->zroot.len = len; } c->calc_idx_sz = c->calc_idx_sz + (unsigned long long )((len + 7) & -8); atomic_long_dec(& c->dirty_zn_cnt); tmp___2 = ubifs_zn_dirty((struct ubifs_znode const *)znode); tmp___3 = ldv__builtin_expect(tmp___2 == 0, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "make_idx_node", 207, tmp___1->pid); dump_stack(); } else { } tmp___5 = ubifs_zn_cow((struct ubifs_znode const *)znode); tmp___6 = ldv__builtin_expect(tmp___5 == 0, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "make_idx_node", 208, tmp___4->pid); dump_stack(); } else { } __clear_bit(0, (unsigned long volatile *)(& znode->flags)); __clear_bit(1, (unsigned long volatile *)(& znode->flags)); return (err); } } static int fill_gap(struct ubifs_info *c , int lnum , int gap_start , int gap_end , int *dirt ) { int len ; int gap_remains ; int gap_pos ; int written ; int pad_len ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct ubifs_znode *znode ; int alen ; int err ; struct task_struct *tmp___5 ; long tmp___6 ; struct _ddebug descriptor ; struct task_struct *tmp___7 ; long tmp___8 ; { tmp___0 = ldv__builtin_expect((gap_start & 7) != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fill_gap", 235, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect((gap_end & 7) != 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fill_gap", 236, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(gap_end < gap_start, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fill_gap", 237, tmp___3->pid); dump_stack(); } else { } gap_remains = gap_end - gap_start; if (gap_remains == 0) { return (0); } else { } gap_pos = gap_start; written = 0; goto ldv_27606; ldv_27605: len = ubifs_idx_node_sz((struct ubifs_info const *)c, (c->enext)->child_cnt); if (len < gap_remains) { znode = c->enext; alen = (len + 7) & -8; tmp___6 = ldv__builtin_expect(alen > gap_remains, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "fill_gap", 251, tmp___5->pid); dump_stack(); } else { } err = make_idx_node(c, (struct ubifs_idx_node *)c->ileb_buf + (unsigned long )gap_pos, znode, lnum, gap_pos, len); if (err != 0) { return (err); } else { } gap_remains = gap_remains - alen; gap_pos = gap_pos + alen; c->enext = znode->cnext; if ((unsigned long )c->enext == (unsigned long )c->cnext) { c->enext = 0; } else { } written = written + 1; } else { goto ldv_27604; } ldv_27606: ; if ((unsigned long )c->enext != (unsigned long )((struct ubifs_znode *)0)) { goto ldv_27605; } else { } ldv_27604: ; if (c->leb_size == gap_end) { c->ileb_len = ((c->min_io_size + -1) + gap_pos) & - c->min_io_size; pad_len = c->ileb_len - gap_pos; } else { pad_len = gap_remains; } descriptor.modname = "ubifs"; descriptor.function = "fill_gap"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): LEB %d:%d to %d len %d nodes written %d wasted bytes %d\n"; descriptor.lineno = 273U; descriptor.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): LEB %d:%d to %d len %d nodes written %d wasted bytes %d\n", tmp___7->pid, lnum, gap_start, gap_end, gap_end - gap_start, written, pad_len); } else { } ubifs_pad((struct ubifs_info const *)c, c->ileb_buf + (unsigned long )gap_pos, pad_len); *dirt = *dirt + pad_len; return (written); } } static int find_old_idx(struct ubifs_info *c , int lnum , int offs ) { struct ubifs_old_idx *o ; struct rb_node *p ; struct rb_node const *__mptr ; { p = c->old_idx.rb_node; goto ldv_27618; ldv_27617: __mptr = (struct rb_node const *)p; o = (struct ubifs_old_idx *)__mptr; if (o->lnum > lnum) { p = p->rb_left; } else if (o->lnum < lnum) { p = p->rb_right; } else if (o->offs > offs) { p = p->rb_left; } else if (o->offs < offs) { p = p->rb_right; } else { return (1); } ldv_27618: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27617; } else { } return (0); } } static int is_idx_node_in_use(struct ubifs_info *c , union ubifs_key *key , int level , int lnum , int offs ) { int ret ; int tmp ; { ret = is_idx_node_in_tnc(c, key, level, lnum, offs); if (ret < 0) { return (ret); } else { } if (ret == 0) { tmp = find_old_idx(c, lnum, offs); if (tmp != 0) { return (1); } else { } } else { } return (ret); } } static int layout_leb_in_gaps(struct ubifs_info *c , int *p ) { struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; int lnum ; int dirt ; int gap_start ; int gap_end ; int err ; int written ; int tot_written ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; struct list_head const *__mptr ; struct ubifs_idx_node *idx ; int in_use ; int level ; struct task_struct *tmp___3 ; long tmp___4 ; void *tmp___5 ; struct list_head const *__mptr___0 ; struct ubifs_lprops lp ; struct _ddebug descriptor___0 ; struct task_struct *tmp___6 ; long tmp___7 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___8 ; long tmp___9 ; { dirt = 0; tot_written = 0; lnum = ubifs_find_dirty_idx_leb(c); if (lnum < 0) { return (lnum); } else { } *p = lnum; descriptor.modname = "ubifs"; descriptor.function = "layout_leb_in_gaps"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): LEB %d\n"; descriptor.lineno = 364U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): LEB %d\n", tmp->pid, lnum); } else { } sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, c->ileb_buf, 0); c->ileb_len = 0; tmp___2 = IS_ERR((void const *)sleb); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)sleb); return ((int )tmp___1); } else { } gap_start = 0; __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_27651; ldv_27650: tmp___4 = ldv__builtin_expect(snod->type != 9, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_leb_in_gaps", 379, tmp___3->pid); dump_stack(); } else { } idx = (struct ubifs_idx_node *)snod->node; tmp___5 = ubifs_idx_key((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx); key_read((struct ubifs_info const *)c, (void const *)tmp___5, & snod->key); level = (int )idx->level; in_use = is_idx_node_in_use(c, & snod->key, level, lnum, snod->offs); if (in_use < 0) { ubifs_scan_destroy(sleb); return (in_use); } else { } if (in_use != 0) { if (in_use == 1) { dirt = ((snod->len + 7) & -8) + dirt; } else { } gap_end = snod->offs; written = fill_gap(c, lnum, gap_start, gap_end, & dirt); if (written < 0) { ubifs_scan_destroy(sleb); return (written); } else { } tot_written = tot_written + written; gap_start = ((snod->offs + snod->len) + 7) & -8; } else { } __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_27651: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27650; } else { } ubifs_scan_destroy(sleb); c->ileb_len = c->leb_size; gap_end = c->leb_size; written = fill_gap(c, lnum, gap_start, gap_end, & dirt); if (written < 0) { return (written); } else { } tot_written = tot_written + written; if (tot_written == 0) { descriptor___0.modname = "ubifs"; descriptor___0.function = "layout_leb_in_gaps"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor___0.format = "UBIFS DBG gc (pid %d): LEB %d wrote %d index nodes\n"; descriptor___0.lineno = 421U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gc (pid %d): LEB %d wrote %d index nodes\n", tmp___6->pid, lnum, tot_written); } else { } err = ubifs_read_one_lp(c, lnum, & lp); if (err != 0) { return (err); } else { } if (lp.free == c->leb_size) { err = ubifs_change_one_lp(c, lnum, c->leb_size - c->ileb_len, dirt, 0, 0, 0); if (err != 0) { return (err); } else { } } else { } return (0); } else { } err = ubifs_change_one_lp(c, lnum, c->leb_size - c->ileb_len, dirt, 0, 0, 0); if (err != 0) { return (err); } else { } err = ubifs_leb_change(c, lnum, (void const *)c->ileb_buf, c->ileb_len); if (err != 0) { return (err); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "layout_leb_in_gaps"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor___1.format = "UBIFS DBG gc (pid %d): LEB %d wrote %d index nodes\n"; descriptor___1.lineno = 445U; descriptor___1.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG gc (pid %d): LEB %d wrote %d index nodes\n", tmp___8->pid, lnum, tot_written); } else { } return (tot_written); } } static int get_leb_cnt(struct ubifs_info *c , int cnt ) { int d ; { cnt = cnt - (c->leb_size - c->ihead_offs) / c->max_idx_node_sz; if (cnt < 0) { cnt = 0; } else { } d = c->leb_size / c->max_idx_node_sz; return (((cnt + d) + -1) / d); } } static int layout_in_gaps(struct ubifs_info *c , int cnt ) { int err ; int leb_needed_cnt ; int written ; int *p ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; int tmp___5 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___6 ; long tmp___7 ; { descriptor.modname = "ubifs"; descriptor.function = "layout_in_gaps"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG gc (pid %d): %d znodes to write\n"; descriptor.lineno = 484U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gc (pid %d): %d znodes to write\n", tmp->pid, cnt); } else { } tmp___1 = kmalloc((unsigned long )(c->lst.idx_lebs + 1) * 4UL, 80U); c->gap_lebs = (int *)tmp___1; if ((unsigned long )c->gap_lebs == (unsigned long )((int *)0)) { return (-12); } else { } p = c->gap_lebs; ldv_27673: tmp___3 = ldv__builtin_expect((unsigned long )(c->gap_lebs + (unsigned long )c->lst.idx_lebs * 4UL) <= (unsigned long )p, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_in_gaps", 492, tmp___2->pid); dump_stack(); } else { } written = layout_leb_in_gaps(c, p); if (written < 0) { err = written; if (err != -28) { kfree((void const *)c->gap_lebs); c->gap_lebs = 0; return (err); } else { } tmp___5 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___5 == 0) { tmp___4 = get_current(); printk("\fUBIFS warning (pid %d): %s: out of space\n", tmp___4->pid, "layout_in_gaps"); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); ubifs_dump_lprops(c); } else { } err = 0; goto ldv_27671; } else { } p = p + 1; cnt = cnt - written; leb_needed_cnt = get_leb_cnt(c, cnt); descriptor___0.modname = "ubifs"; descriptor___0.function = "layout_in_gaps"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor___0.format = "UBIFS DBG gc (pid %d): %d znodes remaining, need %d LEBs, have %d\n"; descriptor___0.lineno = 518U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gc (pid %d): %d znodes remaining, need %d LEBs, have %d\n", tmp___6->pid, cnt, leb_needed_cnt, c->ileb_cnt); } else { } if (c->ileb_cnt < leb_needed_cnt) { goto ldv_27673; } else { } ldv_27671: *p = -1; return (0); } } static int layout_in_empty_space(struct ubifs_info *c ) { struct ubifs_znode *znode ; struct ubifs_znode *cnext ; struct ubifs_znode *zp ; int lnum ; int offs ; int len ; int next_len ; int buf_len ; int buf_offs ; int used ; int avail ; int wlen ; int blen ; int err ; struct task_struct *tmp ; int tmp___0 ; struct ubifs_zbranch *zbr ; int i ; { cnext = c->enext; if ((unsigned long )cnext == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } lnum = c->ihead_lnum; buf_offs = c->ihead_offs; buf_len = ubifs_idx_node_sz((struct ubifs_info const *)c, c->fanout); buf_len = ((c->min_io_size + -1) + buf_len) & - c->min_io_size; used = 0; avail = buf_len; next_len = ubifs_idx_node_sz((struct ubifs_info const *)c, cnext->child_cnt); if (buf_offs + next_len > c->leb_size) { lnum = -1; } else { } ldv_27696: znode = cnext; len = ubifs_idx_node_sz((struct ubifs_info const *)c, znode->child_cnt); if (lnum == -1) { if (c->ileb_nxt >= c->ileb_cnt) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: out of space\n", tmp->pid, "layout_in_empty_space"); return (-28); } else { } tmp___0 = c->ileb_nxt; c->ileb_nxt = c->ileb_nxt + 1; lnum = *(c->ilebs + (unsigned long )tmp___0); buf_offs = 0; used = 0; avail = buf_len; } else { } offs = buf_offs + used; znode->lnum = lnum; znode->offs = offs; znode->len = len; zp = znode->parent; if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { i = znode->iip; zbr = (struct ubifs_zbranch *)(& zp->zbranch) + (unsigned long )i; zbr->lnum = lnum; zbr->offs = offs; zbr->len = len; } else { c->zroot.lnum = lnum; c->zroot.offs = offs; c->zroot.len = len; } c->calc_idx_sz = c->calc_idx_sz + (unsigned long long )((len + 7) & -8); atomic_long_dec(& c->dirty_zn_cnt); cnext = znode->cnext; if ((unsigned long )c->cnext == (unsigned long )cnext) { next_len = 0; } else { next_len = ubifs_idx_node_sz((struct ubifs_info const *)c, cnext->child_cnt); } wlen = used + len; used = ((len + 7) & -8) + used; avail = avail - ((len + 7) & -8); if ((next_len != 0 && (buf_offs + used) + next_len <= c->leb_size) && avail > 0) { goto ldv_27694; } else { } if ((avail <= 0 && next_len != 0) && (buf_offs + used) + next_len <= c->leb_size) { blen = buf_len; } else { blen = ((c->min_io_size + -1) + wlen) & - c->min_io_size; } buf_offs = buf_offs + blen; if (next_len != 0) { if (buf_offs + next_len > c->leb_size) { err = ubifs_update_one_lp(c, lnum, c->leb_size - buf_offs, blen - used, 0, 0); if (err != 0) { return (err); } else { } lnum = -1; } else { } used = used - blen; if (used < 0) { used = 0; } else { } avail = buf_len - used; goto ldv_27694; } else { } err = ubifs_update_one_lp(c, lnum, c->leb_size - buf_offs, blen - used, 0, 0); if (err != 0) { return (err); } else { } goto ldv_27695; ldv_27694: ; goto ldv_27696; ldv_27695: (c->dbg)->new_ihead_lnum = lnum; (c->dbg)->new_ihead_offs = buf_offs; return (0); } } static int layout_commit(struct ubifs_info *c , int no_space , int cnt ) { int err ; { if (no_space != 0) { err = layout_in_gaps(c, cnt); if (err != 0) { return (err); } else { } } else { } err = layout_in_empty_space(c); return (err); } } static struct ubifs_znode *find_first_dirty(struct ubifs_znode *znode ) { int i ; int cont ; int tmp ; struct ubifs_zbranch *zbr ; int tmp___0 ; int tmp___1 ; { if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } ldv_27712: ; if (znode->level == 0) { tmp = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp != 0) { return (znode); } else { } return (0); } else { } cont = 0; i = 0; goto ldv_27711; ldv_27710: zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )i; if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { tmp___0 = ubifs_zn_dirty((struct ubifs_znode const *)zbr->ldv_26076.znode); if (tmp___0 != 0) { znode = zbr->ldv_26076.znode; cont = 1; goto ldv_27709; } else { } } else { } i = i + 1; ldv_27711: ; if (znode->child_cnt > i) { goto ldv_27710; } else { } ldv_27709: ; if (cont == 0) { tmp___1 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___1 != 0) { return (znode); } else { } return (0); } else { } goto ldv_27712; } } static struct ubifs_znode *find_next_dirty(struct ubifs_znode *znode ) { int n ; struct ubifs_zbranch *zbr ; struct ubifs_znode *tmp ; int tmp___0 ; { n = znode->iip + 1; znode = znode->parent; if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } goto ldv_27719; ldv_27718: zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { tmp___0 = ubifs_zn_dirty((struct ubifs_znode const *)zbr->ldv_26076.znode); if (tmp___0 != 0) { tmp = find_first_dirty(zbr->ldv_26076.znode); return (tmp); } else { } } else { } n = n + 1; ldv_27719: ; if (znode->child_cnt > n) { goto ldv_27718; } else { } return (znode); } } static int get_znodes_to_commit(struct ubifs_info *c ) { struct ubifs_znode *znode ; struct ubifs_znode *cnext ; int cnt ; struct ubifs_znode *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; { cnt = 0; c->cnext = find_first_dirty(c->zroot.ldv_26076.znode); tmp = c->cnext; c->enext = tmp; znode = tmp; if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { descriptor.modname = "ubifs"; descriptor.function = "get_znodes_to_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): no znodes to commit\n"; descriptor.lineno = 754U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): no znodes to commit\n", tmp___0->pid); } else { } return (0); } else { } cnt = cnt + 1; ldv_27730: tmp___3 = ubifs_zn_cow((struct ubifs_znode const *)znode); tmp___4 = ldv__builtin_expect(tmp___3 != 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "get_znodes_to_commit", 759, tmp___2->pid); dump_stack(); } else { } __set_bit(1, (unsigned long volatile *)(& znode->flags)); znode->alt = 0; cnext = find_next_dirty(znode); if ((unsigned long )cnext == (unsigned long )((struct ubifs_znode *)0)) { znode->cnext = c->cnext; goto ldv_27729; } else { } znode->cnext = cnext; znode = cnext; cnt = cnt + 1; goto ldv_27730; ldv_27729: descriptor___0.modname = "ubifs"; descriptor___0.function = "get_znodes_to_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): committing %d znodes\n"; descriptor___0.lineno = 771U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): committing %d znodes\n", tmp___5->pid, cnt); } else { } tmp___8 = atomic_long_read(& c->dirty_zn_cnt); tmp___9 = ldv__builtin_expect((long )cnt != tmp___8, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "get_znodes_to_commit", 772, tmp___7->pid); dump_stack(); } else { } return (cnt); } } static int alloc_idx_lebs(struct ubifs_info *c , int cnt ) { int i ; int leb_cnt ; int lnum ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; int tmp___2 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; u32 tmp___6 ; { c->ileb_cnt = 0; c->ileb_nxt = 0; leb_cnt = get_leb_cnt(c, cnt); descriptor.modname = "ubifs"; descriptor.function = "alloc_idx_lebs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): need about %d empty LEBS for TNC commit\n"; descriptor.lineno = 792U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): need about %d empty LEBS for TNC commit\n", tmp->pid, leb_cnt); } else { } if (leb_cnt == 0) { return (0); } else { } tmp___1 = kmalloc((unsigned long )leb_cnt * 4UL, 80U); c->ilebs = (int *)tmp___1; if ((unsigned long )c->ilebs == (unsigned long )((int *)0)) { return (-12); } else { } i = 0; goto ldv_27743; ldv_27742: lnum = ubifs_find_free_leb_for_idx(c); if (lnum < 0) { return (lnum); } else { } tmp___2 = c->ileb_cnt; c->ileb_cnt = c->ileb_cnt + 1; *(c->ilebs + (unsigned long )tmp___2) = lnum; descriptor___0.modname = "ubifs"; descriptor___0.function = "alloc_idx_lebs"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): LEB %d\n"; descriptor___0.lineno = 803U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): LEB %d\n", tmp___3->pid, lnum); } else { } i = i + 1; ldv_27743: ; if (i < leb_cnt) { goto ldv_27742; } else { } tmp___5 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___5 != 0) { tmp___6 = prandom_u32(); if ((tmp___6 & 7U) == 0U) { return (-28); } else { } } else { } return (0); } } static int free_unused_idx_lebs(struct ubifs_info *c ) { int i ; int err ; int lnum ; int er ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { err = 0; i = c->ileb_nxt; goto ldv_27755; ldv_27754: lnum = *(c->ilebs + (unsigned long )i); descriptor.modname = "ubifs"; descriptor.function = "free_unused_idx_lebs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): LEB %d\n"; descriptor.lineno = 825U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): LEB %d\n", tmp->pid, lnum); } else { } er = ubifs_change_one_lp(c, lnum, -2147483647, -2147483647, 0, 48, 0); if (err == 0) { err = er; } else { } i = i + 1; ldv_27755: ; if (c->ileb_cnt > i) { goto ldv_27754; } else { } return (err); } } static int free_idx_lebs(struct ubifs_info *c ) { int err ; { err = free_unused_idx_lebs(c); kfree((void const *)c->ilebs); c->ilebs = 0; return (err); } } int ubifs_tnc_start_commit(struct ubifs_info *c , struct ubifs_zbranch *zroot ) { int err ; int cnt ; int no_space ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; size_t __len ; void *__ret ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; struct _ddebug descriptor ; struct task_struct *tmp___5 ; long tmp___6 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___7 ; long tmp___8 ; { err = 0; ldv_mutex_lock_541(& c->tnc_mutex); err = dbg_check_tnc(c, 1); if (err != 0) { goto out; } else { } cnt = get_znodes_to_commit(c); if (cnt != 0) { no_space = 0; err = alloc_idx_lebs(c, cnt); if (err == -28) { no_space = 1; } else if (err != 0) { goto out_free; } else { } err = layout_commit(c, no_space, cnt); if (err != 0) { goto out_free; } else { } tmp___0 = atomic_long_read(& c->dirty_zn_cnt); tmp___1 = ldv__builtin_expect(tmp___0 != 0L, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_start_commit", 880, tmp->pid); dump_stack(); } else { } err = free_unused_idx_lebs(c); if (err != 0) { goto out; } else { } } else { } destroy_old_idx(c); __len = 32UL; if (__len > 63UL) { __ret = memcpy((void *)zroot, (void const *)(& c->zroot), __len); } else { __ret = memcpy((void *)zroot, (void const *)(& c->zroot), __len); } err = ubifs_save_dirty_idx_lnums(c); if (err != 0) { goto out; } else { } spin_lock(& c->space_lock); tmp___3 = ubifs_calc_min_idx_lebs(c); tmp___4 = ldv__builtin_expect(c->bi.min_idx_lebs != tmp___3, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_start_commit", 901, tmp___2->pid); dump_stack(); } else { } c->bi.old_idx_sz = c->calc_idx_sz; c->bi.uncommitted_idx = 0LL; c->bi.min_idx_lebs = ubifs_calc_min_idx_lebs(c); spin_unlock(& c->space_lock); ldv_mutex_unlock_542(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_start_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): number of index LEBs %d\n"; descriptor.lineno = 908U; descriptor.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): number of index LEBs %d\n", tmp___5->pid, c->lst.idx_lebs); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_start_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): size of index %llu\n"; descriptor___0.lineno = 909U; descriptor___0.flags = 0U; tmp___8 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): size of index %llu\n", tmp___7->pid, c->calc_idx_sz); } else { } return (err); out_free: free_idx_lebs(c); out: ldv_mutex_unlock_543(& c->tnc_mutex); return (err); } } static int write_index(struct ubifs_info *c ) { struct ubifs_idx_node *idx ; struct ubifs_znode *znode ; struct ubifs_znode *cnext ; int i ; int lnum ; int offs ; int len ; int next_len ; int buf_len ; int buf_offs ; int used ; int avail ; int wlen ; int err ; int lnum_pos ; int blen ; int nxt_offs ; struct ubifs_branch *br ; struct ubifs_branch *tmp ; struct ubifs_zbranch *zbr ; struct task_struct *tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; { lnum_pos = 0; cnext = c->enext; if ((unsigned long )cnext == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } lnum = c->ihead_lnum; buf_offs = c->ihead_offs; buf_len = (c->max_idx_node_sz + (c->min_io_size + -1)) & - c->min_io_size; used = 0; avail = buf_len; next_len = ubifs_idx_node_sz((struct ubifs_info const *)c, cnext->child_cnt); if (buf_offs + next_len > c->leb_size) { err = ubifs_update_one_lp(c, lnum, -2147483647, 0, 0, 16); if (err != 0) { return (err); } else { } lnum = -1; } else { } ldv_27805: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared", 960, 0); _cond_resched(); znode = cnext; idx = (struct ubifs_idx_node *)c->cbuf + (unsigned long )used; idx->ch.node_type = 9U; idx->child_cnt = (unsigned short )znode->child_cnt; idx->level = (unsigned short )znode->level; i = 0; goto ldv_27801; ldv_27800: tmp = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, i); br = tmp; zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )i; key_write_idx((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key), (void *)(& br->key)); br->lnum = (unsigned int )zbr->lnum; br->offs = (unsigned int )zbr->offs; br->len = (unsigned int )zbr->len; if (zbr->lnum == 0 || zbr->len == 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad ref in znode\n", tmp___0->pid, "write_index"); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); if ((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)zbr->ldv_26076.znode); } else { } } else { } i = i + 1; ldv_27801: ; if (znode->child_cnt > i) { goto ldv_27800; } else { } len = ubifs_idx_node_sz((struct ubifs_info const *)c, znode->child_cnt); ubifs_prepare_node(c, (void *)idx, len, 0); if (lnum == -1) { tmp___1 = lnum_pos; lnum_pos = lnum_pos + 1; lnum = *(c->ilebs + (unsigned long )tmp___1); buf_offs = 0; used = 0; avail = buf_len; } else { } offs = buf_offs + used; if ((znode->lnum != lnum || znode->offs != offs) || znode->len != len) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: inconsistent znode posn\n", tmp___2->pid, "write_index"); return (-22); } else { } cnext = znode->cnext; tmp___4 = ubifs_zn_dirty((struct ubifs_znode const *)znode); tmp___5 = ldv__builtin_expect(tmp___4 == 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_index", 1005, tmp___3->pid); dump_stack(); } else { } tmp___7 = ubifs_zn_cow((struct ubifs_znode const *)znode); tmp___8 = ldv__builtin_expect(tmp___7 == 0, 0L); if (tmp___8 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_index", 1006, tmp___6->pid); dump_stack(); } else { } clear_bit(0, (unsigned long volatile *)(& znode->flags)); __asm__ volatile ("": : : "memory"); clear_bit(1, (unsigned long volatile *)(& znode->flags)); __asm__ volatile ("": : : "memory"); wlen = used + len; used = ((len + 7) & -8) + used; avail = avail - ((len + 7) & -8); if ((unsigned long )c->cnext == (unsigned long )cnext) { next_len = 0; } else { next_len = ubifs_idx_node_sz((struct ubifs_info const *)c, cnext->child_cnt); } nxt_offs = (buf_offs + used) + next_len; if (next_len != 0 && c->leb_size >= nxt_offs) { if (avail > 0) { goto ldv_27803; } else { blen = buf_len; } } else { wlen = (wlen + 7) & -8; blen = ((c->min_io_size + -1) + wlen) & - c->min_io_size; ubifs_pad((struct ubifs_info const *)c, c->cbuf + (unsigned long )wlen, blen - wlen); } err = ubifs_leb_write(c, lnum, (void const *)c->cbuf, buf_offs, blen); if (err != 0) { return (err); } else { } buf_offs = buf_offs + blen; if (next_len != 0) { if (c->leb_size < nxt_offs) { err = ubifs_update_one_lp(c, lnum, -2147483647, 0, 0, 16); if (err != 0) { return (err); } else { } lnum = -1; } else { } used = used - blen; if (used < 0) { used = 0; } else { } avail = buf_len - used; memmove(c->cbuf, (void const *)c->cbuf + (unsigned long )blen, (size_t )used); goto ldv_27803; } else { } goto ldv_27804; ldv_27803: ; goto ldv_27805; ldv_27804: ; if ((c->dbg)->new_ihead_lnum != lnum || (c->dbg)->new_ihead_offs != buf_offs) { tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: inconsistent ihead\n", tmp___9->pid, "write_index"); return (-22); } else { } c->ihead_lnum = lnum; c->ihead_offs = buf_offs; return (0); } } static void free_obsolete_znodes(struct ubifs_info *c ) { struct ubifs_znode *znode ; struct ubifs_znode *cnext ; int tmp ; { cnext = c->cnext; ldv_27811: znode = cnext; cnext = znode->cnext; tmp = ubifs_zn_obsolete((struct ubifs_znode const *)znode); if (tmp != 0) { kfree((void const *)znode); } else { znode->cnext = 0; atomic_long_inc(& c->clean_zn_cnt); atomic_long_inc(& ubifs_clean_zn_cnt); } if ((unsigned long )c->cnext != (unsigned long )cnext) { goto ldv_27811; } else { } return; } } static int return_gap_lebs(struct ubifs_info *c ) { int *p ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { if ((unsigned long )c->gap_lebs == (unsigned long )((int *)0)) { return (0); } else { } descriptor.modname = "ubifs"; descriptor.function = "return_gap_lebs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): \n"; descriptor.lineno = 1144U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): \n", tmp->pid); } else { } p = c->gap_lebs; goto ldv_27821; ldv_27820: err = ubifs_change_one_lp(c, *p, -2147483647, -2147483647, 0, 16, 0); if (err != 0) { return (err); } else { } p = p + 1; ldv_27821: ; if (*p != -1) { goto ldv_27820; } else { } kfree((void const *)c->gap_lebs); c->gap_lebs = 0; return (0); } } int ubifs_tnc_end_commit(struct ubifs_info *c ) { int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { if ((unsigned long )c->cnext == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } err = return_gap_lebs(c); if (err != 0) { return (err); } else { } err = write_index(c); if (err != 0) { return (err); } else { } ldv_mutex_lock_544(& c->tnc_mutex); descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_end_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): TNC height is %d\n"; descriptor.lineno = 1180U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): TNC height is %d\n", tmp->pid, (c->zroot.ldv_26076.znode)->level + 1); } else { } free_obsolete_znodes(c); c->cnext = 0; kfree((void const *)c->ilebs); c->ilebs = 0; ldv_mutex_unlock_545(& c->tnc_mutex); return (0); } } void ldv_mutex_lock_533(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_534(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_535(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_536(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_537(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_538(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_539(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_540(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_541(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_542(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_543(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_544(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_545(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_563(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_560(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_562(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_564(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_566(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_568(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_570(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_559(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_561(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_565(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_567(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_569(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_comp_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_comp_mutex(struct mutex *lock ) ; void ldv_mutex_lock_decomp_mutex(struct mutex *lock ) ; void ldv_mutex_unlock_decomp_mutex(struct mutex *lock ) ; extern struct crypto_tfm *crypto_alloc_base(char const * , u32 , u32 ) ; __inline static void crypto_free_tfm(struct crypto_tfm *tfm ) { { return; } } __inline static struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm ) { { return ((struct crypto_comp *)tfm); } } __inline static struct crypto_comp *crypto_alloc_comp(char const *alg_name , u32 type , u32 mask ) { struct crypto_tfm *tmp ; struct crypto_comp *tmp___0 ; { type = type & 4294967280U; type = type | 2U; mask = mask | 15U; tmp = crypto_alloc_base(alg_name, type, mask); tmp___0 = __crypto_comp_cast(tmp); return (tmp___0); } } __inline static struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm ) { { return (& tfm->base); } } __inline static void crypto_free_comp(struct crypto_comp *tfm ) { struct crypto_tfm *tmp ; { tmp = crypto_comp_tfm(tfm); crypto_free_tfm(tmp); return; } } __inline static struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm ) { struct crypto_tfm *tmp ; { tmp = crypto_comp_tfm(tfm); return (& tmp->crt_u.compress); } } __inline static int crypto_comp_compress(struct crypto_comp *tfm , u8 const *src , unsigned int slen , u8 *dst , unsigned int *dlen ) { struct compress_tfm *tmp ; struct crypto_tfm *tmp___0 ; int tmp___1 ; { tmp = crypto_comp_crt(tfm); tmp___0 = crypto_comp_tfm(tfm); tmp___1 = (*(tmp->cot_compress))(tmp___0, src, slen, dst, dlen); return (tmp___1); } } __inline static int crypto_comp_decompress(struct crypto_comp *tfm , u8 const *src , unsigned int slen , u8 *dst , unsigned int *dlen ) { struct compress_tfm *tmp ; struct crypto_tfm *tmp___0 ; int tmp___1 ; { tmp = crypto_comp_crt(tfm); tmp___0 = crypto_comp_tfm(tfm); tmp___1 = (*(tmp->cot_decompress))(tmp___0, src, slen, dst, dlen); return (tmp___1); } } struct ubifs_compressor *ubifs_compressors[3U] ; int ubifs_compressors_init(void) ; static struct ubifs_compressor none_compr = {0, 0, 0, 0, "none", ""}; static struct mutex lzo_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "lzo_mutex.wait_lock", 0, 0UL}}}}, {& lzo_mutex.wait_list, & lzo_mutex.wait_list}, 0, 0, (void *)(& lzo_mutex), {0, {0, 0}, "lzo_mutex", 0, 0UL}}; static struct ubifs_compressor lzo_compr = {1, 0, & lzo_mutex, 0, "lzo", "lzo"}; static struct mutex deflate_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "deflate_mutex.wait_lock", 0, 0UL}}}}, {& deflate_mutex.wait_list, & deflate_mutex.wait_list}, 0, 0, (void *)(& deflate_mutex), {0, {0, 0}, "deflate_mutex", 0, 0UL}}; static struct mutex inflate_mutex = {{1}, {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "inflate_mutex.wait_lock", 0, 0UL}}}}, {& inflate_mutex.wait_list, & inflate_mutex.wait_list}, 0, 0, (void *)(& inflate_mutex), {0, {0, 0}, "inflate_mutex", 0, 0UL}}; static struct ubifs_compressor zlib_compr = {2, 0, & deflate_mutex, & inflate_mutex, "zlib", "deflate"}; void ubifs_compress(void const *in_buf , int in_len , void *out_buf , int *out_len , int *compr_type ) { int err ; struct ubifs_compressor *compr ; struct task_struct *tmp ; long tmp___0 ; size_t __len ; void *__ret ; { compr = ubifs_compressors[*compr_type]; if (*compr_type == 0) { goto no_compr; } else { } if (in_len <= 127) { goto no_compr; } else { } if ((unsigned long )compr->comp_mutex != (unsigned long )((struct mutex *)0)) { ldv_mutex_lock_567(compr->comp_mutex); } else { } err = crypto_comp_compress(compr->cc, (u8 const *)in_buf, (unsigned int )in_len, (u8 *)out_buf, (unsigned int *)out_len); if ((unsigned long )compr->comp_mutex != (unsigned long )((struct mutex *)0)) { ldv_mutex_unlock_568(compr->comp_mutex); } else { } tmp___0 = ldv__builtin_expect(err != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\fUBIFS warning (pid %d): %s: cannot compress %d bytes, compressor %s, error %d, leave data uncompressed\n", tmp->pid, "ubifs_compress", in_len, compr->name, err); goto no_compr; } else { } if (in_len - *out_len <= 63) { goto no_compr; } else { } return; no_compr: __len = (size_t )in_len; __ret = memcpy(out_buf, in_buf, __len); *out_len = in_len; *compr_type = 0; return; } } int ubifs_decompress(void const *in_buf , int in_len , void *out_buf , int *out_len , int compr_type ) { int err ; struct ubifs_compressor *compr ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; size_t __len ; void *__ret ; struct task_struct *tmp___4 ; { tmp___0 = ldv__builtin_expect(compr_type < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: invalid compression type %d\n", tmp->pid, "ubifs_decompress", compr_type); return (-22); } else { tmp___1 = ldv__builtin_expect(compr_type > 2, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: invalid compression type %d\n", tmp->pid, "ubifs_decompress", compr_type); return (-22); } else { } } compr = ubifs_compressors[compr_type]; tmp___3 = ldv__builtin_expect((unsigned long )compr->capi_name == (unsigned long )((char const *)0), 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: %s compression is not compiled in\n", tmp___2->pid, "ubifs_decompress", compr->name); return (-22); } else { } if (compr_type == 0) { __len = (size_t )in_len; __ret = memcpy(out_buf, in_buf, __len); *out_len = in_len; return (0); } else { } if ((unsigned long )compr->decomp_mutex != (unsigned long )((struct mutex *)0)) { ldv_mutex_lock_569(compr->decomp_mutex); } else { } err = crypto_comp_decompress(compr->cc, (u8 const *)in_buf, (unsigned int )in_len, (u8 *)out_buf, (unsigned int *)out_len); if ((unsigned long )compr->decomp_mutex != (unsigned long )((struct mutex *)0)) { ldv_mutex_unlock_570(compr->decomp_mutex); } else { } if (err != 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot decompress %d bytes, compressor %s, error %d\n", tmp___4->pid, "ubifs_decompress", in_len, compr->name, err); } else { } return (err); } } static int compr_init(struct ubifs_compressor *compr ) { long tmp ; struct task_struct *tmp___0 ; long tmp___1 ; long tmp___2 ; { if ((unsigned long )compr->capi_name != (unsigned long )((char const *)0)) { compr->cc = crypto_alloc_comp(compr->capi_name, 0U, 0U); tmp___2 = IS_ERR((void const *)compr->cc); if (tmp___2 != 0L) { tmp = PTR_ERR((void const *)compr->cc); tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot initialize compressor %s, error %ld\n", tmp___0->pid, "compr_init", compr->name, tmp); tmp___1 = PTR_ERR((void const *)compr->cc); return ((int )tmp___1); } else { } } else { } ubifs_compressors[compr->compr_type] = compr; return (0); } } static void compr_exit(struct ubifs_compressor *compr ) { { if ((unsigned long )compr->capi_name != (unsigned long )((char const *)0)) { crypto_free_comp(compr->cc); } else { } return; } } int ubifs_compressors_init(void) { int err ; { err = compr_init(& lzo_compr); if (err != 0) { return (err); } else { } err = compr_init(& zlib_compr); if (err != 0) { goto out_lzo; } else { } ubifs_compressors[0] = & none_compr; return (0); out_lzo: compr_exit(& lzo_compr); return (err); } } void ubifs_compressors_exit(void) { { compr_exit(& lzo_compr); compr_exit(& zlib_compr); return; } } void ldv_main18_sequence_infinite_withcheck_stateful(void) { int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_28405; ldv_28404: tmp = __VERIFIER_nondet_int(); switch (tmp) { default: ; goto ldv_28403; } ldv_28403: ; ldv_28405: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_28404; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_559(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_560(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_561(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_562(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_563(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_564(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_565(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_566(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_567(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_comp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_568(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_comp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_569(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_decomp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_570(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_decomp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_587(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_584(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_586(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_588(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_590(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_583(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_585(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_589(struct mutex *ldv_func_arg1 ) ; void ubifs_pack_lsave(struct ubifs_info *c , void *buf , int *lsave ) ; void ubifs_pack_ltab(struct ubifs_info *c , void *buf , struct ubifs_lpt_lprops *ltab ) ; void ubifs_pack_pnode(struct ubifs_info *c , void *buf , struct ubifs_pnode *pnode ) ; void ubifs_pack_nnode(struct ubifs_info *c , void *buf , struct ubifs_nnode *nnode ) ; struct ubifs_pnode *ubifs_get_pnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) ; struct ubifs_nnode *ubifs_get_nnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) ; int ubifs_read_nnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) ; void ubifs_add_lpt_dirt(struct ubifs_info *c , int lnum , int dirty ) ; void ubifs_add_nnode_dirt(struct ubifs_info *c , struct ubifs_nnode *nnode ) ; uint32_t ubifs_unpack_bits(uint8_t **addr , int *pos , int nrbits ) ; int ubifs_unpack_nnode(struct ubifs_info const *c , void *buf , struct ubifs_nnode *nnode ) ; void ubifs_add_to_cat(struct ubifs_info *c , struct ubifs_lprops *lprops , int cat ) ; void ubifs_replace_cat(struct ubifs_info *c , struct ubifs_lprops *old_lprops , struct ubifs_lprops *new_lprops ) ; void ubifs_ensure_cat(struct ubifs_info *c , struct ubifs_lprops *lprops ) ; int ubifs_categorize_lprops(struct ubifs_info const *c , struct ubifs_lprops const *lprops ) ; void ubifs_dump_pnode(struct ubifs_info *c , struct ubifs_pnode *pnode , struct ubifs_nnode *parent , int iip ) ; int dbg_check_cats(struct ubifs_info *c ) ; int dbg_check_lpt_nodes(struct ubifs_info *c , struct ubifs_cnode *cnode , int row , int col ) ; extern u16 crc16(u16 , u8 const * , size_t ) ; static void do_calc_lpt_geom(struct ubifs_info *c ) { int i ; int n ; int bits ; int per_leb_wastage ; int max_pnode_cnt ; long long sz ; long long tot_wastage ; int tmp ; int __max1 ; int __max2 ; { n = (c->main_lebs + c->max_leb_cnt) - c->leb_cnt; max_pnode_cnt = (n + 3) / 4; c->lpt_hght = 1; n = 4; goto ldv_27506; ldv_27505: c->lpt_hght = c->lpt_hght + 1; n = n << 2; ldv_27506: ; if (n < max_pnode_cnt) { goto ldv_27505; } else { } c->pnode_cnt = (c->main_lebs + 3) / 4; n = (c->pnode_cnt + 3) / 4; c->nnode_cnt = n; i = 1; goto ldv_27509; ldv_27508: n = (n + 3) / 4; c->nnode_cnt = c->nnode_cnt + n; i = i + 1; ldv_27509: ; if (c->lpt_hght > i) { goto ldv_27508; } else { } tmp = fls(c->leb_size); c->space_bits = tmp + -3; c->lpt_lnum_bits = fls(c->lpt_lebs); c->lpt_offs_bits = fls(c->leb_size + -1); c->lpt_spc_bits = fls(c->leb_size); n = (c->max_leb_cnt + 3) / 4; c->pcnt_bits = fls(n + -1); c->lnum_bits = fls(c->max_leb_cnt + -1); bits = ((unsigned int )*((unsigned char *)c + 2048UL) != 0U ? c->pcnt_bits + 20 : 20) + (c->space_bits * 8 + 4); c->pnode_sz = (bits + 7) / 8; bits = ((unsigned int )*((unsigned char *)c + 2048UL) != 0U ? c->pcnt_bits + 20 : 20) + (c->lpt_lnum_bits + c->lpt_offs_bits) * 4; c->nnode_sz = (bits + 7) / 8; bits = (c->lpt_lebs * c->lpt_spc_bits + 10) * 2; c->ltab_sz = (bits + 7) / 8; bits = c->lnum_bits * c->lsave_cnt + 20; c->lsave_sz = (bits + 7) / 8; c->lpt_sz = (long long )c->pnode_cnt * (long long )c->pnode_sz; c->lpt_sz = c->lpt_sz + (long long )c->nnode_cnt * (long long )c->nnode_sz; c->lpt_sz = c->lpt_sz + (long long )c->ltab_sz; if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { c->lpt_sz = c->lpt_sz + (long long )c->lsave_sz; } else { } sz = c->lpt_sz; __max1 = c->pnode_sz; __max2 = c->nnode_sz; per_leb_wastage = __max1 > __max2 ? __max1 : __max2; sz = (long long )per_leb_wastage + sz; tot_wastage = (long long )per_leb_wastage; goto ldv_27515; ldv_27514: sz = (long long )per_leb_wastage + sz; sz = sz - (long long )c->leb_size; tot_wastage = (long long )per_leb_wastage + tot_wastage; ldv_27515: ; if ((long long )c->leb_size < sz) { goto ldv_27514; } else { } tot_wastage = (((((long long )c->min_io_size + -1LL) + sz) & - ((long long )c->min_io_size)) - sz) + tot_wastage; c->lpt_sz = c->lpt_sz + tot_wastage; return; } } int ubifs_calc_lpt_geom(struct ubifs_info *c ) { int lebs_needed ; long long sz ; u64 tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; { do_calc_lpt_geom(c); sz = c->lpt_sz * 2LL; tmp = div_u64((u64 )(((long long )c->leb_size + sz) + -1LL), (u32 )c->leb_size); lebs_needed = (int )tmp; if (c->lpt_lebs < lebs_needed) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: too few LPT LEBs\n", tmp___0->pid, "ubifs_calc_lpt_geom"); return (-22); } else { } if (c->ltab_sz > c->leb_size) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT ltab too big\n", tmp___1->pid, "ubifs_calc_lpt_geom"); return (-22); } else { } c->check_lpt_free = (int )c->big_lpt; return (0); } } static int calc_dflt_lpt_geom(struct ubifs_info *c , int *main_lebs , int *big_lpt ) { int i ; int lebs_needed ; long long sz ; u64 tmp ; struct task_struct *tmp___0 ; { c->lpt_lebs = 2; c->main_lebs = *main_lebs - c->lpt_lebs; if (c->main_lebs <= 0) { return (-22); } else { } c->big_lpt = 0U; do_calc_lpt_geom(c); if (c->lpt_sz > (long long )c->leb_size) { c->big_lpt = 1U; do_calc_lpt_geom(c); } else { } i = 0; goto ldv_27534; ldv_27533: sz = c->lpt_sz * 4LL; tmp = div_u64((u64 )(((long long )c->leb_size + sz) + -1LL), (u32 )c->leb_size); lebs_needed = (int )tmp; if (c->lpt_lebs < lebs_needed) { c->lpt_lebs = lebs_needed; c->main_lebs = *main_lebs - c->lpt_lebs; if (c->main_lebs <= 0) { return (-22); } else { } do_calc_lpt_geom(c); goto ldv_27531; } else { } if (c->ltab_sz > c->leb_size) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT ltab too big\n", tmp___0->pid, "calc_dflt_lpt_geom"); return (-22); } else { } *main_lebs = c->main_lebs; *big_lpt = (int )c->big_lpt; return (0); ldv_27531: i = i + 1; ldv_27534: ; if (i <= 63) { goto ldv_27533; } else { } return (-22); } } static void pack_bits(uint8_t **addr , int *pos , uint32_t val , int nrbits ) { uint8_t *p ; int b ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; { p = *addr; b = *pos; tmp___0 = ldv__builtin_expect(nrbits <= 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "pack_bits", 357, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(nrbits > 32, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "pack_bits", 358, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(*pos < 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "pack_bits", 359, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect(*pos > 7, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "pack_bits", 360, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect(val >> nrbits != 0U, 0L); if (tmp___8 != 0L) { tmp___9 = ldv__builtin_expect(nrbits != 32, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "pack_bits", 361, tmp___7->pid); dump_stack(); } else { } } else { } if (b != 0) { *p = (uint8_t )((int )((signed char )*p) | (int )((signed char )((int )((unsigned char )val) << b))); nrbits = nrbits + b; if (nrbits > 8) { p = p + 1; val = val >> (8 - b); *p = (unsigned char )val; if (nrbits > 16) { p = p + 1; val = val >> 8; *p = (unsigned char )val; if (nrbits > 24) { p = p + 1; val = val >> 8; *p = (unsigned char )val; if (nrbits > 32) { p = p + 1; val = val >> 8; *p = (unsigned char )val; } else { } } else { } } else { } } else { } } else { *p = (unsigned char )val; if (nrbits > 8) { p = p + 1; val = val >> 8; *p = (unsigned char )val; if (nrbits > 16) { p = p + 1; val = val >> 8; *p = (unsigned char )val; if (nrbits > 24) { p = p + 1; val = val >> 8; *p = (unsigned char )val; } else { } } else { } } else { } } b = nrbits & 7; if (b == 0) { p = p + 1; } else { } *addr = p; *pos = b; return; } } uint32_t ubifs_unpack_bits(uint8_t **addr , int *pos , int nrbits ) { int k ; uint8_t *p ; int b ; uint32_t val ; int bytes ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; long tmp___9 ; { k = 32 - nrbits; p = *addr; b = *pos; val = val; bytes = ((nrbits + b) + 7) >> 3; tmp___0 = ldv__builtin_expect(nrbits <= 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unpack_bits", 410, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(nrbits > 32, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unpack_bits", 411, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(*pos < 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unpack_bits", 412, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect(*pos > 7, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unpack_bits", 413, tmp___5->pid); dump_stack(); } else { } if (b != 0) { switch (bytes) { case 2: val = (uint32_t )*(p + 1UL); goto ldv_27557; case 3: val = (unsigned int )*(p + 1UL) | ((unsigned int )*(p + 2UL) << 8); goto ldv_27557; case 4: val = ((unsigned int )*(p + 1UL) | ((unsigned int )*(p + 2UL) << 8)) | ((unsigned int )*(p + 3UL) << 16); goto ldv_27557; case 5: val = (((unsigned int )*(p + 1UL) | ((unsigned int )*(p + 2UL) << 8)) | ((unsigned int )*(p + 3UL) << 16)) | ((unsigned int )*(p + 4UL) << 24); } ldv_27557: val = val << (8 - b); val = (uint32_t )((int )*p >> b) | val; nrbits = nrbits + b; } else { switch (bytes) { case 1: val = (uint32_t )*p; goto ldv_27562; case 2: val = (unsigned int )*p | ((unsigned int )*(p + 1UL) << 8); goto ldv_27562; case 3: val = ((unsigned int )*p | ((unsigned int )*(p + 1UL) << 8)) | ((unsigned int )*(p + 2UL) << 16); goto ldv_27562; case 4: val = (((unsigned int )*p | ((unsigned int )*(p + 1UL) << 8)) | ((unsigned int )*(p + 2UL) << 16)) | ((unsigned int )*(p + 3UL) << 24); goto ldv_27562; } ldv_27562: ; } val = val << k; val = val >> k; b = nrbits & 7; p = p + (unsigned long )(nrbits >> 3); *addr = p; *pos = b; tmp___8 = ldv__builtin_expect(val >> nrbits != 0U, 0L); if (tmp___8 != 0L) { tmp___9 = ldv__builtin_expect(nrbits - b != 32, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_unpack_bits", 459, tmp___7->pid); dump_stack(); } else { } } else { } return (val); } } void ubifs_pack_pnode(struct ubifs_info *c , void *buf , struct ubifs_pnode *pnode ) { uint8_t *addr ; int i ; int pos ; uint16_t crc ; { addr = (uint8_t *)buf + 2U; pos = 0; pack_bits(& addr, & pos, 0U, 4); if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { pack_bits(& addr, & pos, (uint32_t )pnode->num, c->pcnt_bits); } else { } i = 0; goto ldv_27576; ldv_27575: pack_bits(& addr, & pos, (uint32_t )(pnode->lprops[i].free >> 3), c->space_bits); pack_bits(& addr, & pos, (uint32_t )(pnode->lprops[i].dirty >> 3), c->space_bits); if ((pnode->lprops[i].flags & 32) != 0) { pack_bits(& addr, & pos, 1U, 1); } else { pack_bits(& addr, & pos, 0U, 1); } i = i + 1; ldv_27576: ; if (i <= 3) { goto ldv_27575; } else { } crc = crc16(65535, (u8 const *)buf + 2U, (size_t )(c->pnode_sz + -2)); addr = (uint8_t *)buf; pos = 0; pack_bits(& addr, & pos, (uint32_t )crc, 16); return; } } void ubifs_pack_nnode(struct ubifs_info *c , void *buf , struct ubifs_nnode *nnode ) { uint8_t *addr ; int i ; int pos ; uint16_t crc ; int lnum ; { addr = (uint8_t *)buf + 2U; pos = 0; pack_bits(& addr, & pos, 1U, 4); if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { pack_bits(& addr, & pos, (uint32_t )nnode->num, c->pcnt_bits); } else { } i = 0; goto ldv_27589; ldv_27588: lnum = nnode->nbranch[i].lnum; if (lnum == 0) { lnum = c->lpt_last + 1; } else { } pack_bits(& addr, & pos, (uint32_t )(lnum - c->lpt_first), c->lpt_lnum_bits); pack_bits(& addr, & pos, (uint32_t )nnode->nbranch[i].offs, c->lpt_offs_bits); i = i + 1; ldv_27589: ; if (i <= 3) { goto ldv_27588; } else { } crc = crc16(65535, (u8 const *)buf + 2U, (size_t )(c->nnode_sz + -2)); addr = (uint8_t *)buf; pos = 0; pack_bits(& addr, & pos, (uint32_t )crc, 16); return; } } void ubifs_pack_ltab(struct ubifs_info *c , void *buf , struct ubifs_lpt_lprops *ltab ) { uint8_t *addr ; int i ; int pos ; uint16_t crc ; { addr = (uint8_t *)buf + 2U; pos = 0; pack_bits(& addr, & pos, 2U, 4); i = 0; goto ldv_27601; ldv_27600: pack_bits(& addr, & pos, (uint32_t )(ltab + (unsigned long )i)->free, c->lpt_spc_bits); pack_bits(& addr, & pos, (uint32_t )(ltab + (unsigned long )i)->dirty, c->lpt_spc_bits); i = i + 1; ldv_27601: ; if (c->lpt_lebs > i) { goto ldv_27600; } else { } crc = crc16(65535, (u8 const *)buf + 2U, (size_t )(c->ltab_sz + -2)); addr = (uint8_t *)buf; pos = 0; pack_bits(& addr, & pos, (uint32_t )crc, 16); return; } } void ubifs_pack_lsave(struct ubifs_info *c , void *buf , int *lsave ) { uint8_t *addr ; int i ; int pos ; uint16_t crc ; { addr = (uint8_t *)buf + 2U; pos = 0; pack_bits(& addr, & pos, 3U, 4); i = 0; goto ldv_27613; ldv_27612: pack_bits(& addr, & pos, (uint32_t )*(lsave + (unsigned long )i), c->lnum_bits); i = i + 1; ldv_27613: ; if (c->lsave_cnt > i) { goto ldv_27612; } else { } crc = crc16(65535, (u8 const *)buf + 2U, (size_t )(c->lsave_sz + -2)); addr = (uint8_t *)buf; pos = 0; pack_bits(& addr, & pos, (uint32_t )crc, 16); return; } } void ubifs_add_lpt_dirt(struct ubifs_info *c , int lnum , int dirty ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; { if (dirty == 0 || lnum == 0) { return; } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_add_lpt_dirt"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d add %d to %d\n"; descriptor.lineno = 586U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d add %d to %d\n", tmp->pid, lnum, dirty, (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty); } else { } tmp___2 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_lpt_dirt", 587, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_lpt_dirt", 587, tmp___1->pid); dump_stack(); } else { } } (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty = (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty + dirty; return; } } static void set_ltab(struct ubifs_info *c , int lnum , int free , int dirty ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; { descriptor.modname = "ubifs"; descriptor.function = "set_ltab"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d free %d dirty %d to %d %d\n"; descriptor.lineno = 602U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d free %d dirty %d to %d %d\n", tmp->pid, lnum, (c->ltab + (unsigned long )(lnum - c->lpt_first))->free, (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty, free, dirty); } else { } tmp___2 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "set_ltab", 603, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "set_ltab", 603, tmp___1->pid); dump_stack(); } else { } } (c->ltab + (unsigned long )(lnum - c->lpt_first))->free = free; (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty = dirty; return; } } void ubifs_add_nnode_dirt(struct ubifs_info *c , struct ubifs_nnode *nnode ) { struct ubifs_nnode *np ; { np = nnode->parent; if ((unsigned long )np != (unsigned long )((struct ubifs_nnode *)0)) { ubifs_add_lpt_dirt(c, np->nbranch[nnode->iip].lnum, c->nnode_sz); } else { ubifs_add_lpt_dirt(c, c->lpt_lnum, c->nnode_sz); if ((c->lpt_drty_flgs & 1) == 0) { c->lpt_drty_flgs = c->lpt_drty_flgs | 1; ubifs_add_lpt_dirt(c, c->ltab_lnum, c->ltab_sz); } else { } } return; } } static void add_pnode_dirt(struct ubifs_info *c , struct ubifs_pnode *pnode ) { { ubifs_add_lpt_dirt(c, (pnode->parent)->nbranch[pnode->iip].lnum, c->pnode_sz); return; } } static int calc_nnode_num(int row , int col ) { int num ; int bits ; int tmp ; { num = 1; goto ldv_27646; ldv_27645: bits = col & 3; col = col >> 2; num = num << 2; num = num | bits; ldv_27646: tmp = row; row = row - 1; if (tmp != 0) { goto ldv_27645; } else { } return (num); } } static int calc_nnode_num_from_parent(struct ubifs_info const *c , struct ubifs_nnode *parent , int iip ) { int num ; int shft ; { if ((unsigned long )parent == (unsigned long )((struct ubifs_nnode *)0)) { return (1); } else { } shft = ((int )c->lpt_hght - parent->level) * 2; num = parent->num ^ (1 << shft); num = ((iip + 4) << shft) | num; return (num); } } static int calc_pnode_num_from_parent(struct ubifs_info const *c , struct ubifs_nnode *parent , int iip ) { int i ; int n ; int pnum ; int num ; { n = (int )c->lpt_hght + -1; pnum = parent->num; num = 0; i = 0; goto ldv_27665; ldv_27664: num = num << 2; num = (pnum & 3) | num; pnum = pnum >> 2; i = i + 1; ldv_27665: ; if (i < n) { goto ldv_27664; } else { } num = num << 2; num = num | iip; return (num); } } int ubifs_create_dflt_lpt(struct ubifs_info *c , int *main_lebs , int lpt_first , int *lpt_lebs , int *big_lpt ) { int lnum ; int err ; int node_sz ; int iopos ; int i ; int j ; int cnt ; int len ; int alen ; int row ; int blnum ; int boffs ; int bsz ; int bcnt ; struct ubifs_pnode *pnode ; struct ubifs_nnode *nnode ; void *buf ; void *p ; struct ubifs_lpt_lprops *ltab ; int *lsave ; void *tmp ; void *tmp___0 ; void *tmp___1 ; void *tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; int tmp___9 ; struct _ddebug descriptor ; struct task_struct *tmp___10 ; long tmp___11 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___12 ; long tmp___13 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___14 ; long tmp___15 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___16 ; long tmp___17 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___18 ; long tmp___19 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___20 ; long tmp___21 ; struct _ddebug descriptor___5 ; struct task_struct *tmp___22 ; long tmp___23 ; struct _ddebug descriptor___6 ; struct task_struct *tmp___24 ; long tmp___25 ; struct _ddebug descriptor___7 ; struct task_struct *tmp___26 ; long tmp___27 ; struct _ddebug descriptor___8 ; struct task_struct *tmp___28 ; long tmp___29 ; struct _ddebug descriptor___9 ; struct task_struct *tmp___30 ; long tmp___31 ; struct _ddebug descriptor___10 ; struct task_struct *tmp___32 ; long tmp___33 ; struct _ddebug descriptor___11 ; struct task_struct *tmp___34 ; long tmp___35 ; struct _ddebug descriptor___12 ; struct task_struct *tmp___36 ; long tmp___37 ; struct _ddebug descriptor___13 ; struct task_struct *tmp___38 ; long tmp___39 ; struct _ddebug descriptor___14 ; struct task_struct *tmp___40 ; long tmp___41 ; struct _ddebug descriptor___15 ; struct task_struct *tmp___42 ; long tmp___43 ; { err = 0; pnode = 0; nnode = 0; buf = 0; ltab = 0; lsave = 0; err = calc_dflt_lpt_geom(c, main_lebs, big_lpt); if (err != 0) { return (err); } else { } *lpt_lebs = c->lpt_lebs; c->lpt_first = lpt_first; c->lpt_last = (c->lpt_lebs + lpt_first) + -1; c->main_first = c->leb_cnt - *main_lebs; tmp = kmalloc((unsigned long )c->lsave_cnt * 4UL, 208U); lsave = (int *)tmp; tmp___0 = kzalloc(168UL, 208U); pnode = (struct ubifs_pnode *)tmp___0; tmp___1 = kzalloc(104UL, 208U); nnode = (struct ubifs_nnode *)tmp___1; buf = vmalloc((unsigned long )c->leb_size); tmp___2 = vmalloc((unsigned long )c->lpt_lebs * 12UL); ltab = (struct ubifs_lpt_lprops *)tmp___2; if (((((unsigned long )pnode == (unsigned long )((struct ubifs_pnode *)0) || (unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) || (unsigned long )buf == (unsigned long )((void *)0)) || (unsigned long )ltab == (unsigned long )((struct ubifs_lpt_lprops *)0)) || (unsigned long )lsave == (unsigned long )((int *)0)) { err = -12; goto out; } else { } tmp___4 = ldv__builtin_expect((unsigned long )c->ltab != (unsigned long )((struct ubifs_lpt_lprops *)0), 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_create_dflt_lpt", 760, tmp___3->pid); dump_stack(); } else { } c->ltab = ltab; i = 0; goto ldv_27697; ldv_27696: (ltab + (unsigned long )i)->free = c->leb_size; (ltab + (unsigned long )i)->dirty = 0; (ltab + (unsigned long )i)->tgc = 0U; (ltab + (unsigned long )i)->cmt = 0U; i = i + 1; ldv_27697: ; if (c->lpt_lebs > i) { goto ldv_27696; } else { } lnum = lpt_first; p = buf; cnt = c->pnode_cnt; tmp___5 = ubifs_idx_node_sz((struct ubifs_info const *)c, 1); node_sz = (tmp___5 + 7) & -8; iopos = ((c->min_io_size + -1) + node_sz) & - c->min_io_size; pnode->lprops[0].free = c->leb_size - iopos; pnode->lprops[0].dirty = iopos - node_sz; pnode->lprops[0].flags = 32; node_sz = 160; iopos = ((c->min_io_size + -1) + node_sz) & - c->min_io_size; pnode->lprops[1].free = c->leb_size - iopos; pnode->lprops[1].dirty = iopos - node_sz; i = 2; goto ldv_27700; ldv_27699: pnode->lprops[i].free = c->leb_size; i = i + 1; ldv_27700: ; if (i <= 3) { goto ldv_27699; } else { } ubifs_pack_pnode(c, p, pnode); p = p + (unsigned long )c->pnode_sz; len = c->pnode_sz; pnode->num = pnode->num + 1; pnode->lprops[0].free = c->leb_size; pnode->lprops[0].dirty = 0; pnode->lprops[0].flags = 0; pnode->lprops[1].free = c->leb_size; pnode->lprops[1].dirty = 0; blnum = lnum; boffs = 0; bcnt = cnt; bsz = c->pnode_sz; i = 1; goto ldv_27703; ldv_27702: ; if (c->pnode_sz + len > c->leb_size) { alen = ((c->min_io_size + -1) + len) & - c->min_io_size; set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 255, (size_t )(alen - len)); tmp___6 = lnum; lnum = lnum + 1; err = ubifs_leb_change(c, tmp___6, (void const *)buf, alen); if (err != 0) { goto out; } else { } p = buf; len = 0; } else { } ubifs_pack_pnode(c, p, pnode); p = p + (unsigned long )c->pnode_sz; len = c->pnode_sz + len; pnode->num = pnode->num + 1; i = i + 1; ldv_27703: ; if (i < cnt) { goto ldv_27702; } else { } row = 0; i = 4; goto ldv_27706; ldv_27705: row = row + 1; i = i << 2; ldv_27706: ; if (cnt > i) { goto ldv_27705; } else { } ldv_27715: cnt = (cnt + 3) / 4; i = 0; goto ldv_27712; ldv_27711: ; if (c->nnode_sz + len > c->leb_size) { alen = ((c->min_io_size + -1) + len) & - c->min_io_size; set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 255, (size_t )(alen - len)); tmp___7 = lnum; lnum = lnum + 1; err = ubifs_leb_change(c, tmp___7, (void const *)buf, alen); if (err != 0) { goto out; } else { } p = buf; len = 0; } else { } if (cnt == 1) { c->lpt_lnum = lnum; c->lpt_offs = len; } else { } j = 0; goto ldv_27709; ldv_27708: ; if (bcnt != 0) { if (boffs + bsz > c->leb_size) { blnum = blnum + 1; boffs = 0; } else { } nnode->nbranch[j].lnum = blnum; nnode->nbranch[j].offs = boffs; boffs = boffs + bsz; bcnt = bcnt - 1; } else { nnode->nbranch[j].lnum = 0; nnode->nbranch[j].offs = 0; } j = j + 1; ldv_27709: ; if (j <= 3) { goto ldv_27708; } else { } nnode->num = calc_nnode_num(row, i); ubifs_pack_nnode(c, p, nnode); p = p + (unsigned long )c->nnode_sz; len = c->nnode_sz + len; i = i + 1; ldv_27712: ; if (i < cnt) { goto ldv_27711; } else { } if (cnt == 1) { goto ldv_27714; } else { } bcnt = cnt; bsz = c->nnode_sz; row = row + -1; goto ldv_27715; ldv_27714: ; if (*big_lpt != 0) { if (c->lsave_sz + len > c->leb_size) { alen = ((c->min_io_size + -1) + len) & - c->min_io_size; set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 255, (size_t )(alen - len)); tmp___8 = lnum; lnum = lnum + 1; err = ubifs_leb_change(c, tmp___8, (void const *)buf, alen); if (err != 0) { goto out; } else { } p = buf; len = 0; } else { } c->lsave_lnum = lnum; c->lsave_offs = len; i = 0; goto ldv_27717; ldv_27716: *(lsave + (unsigned long )i) = c->main_first + i; i = i + 1; ldv_27717: ; if (c->lsave_cnt > i && *main_lebs > i) { goto ldv_27716; } else { } goto ldv_27720; ldv_27719: *(lsave + (unsigned long )i) = c->main_first; i = i + 1; ldv_27720: ; if (c->lsave_cnt > i) { goto ldv_27719; } else { } ubifs_pack_lsave(c, p, lsave); p = p + (unsigned long )c->lsave_sz; len = c->lsave_sz + len; } else { } if (c->ltab_sz + len > c->leb_size) { alen = ((c->min_io_size + -1) + len) & - c->min_io_size; set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 255, (size_t )(alen - len)); tmp___9 = lnum; lnum = lnum + 1; err = ubifs_leb_change(c, tmp___9, (void const *)buf, alen); if (err != 0) { goto out; } else { } p = buf; len = 0; } else { } c->ltab_lnum = lnum; c->ltab_offs = len; len = c->ltab_sz + len; alen = ((c->min_io_size + -1) + len) & - c->min_io_size; set_ltab(c, lnum, c->leb_size - alen, alen - len); ubifs_pack_ltab(c, p, ltab); p = p + (unsigned long )c->ltab_sz; memset(p, 255, (size_t )(alen - len)); err = ubifs_leb_change(c, lnum, (void const *)buf, alen); if (err != 0) { goto out; } else { } c->nhead_lnum = lnum; c->nhead_offs = ((c->min_io_size + -1) + len) & - c->min_io_size; descriptor.modname = "ubifs"; descriptor.function = "ubifs_create_dflt_lpt"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): space_bits %d\n"; descriptor.lineno = 952U; descriptor.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): space_bits %d\n", tmp___10->pid, c->space_bits); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_create_dflt_lpt"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___0.format = "UBIFS DBG lp (pid %d): lpt_lnum_bits %d\n"; descriptor___0.lineno = 953U; descriptor___0.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG lp (pid %d): lpt_lnum_bits %d\n", tmp___12->pid, c->lpt_lnum_bits); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_create_dflt_lpt"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___1.format = "UBIFS DBG lp (pid %d): lpt_offs_bits %d\n"; descriptor___1.lineno = 954U; descriptor___1.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG lp (pid %d): lpt_offs_bits %d\n", tmp___14->pid, c->lpt_offs_bits); } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_create_dflt_lpt"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___2.format = "UBIFS DBG lp (pid %d): lpt_spc_bits %d\n"; descriptor___2.lineno = 955U; descriptor___2.flags = 0U; tmp___17 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG lp (pid %d): lpt_spc_bits %d\n", tmp___16->pid, c->lpt_spc_bits); } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_create_dflt_lpt"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___3.format = "UBIFS DBG lp (pid %d): pcnt_bits %d\n"; descriptor___3.lineno = 956U; descriptor___3.flags = 0U; tmp___19 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___19 != 0L) { tmp___18 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG lp (pid %d): pcnt_bits %d\n", tmp___18->pid, c->pcnt_bits); } else { } descriptor___4.modname = "ubifs"; descriptor___4.function = "ubifs_create_dflt_lpt"; descriptor___4.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___4.format = "UBIFS DBG lp (pid %d): lnum_bits %d\n"; descriptor___4.lineno = 957U; descriptor___4.flags = 0U; tmp___21 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___21 != 0L) { tmp___20 = get_current(); __dynamic_pr_debug(& descriptor___4, "UBIFS DBG lp (pid %d): lnum_bits %d\n", tmp___20->pid, c->lnum_bits); } else { } descriptor___5.modname = "ubifs"; descriptor___5.function = "ubifs_create_dflt_lpt"; descriptor___5.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___5.format = "UBIFS DBG lp (pid %d): pnode_sz %d\n"; descriptor___5.lineno = 958U; descriptor___5.flags = 0U; tmp___23 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); if (tmp___23 != 0L) { tmp___22 = get_current(); __dynamic_pr_debug(& descriptor___5, "UBIFS DBG lp (pid %d): pnode_sz %d\n", tmp___22->pid, c->pnode_sz); } else { } descriptor___6.modname = "ubifs"; descriptor___6.function = "ubifs_create_dflt_lpt"; descriptor___6.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___6.format = "UBIFS DBG lp (pid %d): nnode_sz %d\n"; descriptor___6.lineno = 959U; descriptor___6.flags = 0U; tmp___25 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); if (tmp___25 != 0L) { tmp___24 = get_current(); __dynamic_pr_debug(& descriptor___6, "UBIFS DBG lp (pid %d): nnode_sz %d\n", tmp___24->pid, c->nnode_sz); } else { } descriptor___7.modname = "ubifs"; descriptor___7.function = "ubifs_create_dflt_lpt"; descriptor___7.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___7.format = "UBIFS DBG lp (pid %d): ltab_sz %d\n"; descriptor___7.lineno = 960U; descriptor___7.flags = 0U; tmp___27 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); __dynamic_pr_debug(& descriptor___7, "UBIFS DBG lp (pid %d): ltab_sz %d\n", tmp___26->pid, c->ltab_sz); } else { } descriptor___8.modname = "ubifs"; descriptor___8.function = "ubifs_create_dflt_lpt"; descriptor___8.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___8.format = "UBIFS DBG lp (pid %d): lsave_sz %d\n"; descriptor___8.lineno = 961U; descriptor___8.flags = 0U; tmp___29 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); if (tmp___29 != 0L) { tmp___28 = get_current(); __dynamic_pr_debug(& descriptor___8, "UBIFS DBG lp (pid %d): lsave_sz %d\n", tmp___28->pid, c->lsave_sz); } else { } descriptor___9.modname = "ubifs"; descriptor___9.function = "ubifs_create_dflt_lpt"; descriptor___9.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___9.format = "UBIFS DBG lp (pid %d): lsave_cnt %d\n"; descriptor___9.lineno = 962U; descriptor___9.flags = 0U; tmp___31 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); if (tmp___31 != 0L) { tmp___30 = get_current(); __dynamic_pr_debug(& descriptor___9, "UBIFS DBG lp (pid %d): lsave_cnt %d\n", tmp___30->pid, c->lsave_cnt); } else { } descriptor___10.modname = "ubifs"; descriptor___10.function = "ubifs_create_dflt_lpt"; descriptor___10.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___10.format = "UBIFS DBG lp (pid %d): lpt_hght %d\n"; descriptor___10.lineno = 963U; descriptor___10.flags = 0U; tmp___33 = ldv__builtin_expect((long )descriptor___10.flags & 1L, 0L); if (tmp___33 != 0L) { tmp___32 = get_current(); __dynamic_pr_debug(& descriptor___10, "UBIFS DBG lp (pid %d): lpt_hght %d\n", tmp___32->pid, c->lpt_hght); } else { } descriptor___11.modname = "ubifs"; descriptor___11.function = "ubifs_create_dflt_lpt"; descriptor___11.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___11.format = "UBIFS DBG lp (pid %d): big_lpt %d\n"; descriptor___11.lineno = 964U; descriptor___11.flags = 0U; tmp___35 = ldv__builtin_expect((long )descriptor___11.flags & 1L, 0L); if (tmp___35 != 0L) { tmp___34 = get_current(); __dynamic_pr_debug(& descriptor___11, "UBIFS DBG lp (pid %d): big_lpt %d\n", tmp___34->pid, (int )c->big_lpt); } else { } descriptor___12.modname = "ubifs"; descriptor___12.function = "ubifs_create_dflt_lpt"; descriptor___12.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___12.format = "UBIFS DBG lp (pid %d): LPT root is at %d:%d\n"; descriptor___12.lineno = 965U; descriptor___12.flags = 0U; tmp___37 = ldv__builtin_expect((long )descriptor___12.flags & 1L, 0L); if (tmp___37 != 0L) { tmp___36 = get_current(); __dynamic_pr_debug(& descriptor___12, "UBIFS DBG lp (pid %d): LPT root is at %d:%d\n", tmp___36->pid, c->lpt_lnum, c->lpt_offs); } else { } descriptor___13.modname = "ubifs"; descriptor___13.function = "ubifs_create_dflt_lpt"; descriptor___13.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___13.format = "UBIFS DBG lp (pid %d): LPT head is at %d:%d\n"; descriptor___13.lineno = 966U; descriptor___13.flags = 0U; tmp___39 = ldv__builtin_expect((long )descriptor___13.flags & 1L, 0L); if (tmp___39 != 0L) { tmp___38 = get_current(); __dynamic_pr_debug(& descriptor___13, "UBIFS DBG lp (pid %d): LPT head is at %d:%d\n", tmp___38->pid, c->nhead_lnum, c->nhead_offs); } else { } descriptor___14.modname = "ubifs"; descriptor___14.function = "ubifs_create_dflt_lpt"; descriptor___14.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___14.format = "UBIFS DBG lp (pid %d): LPT ltab is at %d:%d\n"; descriptor___14.lineno = 967U; descriptor___14.flags = 0U; tmp___41 = ldv__builtin_expect((long )descriptor___14.flags & 1L, 0L); if (tmp___41 != 0L) { tmp___40 = get_current(); __dynamic_pr_debug(& descriptor___14, "UBIFS DBG lp (pid %d): LPT ltab is at %d:%d\n", tmp___40->pid, c->ltab_lnum, c->ltab_offs); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { descriptor___15.modname = "ubifs"; descriptor___15.function = "ubifs_create_dflt_lpt"; descriptor___15.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___15.format = "UBIFS DBG lp (pid %d): LPT lsave is at %d:%d\n"; descriptor___15.lineno = 969U; descriptor___15.flags = 0U; tmp___43 = ldv__builtin_expect((long )descriptor___15.flags & 1L, 0L); if (tmp___43 != 0L) { tmp___42 = get_current(); __dynamic_pr_debug(& descriptor___15, "UBIFS DBG lp (pid %d): LPT lsave is at %d:%d\n", tmp___42->pid, c->lsave_lnum, c->lsave_offs); } else { } } else { } out: c->ltab = 0; kfree((void const *)lsave); vfree((void const *)ltab); vfree((void const *)buf); kfree((void const *)nnode); kfree((void const *)pnode); return (err); } } static void update_cats(struct ubifs_info *c , struct ubifs_pnode *pnode ) { int i ; int cat ; int lnum ; { i = 0; goto ldv_27747; ldv_27746: cat = pnode->lprops[i].flags & 15; lnum = pnode->lprops[i].lnum; if (lnum == 0) { return; } else { } ubifs_add_to_cat(c, (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )i, cat); i = i + 1; ldv_27747: ; if (i <= 3) { goto ldv_27746; } else { } return; } } static void replace_cats(struct ubifs_info *c , struct ubifs_pnode *old_pnode , struct ubifs_pnode *new_pnode ) { int i ; { i = 0; goto ldv_27756; ldv_27755: ; if (new_pnode->lprops[i].lnum == 0) { return; } else { } ubifs_replace_cat(c, (struct ubifs_lprops *)(& old_pnode->lprops) + (unsigned long )i, (struct ubifs_lprops *)(& new_pnode->lprops) + (unsigned long )i); i = i + 1; ldv_27756: ; if (i <= 3) { goto ldv_27755; } else { } return; } } static int check_lpt_crc(void *buf , int len ) { int pos ; uint8_t *addr ; uint16_t crc ; uint16_t calc_crc ; uint32_t tmp ; struct task_struct *tmp___0 ; { pos = 0; addr = (uint8_t *)buf; tmp = ubifs_unpack_bits(& addr, & pos, 16); crc = (uint16_t )tmp; calc_crc = crc16(65535, (u8 const *)buf + 2U, (size_t )(len + -2)); if ((int )crc != (int )calc_crc) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: invalid crc in LPT node: crc %hx calc %hx\n", tmp___0->pid, "check_lpt_crc", (int )crc, (int )calc_crc); dump_stack(); return (-22); } else { } return (0); } } static int check_lpt_type(uint8_t **addr , int *pos , int type ) { int node_type ; uint32_t tmp ; struct task_struct *tmp___0 ; { tmp = ubifs_unpack_bits(addr, pos, 4); node_type = (int )tmp; if (node_type != type) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: invalid type (%d) in LPT node type %d\n", tmp___0->pid, "check_lpt_type", node_type, type); dump_stack(); return (-22); } else { } return (0); } } static int unpack_pnode(struct ubifs_info const *c , void *buf , struct ubifs_pnode *pnode ) { uint8_t *addr ; int i ; int pos ; int err ; uint32_t tmp ; struct ubifs_lprops *lprops ; uint32_t tmp___0 ; uint32_t tmp___1 ; uint32_t tmp___2 ; int tmp___3 ; { addr = (uint8_t *)buf + 2U; pos = 0; err = check_lpt_type(& addr, & pos, 0); if (err != 0) { return (err); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { tmp = ubifs_unpack_bits(& addr, & pos, c->pcnt_bits); pnode->num = (int )tmp; } else { } i = 0; goto ldv_27785; ldv_27784: lprops = (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )i; tmp___0 = ubifs_unpack_bits(& addr, & pos, c->space_bits); lprops->free = (int )tmp___0; lprops->free = lprops->free << 3; tmp___1 = ubifs_unpack_bits(& addr, & pos, c->space_bits); lprops->dirty = (int )tmp___1; lprops->dirty = lprops->dirty << 3; tmp___2 = ubifs_unpack_bits(& addr, & pos, 1); if (tmp___2 != 0U) { lprops->flags = 32; } else { lprops->flags = 0; } tmp___3 = ubifs_categorize_lprops(c, (struct ubifs_lprops const *)lprops); lprops->flags = lprops->flags | tmp___3; i = i + 1; ldv_27785: ; if (i <= 3) { goto ldv_27784; } else { } err = check_lpt_crc(buf, c->pnode_sz); return (err); } } int ubifs_unpack_nnode(struct ubifs_info const *c , void *buf , struct ubifs_nnode *nnode ) { uint8_t *addr ; int i ; int pos ; int err ; uint32_t tmp ; int lnum ; uint32_t tmp___0 ; uint32_t tmp___1 ; { addr = (uint8_t *)buf + 2U; pos = 0; err = check_lpt_type(& addr, & pos, 1); if (err != 0) { return (err); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { tmp = ubifs_unpack_bits(& addr, & pos, c->pcnt_bits); nnode->num = (int )tmp; } else { } i = 0; goto ldv_27798; ldv_27797: tmp___0 = ubifs_unpack_bits(& addr, & pos, c->lpt_lnum_bits); lnum = (int )(tmp___0 + (uint32_t )c->lpt_first); if ((int )c->lpt_last + 1 == lnum) { lnum = 0; } else { } nnode->nbranch[i].lnum = lnum; tmp___1 = ubifs_unpack_bits(& addr, & pos, c->lpt_offs_bits); nnode->nbranch[i].offs = (int )tmp___1; i = i + 1; ldv_27798: ; if (i <= 3) { goto ldv_27797; } else { } err = check_lpt_crc(buf, c->nnode_sz); return (err); } } static int unpack_ltab(struct ubifs_info const *c , void *buf ) { uint8_t *addr ; int i ; int pos ; int err ; int free ; uint32_t tmp ; int dirty ; uint32_t tmp___0 ; { addr = (uint8_t *)buf + 2U; pos = 0; err = check_lpt_type(& addr, & pos, 2); if (err != 0) { return (err); } else { } i = 0; goto ldv_27811; ldv_27810: tmp = ubifs_unpack_bits(& addr, & pos, c->lpt_spc_bits); free = (int )tmp; tmp___0 = ubifs_unpack_bits(& addr, & pos, c->lpt_spc_bits); dirty = (int )tmp___0; if ((((free < 0 || (int )c->leb_size < free) || dirty < 0) || (int )c->leb_size < dirty) || free + dirty > (int )c->leb_size) { return (-22); } else { } (c->ltab + (unsigned long )i)->free = free; (c->ltab + (unsigned long )i)->dirty = dirty; (c->ltab + (unsigned long )i)->tgc = 0U; (c->ltab + (unsigned long )i)->cmt = 0U; i = i + 1; ldv_27811: ; if ((int )c->lpt_lebs > i) { goto ldv_27810; } else { } err = check_lpt_crc(buf, c->ltab_sz); return (err); } } static int unpack_lsave(struct ubifs_info const *c , void *buf ) { uint8_t *addr ; int i ; int pos ; int err ; int lnum ; uint32_t tmp ; { addr = (uint8_t *)buf + 2U; pos = 0; err = check_lpt_type(& addr, & pos, 3); if (err != 0) { return (err); } else { } i = 0; goto ldv_27823; ldv_27822: tmp = ubifs_unpack_bits(& addr, & pos, c->lnum_bits); lnum = (int )tmp; if ((int )c->main_first > lnum || (int )c->leb_cnt <= lnum) { return (-22); } else { } *(c->lsave + (unsigned long )i) = lnum; i = i + 1; ldv_27823: ; if ((int )c->lsave_cnt > i) { goto ldv_27822; } else { } err = check_lpt_crc(buf, c->lsave_sz); return (err); } } static int validate_nnode(struct ubifs_info const *c , struct ubifs_nnode *nnode , struct ubifs_nnode *parent , int iip ) { int i ; int lvl ; int max_offs ; int num ; int tmp ; int lnum ; int offs ; { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { tmp = calc_nnode_num_from_parent(c, parent, iip); num = tmp; if (nnode->num != num) { return (-22); } else { } } else { } lvl = (unsigned long )parent != (unsigned long )((struct ubifs_nnode *)0) ? (int const )(parent->level + -1) : c->lpt_hght; if (lvl <= 0) { return (-22); } else { } if (lvl == 1) { max_offs = (int )c->leb_size - (int )c->pnode_sz; } else { max_offs = (int )c->leb_size - (int )c->nnode_sz; } i = 0; goto ldv_27839; ldv_27838: lnum = nnode->nbranch[i].lnum; offs = nnode->nbranch[i].offs; if (lnum == 0) { if (offs != 0) { return (-22); } else { } goto ldv_27837; } else { } if ((int )c->lpt_first > lnum || (int )c->lpt_last < lnum) { return (-22); } else { } if (offs < 0 || offs > max_offs) { return (-22); } else { } ldv_27837: i = i + 1; ldv_27839: ; if (i <= 3) { goto ldv_27838; } else { } return (0); } } static int validate_pnode(struct ubifs_info const *c , struct ubifs_pnode *pnode , struct ubifs_nnode *parent , int iip ) { int i ; int num ; int tmp ; int free ; int dirty ; { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { tmp = calc_pnode_num_from_parent(c, parent, iip); num = tmp; if (pnode->num != num) { return (-22); } else { } } else { } i = 0; goto ldv_27852; ldv_27851: free = pnode->lprops[i].free; dirty = pnode->lprops[i].dirty; if (((free < 0 || (int )c->leb_size < free) || free % (int )c->min_io_size != 0) || (free & 7) != 0) { return (-22); } else { } if ((dirty < 0 || (int )c->leb_size < dirty) || (dirty & 7) != 0) { return (-22); } else { } if (dirty + free > (int )c->leb_size) { return (-22); } else { } i = i + 1; ldv_27852: ; if (i <= 3) { goto ldv_27851; } else { } return (0); } } static void set_pnode_lnum(struct ubifs_info const *c , struct ubifs_pnode *pnode ) { int i ; int lnum ; int tmp ; { lnum = (pnode->num << 2) + (int )c->main_first; i = 0; goto ldv_27861; ldv_27860: ; if ((int )c->leb_cnt <= lnum) { return; } else { } tmp = lnum; lnum = lnum + 1; pnode->lprops[i].lnum = tmp; i = i + 1; ldv_27861: ; if (i <= 3) { goto ldv_27860; } else { } return; } } int ubifs_read_nnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) { struct ubifs_nbranch *branch ; struct ubifs_nnode *nnode ; void *buf ; int err ; int lnum ; int offs ; void *tmp ; struct task_struct *tmp___0 ; { branch = 0; nnode = 0; buf = c->lpt_nod_buf; if ((unsigned long )parent != (unsigned long )((struct ubifs_nnode *)0)) { branch = (struct ubifs_nbranch *)(& parent->nbranch) + (unsigned long )iip; lnum = branch->lnum; offs = branch->offs; } else { lnum = c->lpt_lnum; offs = c->lpt_offs; } tmp = kzalloc(104UL, 80U); nnode = (struct ubifs_nnode *)tmp; if ((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) { err = -12; goto out; } else { } if (lnum == 0) { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { nnode->num = calc_nnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { err = ubifs_leb_read((struct ubifs_info const *)c, lnum, buf, offs, c->nnode_sz, 1); if (err != 0) { goto out; } else { } err = ubifs_unpack_nnode((struct ubifs_info const *)c, buf, nnode); if (err != 0) { goto out; } else { } } } else { } err = validate_nnode((struct ubifs_info const *)c, nnode, parent, iip); if (err != 0) { goto out; } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) == 0U) { nnode->num = calc_nnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { } if ((unsigned long )parent != (unsigned long )((struct ubifs_nnode *)0)) { branch->ldv_26015.nnode = nnode; nnode->level = parent->level + -1; } else { c->nroot = nnode; nnode->level = c->lpt_hght; } nnode->parent = parent; nnode->iip = iip; return (0); out: tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d reading nnode at %d:%d\n", tmp___0->pid, "ubifs_read_nnode", err, lnum, offs); dump_stack(); kfree((void const *)nnode); return (err); } } static int read_pnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) { struct ubifs_nbranch *branch ; struct ubifs_pnode *pnode ; void *buf ; int err ; int lnum ; int offs ; void *tmp ; int i ; struct ubifs_lprops *lprops ; struct task_struct *tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; { pnode = 0; buf = c->lpt_nod_buf; branch = (struct ubifs_nbranch *)(& parent->nbranch) + (unsigned long )iip; lnum = branch->lnum; offs = branch->offs; tmp = kzalloc(168UL, 80U); pnode = (struct ubifs_pnode *)tmp; if ((unsigned long )pnode == (unsigned long )((struct ubifs_pnode *)0)) { return (-12); } else { } if (lnum == 0) { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { pnode->num = calc_pnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { } i = 0; goto ldv_27890; ldv_27889: lprops = (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )i; lprops->free = c->leb_size; lprops->flags = ubifs_categorize_lprops((struct ubifs_info const *)c, (struct ubifs_lprops const *)lprops); i = i + 1; ldv_27890: ; if (i <= 3) { goto ldv_27889; } else { } } else { err = ubifs_leb_read((struct ubifs_info const *)c, lnum, buf, offs, c->pnode_sz, 1); if (err != 0) { goto out; } else { } err = unpack_pnode((struct ubifs_info const *)c, buf, pnode); if (err != 0) { goto out; } else { } } err = validate_pnode((struct ubifs_info const *)c, pnode, parent, iip); if (err != 0) { goto out; } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) == 0U) { pnode->num = calc_pnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { } branch->ldv_26015.pnode = pnode; pnode->parent = parent; pnode->iip = iip; set_pnode_lnum((struct ubifs_info const *)c, pnode); c->pnodes_have = c->pnodes_have + 1; return (0); out: tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d reading pnode at %d:%d\n", tmp___0->pid, "read_pnode", err, lnum, offs); ubifs_dump_pnode(c, pnode, parent, iip); dump_stack(); tmp___1 = calc_pnode_num_from_parent((struct ubifs_info const *)c, parent, iip); tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: calc num: %d\n", tmp___2->pid, "read_pnode", tmp___1); kfree((void const *)pnode); return (err); } } static int read_ltab(struct ubifs_info *c ) { int err ; void *buf ; { buf = vmalloc((unsigned long )c->ltab_sz); if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, c->ltab_lnum, buf, c->ltab_offs, c->ltab_sz, 1); if (err != 0) { goto out; } else { } err = unpack_ltab((struct ubifs_info const *)c, buf); out: vfree((void const *)buf); return (err); } } static int read_lsave(struct ubifs_info *c ) { int err ; int i ; void *buf ; int lnum ; struct ubifs_lprops *lprops ; long tmp ; long tmp___0 ; { buf = vmalloc((unsigned long )c->lsave_sz); if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, c->lsave_lnum, buf, c->lsave_offs, c->lsave_sz, 1); if (err != 0) { goto out; } else { } err = unpack_lsave((struct ubifs_info const *)c, buf); if (err != 0) { goto out; } else { } i = 0; goto ldv_27911; ldv_27910: lnum = *(c->lsave + (unsigned long )i); if (c->leb_cnt <= lnum) { goto ldv_27909; } else { } lprops = ubifs_lpt_lookup(c, lnum); tmp___0 = IS_ERR((void const *)lprops); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)lprops); err = (int )tmp; goto out; } else { } ldv_27909: i = i + 1; ldv_27911: ; if (c->lsave_cnt > i) { goto ldv_27910; } else { } out: vfree((void const *)buf); return (err); } } struct ubifs_nnode *ubifs_get_nnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) { struct ubifs_nbranch *branch ; struct ubifs_nnode *nnode ; int err ; void *tmp ; { branch = (struct ubifs_nbranch *)(& parent->nbranch) + (unsigned long )iip; nnode = branch->ldv_26015.nnode; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { return (nnode); } else { } err = ubifs_read_nnode(c, parent, iip); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_nnode *)tmp); } else { } return (branch->ldv_26015.nnode); } } struct ubifs_pnode *ubifs_get_pnode(struct ubifs_info *c , struct ubifs_nnode *parent , int iip ) { struct ubifs_nbranch *branch ; struct ubifs_pnode *pnode ; int err ; void *tmp ; { branch = (struct ubifs_nbranch *)(& parent->nbranch) + (unsigned long )iip; pnode = branch->ldv_26015.pnode; if ((unsigned long )pnode != (unsigned long )((struct ubifs_pnode *)0)) { return (pnode); } else { } err = read_pnode(c, parent, iip); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_pnode *)tmp); } else { } update_cats(c, branch->ldv_26015.pnode); return (branch->ldv_26015.pnode); } } struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c , int lnum ) { int err ; int i ; int h ; int iip ; int shft ; struct ubifs_nnode *nnode ; struct ubifs_pnode *pnode ; void *tmp ; void *tmp___0 ; long tmp___1 ; void *tmp___2 ; long tmp___3 ; struct _ddebug descriptor ; struct task_struct *tmp___4 ; long tmp___5 ; { if ((unsigned long )c->nroot == (unsigned long )((struct ubifs_nnode *)0)) { err = ubifs_read_nnode(c, 0, 0); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_lprops *)tmp); } else { } } else { } nnode = c->nroot; i = lnum - c->main_first; shft = c->lpt_hght * 2; h = 1; goto ldv_27941; ldv_27940: iip = (i >> shft) & 3; shft = shft + -2; nnode = ubifs_get_nnode(c, nnode, iip); tmp___1 = IS_ERR((void const *)nnode); if (tmp___1 != 0L) { tmp___0 = ERR_CAST((void const *)nnode); return ((struct ubifs_lprops *)tmp___0); } else { } h = h + 1; ldv_27941: ; if (c->lpt_hght > h) { goto ldv_27940; } else { } iip = (i >> shft) & 3; shft = shft + -2; pnode = ubifs_get_pnode(c, nnode, iip); tmp___3 = IS_ERR((void const *)pnode); if (tmp___3 != 0L) { tmp___2 = ERR_CAST((void const *)pnode); return ((struct ubifs_lprops *)tmp___2); } else { } iip = i & 3; descriptor.modname = "ubifs"; descriptor.function = "ubifs_lpt_lookup"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d, free %d, dirty %d, flags %d\n"; descriptor.lineno = 1593U; descriptor.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d, free %d, dirty %d, flags %d\n", tmp___4->pid, lnum, pnode->lprops[iip].free, pnode->lprops[iip].dirty, pnode->lprops[iip].flags); } else { } return ((struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )iip); } } static struct ubifs_nnode *dirty_cow_nnode(struct ubifs_info *c , struct ubifs_nnode *nnode ) { struct ubifs_nnode *n ; int i ; int tmp ; int tmp___0 ; void *tmp___1 ; void *tmp___2 ; long tmp___3 ; size_t __len ; void *__ret ; struct ubifs_nbranch *branch ; struct task_struct *tmp___4 ; int tmp___5 ; long tmp___6 ; { tmp___0 = constant_test_bit(2U, (unsigned long const volatile *)(& nnode->flags)); if (tmp___0 == 0) { tmp = test_and_set_bit(0, (unsigned long volatile *)(& nnode->flags)); if (tmp == 0) { c->dirty_nn_cnt = c->dirty_nn_cnt + 1; ubifs_add_nnode_dirt(c, nnode); } else { } return (nnode); } else { } tmp___1 = kmalloc(104UL, 80U); n = (struct ubifs_nnode *)tmp___1; tmp___3 = ldv__builtin_expect((unsigned long )n == (unsigned long )((struct ubifs_nnode *)0), 0L); if (tmp___3 != 0L) { tmp___2 = ERR_PTR(-12L); return ((struct ubifs_nnode *)tmp___2); } else { } __len = 104UL; if (__len > 63UL) { __ret = memcpy((void *)n, (void const *)nnode, __len); } else { __ret = memcpy((void *)n, (void const *)nnode, __len); } n->cnext = 0; __set_bit(0, (unsigned long volatile *)(& n->flags)); __clear_bit(2, (unsigned long volatile *)(& n->flags)); i = 0; goto ldv_27956; ldv_27955: branch = (struct ubifs_nbranch *)(& n->nbranch) + (unsigned long )i; if ((unsigned long )branch->ldv_26015.cnode != (unsigned long )((struct ubifs_cnode *)0)) { (branch->ldv_26015.cnode)->parent = n; } else { } i = i + 1; ldv_27956: ; if (i <= 3) { goto ldv_27955; } else { } tmp___5 = constant_test_bit(1U, (unsigned long const volatile *)(& nnode->flags)); tmp___6 = ldv__builtin_expect(tmp___5 != 0, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_nnode", 1637, tmp___4->pid); dump_stack(); } else { } __set_bit(1, (unsigned long volatile *)(& nnode->flags)); c->dirty_nn_cnt = c->dirty_nn_cnt + 1; ubifs_add_nnode_dirt(c, nnode); if ((unsigned long )nnode->parent != (unsigned long )((struct ubifs_nnode *)0)) { (nnode->parent)->nbranch[n->iip].ldv_26015.nnode = n; } else { c->nroot = n; } return (n); } } static struct ubifs_pnode *dirty_cow_pnode(struct ubifs_info *c , struct ubifs_pnode *pnode ) { struct ubifs_pnode *p ; int tmp ; int tmp___0 ; void *tmp___1 ; void *tmp___2 ; long tmp___3 ; size_t __len ; void *__ret ; struct task_struct *tmp___4 ; int tmp___5 ; long tmp___6 ; { tmp___0 = constant_test_bit(2U, (unsigned long const volatile *)(& pnode->flags)); if (tmp___0 == 0) { tmp = test_and_set_bit(0, (unsigned long volatile *)(& pnode->flags)); if (tmp == 0) { c->dirty_pn_cnt = c->dirty_pn_cnt + 1; add_pnode_dirt(c, pnode); } else { } return (pnode); } else { } tmp___1 = kmalloc(168UL, 80U); p = (struct ubifs_pnode *)tmp___1; tmp___3 = ldv__builtin_expect((unsigned long )p == (unsigned long )((struct ubifs_pnode *)0), 0L); if (tmp___3 != 0L) { tmp___2 = ERR_PTR(-12L); return ((struct ubifs_pnode *)tmp___2); } else { } __len = 168UL; if (__len > 63UL) { __ret = memcpy((void *)p, (void const *)pnode, __len); } else { __ret = memcpy((void *)p, (void const *)pnode, __len); } p->cnext = 0; __set_bit(0, (unsigned long volatile *)(& p->flags)); __clear_bit(2, (unsigned long volatile *)(& p->flags)); replace_cats(c, pnode, p); tmp___5 = constant_test_bit(1U, (unsigned long const volatile *)(& pnode->flags)); tmp___6 = ldv__builtin_expect(tmp___5 != 0, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dirty_cow_pnode", 1681, tmp___4->pid); dump_stack(); } else { } __set_bit(1, (unsigned long volatile *)(& pnode->flags)); c->dirty_pn_cnt = c->dirty_pn_cnt + 1; add_pnode_dirt(c, pnode); (pnode->parent)->nbranch[p->iip].ldv_26015.pnode = p; return (p); } } struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c , int lnum ) { int err ; int i ; int h ; int iip ; int shft ; struct ubifs_nnode *nnode ; struct ubifs_pnode *pnode ; void *tmp ; void *tmp___0 ; long tmp___1 ; void *tmp___2 ; long tmp___3 ; void *tmp___4 ; long tmp___5 ; void *tmp___6 ; long tmp___7 ; void *tmp___8 ; long tmp___9 ; struct _ddebug descriptor ; struct task_struct *tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; int tmp___13 ; long tmp___14 ; { if ((unsigned long )c->nroot == (unsigned long )((struct ubifs_nnode *)0)) { err = ubifs_read_nnode(c, 0, 0); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_lprops *)tmp); } else { } } else { } nnode = c->nroot; nnode = dirty_cow_nnode(c, nnode); tmp___1 = IS_ERR((void const *)nnode); if (tmp___1 != 0L) { tmp___0 = ERR_CAST((void const *)nnode); return ((struct ubifs_lprops *)tmp___0); } else { } i = lnum - c->main_first; shft = c->lpt_hght * 2; h = 1; goto ldv_27980; ldv_27979: iip = (i >> shft) & 3; shft = shft + -2; nnode = ubifs_get_nnode(c, nnode, iip); tmp___3 = IS_ERR((void const *)nnode); if (tmp___3 != 0L) { tmp___2 = ERR_CAST((void const *)nnode); return ((struct ubifs_lprops *)tmp___2); } else { } nnode = dirty_cow_nnode(c, nnode); tmp___5 = IS_ERR((void const *)nnode); if (tmp___5 != 0L) { tmp___4 = ERR_CAST((void const *)nnode); return ((struct ubifs_lprops *)tmp___4); } else { } h = h + 1; ldv_27980: ; if (c->lpt_hght > h) { goto ldv_27979; } else { } iip = (i >> shft) & 3; shft = shft + -2; pnode = ubifs_get_pnode(c, nnode, iip); tmp___7 = IS_ERR((void const *)pnode); if (tmp___7 != 0L) { tmp___6 = ERR_CAST((void const *)pnode); return ((struct ubifs_lprops *)tmp___6); } else { } pnode = dirty_cow_pnode(c, pnode); tmp___9 = IS_ERR((void const *)pnode); if (tmp___9 != 0L) { tmp___8 = ERR_CAST((void const *)pnode); return ((struct ubifs_lprops *)tmp___8); } else { } iip = i & 3; descriptor.modname = "ubifs"; descriptor.function = "ubifs_lpt_lookup_dirty"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d, free %d, dirty %d, flags %d\n"; descriptor.lineno = 1736U; descriptor.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d, free %d, dirty %d, flags %d\n", tmp___10->pid, lnum, pnode->lprops[iip].free, pnode->lprops[iip].dirty, pnode->lprops[iip].flags); } else { } tmp___13 = constant_test_bit(0U, (unsigned long const volatile *)(& pnode->flags)); tmp___14 = ldv__builtin_expect(tmp___13 == 0, 0L); if (tmp___14 != 0L) { tmp___12 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_lookup_dirty", 1737, tmp___12->pid); dump_stack(); } else { } return ((struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )iip); } } static int lpt_init_rd(struct ubifs_info *c ) { int err ; int i ; void *tmp ; int __max1 ; int __max2 ; void *tmp___0 ; void *tmp___1 ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___6 ; long tmp___7 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___8 ; long tmp___9 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___10 ; long tmp___11 ; struct _ddebug descriptor___4 ; struct task_struct *tmp___12 ; long tmp___13 ; struct _ddebug descriptor___5 ; struct task_struct *tmp___14 ; long tmp___15 ; struct _ddebug descriptor___6 ; struct task_struct *tmp___16 ; long tmp___17 ; struct _ddebug descriptor___7 ; struct task_struct *tmp___18 ; long tmp___19 ; struct _ddebug descriptor___8 ; struct task_struct *tmp___20 ; long tmp___21 ; struct _ddebug descriptor___9 ; struct task_struct *tmp___22 ; long tmp___23 ; struct _ddebug descriptor___10 ; struct task_struct *tmp___24 ; long tmp___25 ; struct _ddebug descriptor___11 ; struct task_struct *tmp___26 ; long tmp___27 ; struct _ddebug descriptor___12 ; struct task_struct *tmp___28 ; long tmp___29 ; struct _ddebug descriptor___13 ; struct task_struct *tmp___30 ; long tmp___31 ; struct _ddebug descriptor___14 ; struct task_struct *tmp___32 ; long tmp___33 ; struct _ddebug descriptor___15 ; struct task_struct *tmp___34 ; long tmp___35 ; { tmp = vmalloc((unsigned long )c->lpt_lebs * 12UL); c->ltab = (struct ubifs_lpt_lprops *)tmp; if ((unsigned long )c->ltab == (unsigned long )((struct ubifs_lpt_lprops *)0)) { return (-12); } else { } __max1 = c->nnode_sz; __max2 = c->pnode_sz; i = __max1 > __max2 ? __max1 : __max2; c->lpt_nod_buf = kmalloc((size_t )i, 208U); if ((unsigned long )c->lpt_nod_buf == (unsigned long )((void *)0)) { return (-12); } else { } i = 0; goto ldv_27993; ldv_27992: tmp___0 = kmalloc(2048UL, 208U); c->lpt_heap[i].arr = (struct ubifs_lprops **)tmp___0; if ((unsigned long )c->lpt_heap[i].arr == (unsigned long )((struct ubifs_lprops **)0)) { return (-12); } else { } c->lpt_heap[i].cnt = 0; c->lpt_heap[i].max_cnt = 256; i = i + 1; ldv_27993: ; if (i <= 2) { goto ldv_27992; } else { } tmp___1 = kmalloc(2048UL, 208U); c->dirty_idx.arr = (struct ubifs_lprops **)tmp___1; if ((unsigned long )c->dirty_idx.arr == (unsigned long )((struct ubifs_lprops **)0)) { return (-12); } else { } c->dirty_idx.cnt = 0; c->dirty_idx.max_cnt = 256; err = read_ltab(c); if (err != 0) { return (err); } else { } descriptor.modname = "ubifs"; descriptor.function = "lpt_init_rd"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): space_bits %d\n"; descriptor.lineno = 1779U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): space_bits %d\n", tmp___2->pid, c->space_bits); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "lpt_init_rd"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___0.format = "UBIFS DBG lp (pid %d): lpt_lnum_bits %d\n"; descriptor___0.lineno = 1780U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG lp (pid %d): lpt_lnum_bits %d\n", tmp___4->pid, c->lpt_lnum_bits); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "lpt_init_rd"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___1.format = "UBIFS DBG lp (pid %d): lpt_offs_bits %d\n"; descriptor___1.lineno = 1781U; descriptor___1.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG lp (pid %d): lpt_offs_bits %d\n", tmp___6->pid, c->lpt_offs_bits); } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "lpt_init_rd"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___2.format = "UBIFS DBG lp (pid %d): lpt_spc_bits %d\n"; descriptor___2.lineno = 1782U; descriptor___2.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG lp (pid %d): lpt_spc_bits %d\n", tmp___8->pid, c->lpt_spc_bits); } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "lpt_init_rd"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___3.format = "UBIFS DBG lp (pid %d): pcnt_bits %d\n"; descriptor___3.lineno = 1783U; descriptor___3.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG lp (pid %d): pcnt_bits %d\n", tmp___10->pid, c->pcnt_bits); } else { } descriptor___4.modname = "ubifs"; descriptor___4.function = "lpt_init_rd"; descriptor___4.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___4.format = "UBIFS DBG lp (pid %d): lnum_bits %d\n"; descriptor___4.lineno = 1784U; descriptor___4.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___4.flags & 1L, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); __dynamic_pr_debug(& descriptor___4, "UBIFS DBG lp (pid %d): lnum_bits %d\n", tmp___12->pid, c->lnum_bits); } else { } descriptor___5.modname = "ubifs"; descriptor___5.function = "lpt_init_rd"; descriptor___5.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___5.format = "UBIFS DBG lp (pid %d): pnode_sz %d\n"; descriptor___5.lineno = 1785U; descriptor___5.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___5.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___5, "UBIFS DBG lp (pid %d): pnode_sz %d\n", tmp___14->pid, c->pnode_sz); } else { } descriptor___6.modname = "ubifs"; descriptor___6.function = "lpt_init_rd"; descriptor___6.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___6.format = "UBIFS DBG lp (pid %d): nnode_sz %d\n"; descriptor___6.lineno = 1786U; descriptor___6.flags = 0U; tmp___17 = ldv__builtin_expect((long )descriptor___6.flags & 1L, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); __dynamic_pr_debug(& descriptor___6, "UBIFS DBG lp (pid %d): nnode_sz %d\n", tmp___16->pid, c->nnode_sz); } else { } descriptor___7.modname = "ubifs"; descriptor___7.function = "lpt_init_rd"; descriptor___7.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___7.format = "UBIFS DBG lp (pid %d): ltab_sz %d\n"; descriptor___7.lineno = 1787U; descriptor___7.flags = 0U; tmp___19 = ldv__builtin_expect((long )descriptor___7.flags & 1L, 0L); if (tmp___19 != 0L) { tmp___18 = get_current(); __dynamic_pr_debug(& descriptor___7, "UBIFS DBG lp (pid %d): ltab_sz %d\n", tmp___18->pid, c->ltab_sz); } else { } descriptor___8.modname = "ubifs"; descriptor___8.function = "lpt_init_rd"; descriptor___8.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___8.format = "UBIFS DBG lp (pid %d): lsave_sz %d\n"; descriptor___8.lineno = 1788U; descriptor___8.flags = 0U; tmp___21 = ldv__builtin_expect((long )descriptor___8.flags & 1L, 0L); if (tmp___21 != 0L) { tmp___20 = get_current(); __dynamic_pr_debug(& descriptor___8, "UBIFS DBG lp (pid %d): lsave_sz %d\n", tmp___20->pid, c->lsave_sz); } else { } descriptor___9.modname = "ubifs"; descriptor___9.function = "lpt_init_rd"; descriptor___9.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___9.format = "UBIFS DBG lp (pid %d): lsave_cnt %d\n"; descriptor___9.lineno = 1789U; descriptor___9.flags = 0U; tmp___23 = ldv__builtin_expect((long )descriptor___9.flags & 1L, 0L); if (tmp___23 != 0L) { tmp___22 = get_current(); __dynamic_pr_debug(& descriptor___9, "UBIFS DBG lp (pid %d): lsave_cnt %d\n", tmp___22->pid, c->lsave_cnt); } else { } descriptor___10.modname = "ubifs"; descriptor___10.function = "lpt_init_rd"; descriptor___10.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___10.format = "UBIFS DBG lp (pid %d): lpt_hght %d\n"; descriptor___10.lineno = 1790U; descriptor___10.flags = 0U; tmp___25 = ldv__builtin_expect((long )descriptor___10.flags & 1L, 0L); if (tmp___25 != 0L) { tmp___24 = get_current(); __dynamic_pr_debug(& descriptor___10, "UBIFS DBG lp (pid %d): lpt_hght %d\n", tmp___24->pid, c->lpt_hght); } else { } descriptor___11.modname = "ubifs"; descriptor___11.function = "lpt_init_rd"; descriptor___11.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___11.format = "UBIFS DBG lp (pid %d): big_lpt %d\n"; descriptor___11.lineno = 1791U; descriptor___11.flags = 0U; tmp___27 = ldv__builtin_expect((long )descriptor___11.flags & 1L, 0L); if (tmp___27 != 0L) { tmp___26 = get_current(); __dynamic_pr_debug(& descriptor___11, "UBIFS DBG lp (pid %d): big_lpt %d\n", tmp___26->pid, (int )c->big_lpt); } else { } descriptor___12.modname = "ubifs"; descriptor___12.function = "lpt_init_rd"; descriptor___12.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___12.format = "UBIFS DBG lp (pid %d): LPT root is at %d:%d\n"; descriptor___12.lineno = 1792U; descriptor___12.flags = 0U; tmp___29 = ldv__builtin_expect((long )descriptor___12.flags & 1L, 0L); if (tmp___29 != 0L) { tmp___28 = get_current(); __dynamic_pr_debug(& descriptor___12, "UBIFS DBG lp (pid %d): LPT root is at %d:%d\n", tmp___28->pid, c->lpt_lnum, c->lpt_offs); } else { } descriptor___13.modname = "ubifs"; descriptor___13.function = "lpt_init_rd"; descriptor___13.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___13.format = "UBIFS DBG lp (pid %d): LPT head is at %d:%d\n"; descriptor___13.lineno = 1793U; descriptor___13.flags = 0U; tmp___31 = ldv__builtin_expect((long )descriptor___13.flags & 1L, 0L); if (tmp___31 != 0L) { tmp___30 = get_current(); __dynamic_pr_debug(& descriptor___13, "UBIFS DBG lp (pid %d): LPT head is at %d:%d\n", tmp___30->pid, c->nhead_lnum, c->nhead_offs); } else { } descriptor___14.modname = "ubifs"; descriptor___14.function = "lpt_init_rd"; descriptor___14.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___14.format = "UBIFS DBG lp (pid %d): LPT ltab is at %d:%d\n"; descriptor___14.lineno = 1794U; descriptor___14.flags = 0U; tmp___33 = ldv__builtin_expect((long )descriptor___14.flags & 1L, 0L); if (tmp___33 != 0L) { tmp___32 = get_current(); __dynamic_pr_debug(& descriptor___14, "UBIFS DBG lp (pid %d): LPT ltab is at %d:%d\n", tmp___32->pid, c->ltab_lnum, c->ltab_offs); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { descriptor___15.modname = "ubifs"; descriptor___15.function = "lpt_init_rd"; descriptor___15.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt.c.prepared"; descriptor___15.format = "UBIFS DBG lp (pid %d): LPT lsave is at %d:%d\n"; descriptor___15.lineno = 1796U; descriptor___15.flags = 0U; tmp___35 = ldv__builtin_expect((long )descriptor___15.flags & 1L, 0L); if (tmp___35 != 0L) { tmp___34 = get_current(); __dynamic_pr_debug(& descriptor___15, "UBIFS DBG lp (pid %d): LPT lsave is at %d:%d\n", tmp___34->pid, c->lsave_lnum, c->lsave_offs); } else { } } else { } return (0); } } static int lpt_init_wr(struct ubifs_info *c ) { int err ; int i ; void *tmp ; void *tmp___0 ; { tmp = vmalloc((unsigned long )c->lpt_lebs * 12UL); c->ltab_cmt = (struct ubifs_lpt_lprops *)tmp; if ((unsigned long )c->ltab_cmt == (unsigned long )((struct ubifs_lpt_lprops *)0)) { return (-12); } else { } c->lpt_buf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )c->lpt_buf == (unsigned long )((void *)0)) { return (-12); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { tmp___0 = kmalloc((unsigned long )c->lsave_cnt * 4UL, 80U); c->lsave = (int *)tmp___0; if ((unsigned long )c->lsave == (unsigned long )((int *)0)) { return (-12); } else { } err = read_lsave(c); if (err != 0) { return (err); } else { } } else { } i = 0; goto ldv_28019; ldv_28018: ; if ((c->ltab + (unsigned long )i)->free == c->leb_size) { err = ubifs_leb_unmap(c, c->lpt_first + i); if (err != 0) { return (err); } else { } } else { } i = i + 1; ldv_28019: ; if (c->lpt_lebs > i) { goto ldv_28018; } else { } return (0); } } int ubifs_lpt_init(struct ubifs_info *c , int rd , int wr ) { int err ; { if (rd != 0) { err = lpt_init_rd(c); if (err != 0) { goto out_err; } else { } } else { } if (wr != 0) { err = lpt_init_wr(c); if (err != 0) { goto out_err; } else { } } else { } return (0); out_err: ; if (wr != 0) { ubifs_lpt_free(c, 1); } else { } if (rd != 0) { ubifs_lpt_free(c, 0); } else { } return (err); } } static struct ubifs_nnode *scan_get_nnode(struct ubifs_info *c , struct lpt_scan_node *path , struct ubifs_nnode *parent , int iip ) { struct ubifs_nbranch *branch ; struct ubifs_nnode *nnode ; void *buf ; int err ; void *tmp ; void *tmp___0 ; void *tmp___1 ; { buf = c->lpt_nod_buf; branch = (struct ubifs_nbranch *)(& parent->nbranch) + (unsigned long )iip; nnode = branch->ldv_26015.nnode; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { path->in_tree = 1; path->ptr.nnode = nnode; return (nnode); } else { } nnode = & path->ldv_28033.nnode; path->in_tree = 0; path->ptr.nnode = nnode; memset((void *)nnode, 0, 104UL); if (branch->lnum == 0) { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { nnode->num = calc_nnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { err = ubifs_leb_read((struct ubifs_info const *)c, branch->lnum, buf, branch->offs, c->nnode_sz, 1); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_nnode *)tmp); } else { } err = ubifs_unpack_nnode((struct ubifs_info const *)c, buf, nnode); if (err != 0) { tmp___0 = ERR_PTR((long )err); return ((struct ubifs_nnode *)tmp___0); } else { } } } else { } err = validate_nnode((struct ubifs_info const *)c, nnode, parent, iip); if (err != 0) { tmp___1 = ERR_PTR((long )err); return ((struct ubifs_nnode *)tmp___1); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) == 0U) { nnode->num = calc_nnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { } nnode->level = parent->level + -1; nnode->parent = parent; nnode->iip = iip; return (nnode); } } static struct ubifs_pnode *scan_get_pnode(struct ubifs_info *c , struct lpt_scan_node *path , struct ubifs_nnode *parent , int iip ) { struct ubifs_nbranch *branch ; struct ubifs_pnode *pnode ; void *buf ; int err ; int i ; struct ubifs_lprops *lprops ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; void *tmp___5 ; void *tmp___6 ; void *tmp___7 ; { buf = c->lpt_nod_buf; branch = (struct ubifs_nbranch *)(& parent->nbranch) + (unsigned long )iip; pnode = branch->ldv_26015.pnode; if ((unsigned long )pnode != (unsigned long )((struct ubifs_pnode *)0)) { path->in_tree = 1; path->ptr.pnode = pnode; return (pnode); } else { } pnode = & path->ldv_28033.pnode; path->in_tree = 0; path->ptr.pnode = pnode; memset((void *)pnode, 0, 168UL); if (branch->lnum == 0) { if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { pnode->num = calc_pnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { } i = 0; goto ldv_28063; ldv_28062: lprops = (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )i; lprops->free = c->leb_size; lprops->flags = ubifs_categorize_lprops((struct ubifs_info const *)c, (struct ubifs_lprops const *)lprops); i = i + 1; ldv_28063: ; if (i <= 3) { goto ldv_28062; } else { } } else { tmp___0 = ldv__builtin_expect(branch->lnum < c->lpt_first, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_get_pnode", 2010, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(branch->lnum > c->lpt_last, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_get_pnode", 2010, tmp->pid); dump_stack(); } else { } } tmp___3 = ldv__builtin_expect(branch->offs < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_get_pnode", 2011, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(branch->offs >= c->leb_size, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "scan_get_pnode", 2011, tmp___2->pid); dump_stack(); } else { } } err = ubifs_leb_read((struct ubifs_info const *)c, branch->lnum, buf, branch->offs, c->pnode_sz, 1); if (err != 0) { tmp___5 = ERR_PTR((long )err); return ((struct ubifs_pnode *)tmp___5); } else { } err = unpack_pnode((struct ubifs_info const *)c, buf, pnode); if (err != 0) { tmp___6 = ERR_PTR((long )err); return ((struct ubifs_pnode *)tmp___6); } else { } } err = validate_pnode((struct ubifs_info const *)c, pnode, parent, iip); if (err != 0) { tmp___7 = ERR_PTR((long )err); return ((struct ubifs_pnode *)tmp___7); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) == 0U) { pnode->num = calc_pnode_num_from_parent((struct ubifs_info const *)c, parent, iip); } else { } pnode->parent = parent; pnode->iip = iip; set_pnode_lnum((struct ubifs_info const *)c, pnode); return (pnode); } } int ubifs_lpt_scan_nolock(struct ubifs_info *c , int start_lnum , int end_lnum , int (*scan_cb)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ) , void *data ) { int err ; int i ; int h ; int iip ; int shft ; struct ubifs_nnode *nnode ; struct ubifs_pnode *pnode ; struct lpt_scan_node *path ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; void *tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; struct ubifs_lprops *lprops ; int ret ; int lnum ; size_t sz ; struct ubifs_nnode *parent ; void *tmp___10 ; size_t sz___0 ; struct ubifs_nnode *parent___0 ; void *tmp___11 ; struct task_struct *tmp___12 ; long tmp___13 ; long tmp___14 ; long tmp___15 ; long tmp___16 ; long tmp___17 ; { err = 0; if (start_lnum == -1) { start_lnum = end_lnum + 1; if (c->leb_cnt <= start_lnum) { start_lnum = c->main_first; } else { } } else { } tmp___0 = ldv__builtin_expect(c->main_first > start_lnum, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_scan_nolock", 2055, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(c->leb_cnt <= start_lnum, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_scan_nolock", 2055, tmp->pid); dump_stack(); } else { } } tmp___3 = ldv__builtin_expect(c->main_first > end_lnum, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_scan_nolock", 2056, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->leb_cnt <= end_lnum, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_scan_nolock", 2056, tmp___2->pid); dump_stack(); } else { } } if ((unsigned long )c->nroot == (unsigned long )((struct ubifs_nnode *)0)) { err = ubifs_read_nnode(c, 0, 0); if (err != 0) { return (err); } else { } } else { } tmp___5 = kmalloc((unsigned long )(c->lpt_hght + 1) * 184UL, 80U); path = (struct lpt_scan_node *)tmp___5; if ((unsigned long )path == (unsigned long )((struct lpt_scan_node *)0)) { return (-12); } else { } path->ptr.nnode = c->nroot; path->in_tree = 1; again: nnode = c->nroot; i = start_lnum - c->main_first; shft = c->lpt_hght * 2; h = 1; goto ldv_28085; ldv_28084: iip = (i >> shft) & 3; shft = shft + -2; nnode = scan_get_nnode(c, path + (unsigned long )h, nnode, iip); tmp___7 = IS_ERR((void const *)nnode); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)nnode); err = (int )tmp___6; goto out; } else { } h = h + 1; ldv_28085: ; if (c->lpt_hght > h) { goto ldv_28084; } else { } iip = (i >> shft) & 3; shft = shft + -2; pnode = scan_get_pnode(c, path + (unsigned long )h, nnode, iip); tmp___9 = IS_ERR((void const *)pnode); if (tmp___9 != 0L) { tmp___8 = PTR_ERR((void const *)pnode); err = (int )tmp___8; goto out; } else { } iip = i & 3; ldv_28105: lprops = (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )iip; lnum = lprops->lnum; ret = (*scan_cb)(c, (struct ubifs_lprops const *)lprops, (path + (unsigned long )h)->in_tree, data); if (ret < 0) { err = ret; goto out; } else { } if (ret & 1) { h = 1; goto ldv_28094; ldv_28093: sz = 104UL; if ((path + (unsigned long )h)->in_tree != 0) { goto ldv_28092; } else { } tmp___10 = kmemdup((void const *)(& (path + (unsigned long )h)->ldv_28033.nnode), sz, 80U); nnode = (struct ubifs_nnode *)tmp___10; if ((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) { err = -12; goto out; } else { } parent = nnode->parent; parent->nbranch[nnode->iip].ldv_26015.nnode = nnode; (path + (unsigned long )h)->ptr.nnode = nnode; (path + (unsigned long )h)->in_tree = 1; (path + ((unsigned long )h + 1UL))->ldv_28033.cnode.parent = nnode; ldv_28092: h = h + 1; ldv_28094: ; if (c->lpt_hght > h) { goto ldv_28093; } else { } if ((path + (unsigned long )h)->in_tree != 0) { ubifs_ensure_cat(c, lprops); } else { sz___0 = 168UL; tmp___11 = kmemdup((void const *)(& (path + (unsigned long )h)->ldv_28033.pnode), sz___0, 80U); pnode = (struct ubifs_pnode *)tmp___11; if ((unsigned long )pnode == (unsigned long )((struct ubifs_pnode *)0)) { err = -12; goto out; } else { } parent___0 = pnode->parent; parent___0->nbranch[pnode->iip].ldv_26015.pnode = pnode; (path + (unsigned long )h)->ptr.pnode = pnode; (path + (unsigned long )h)->in_tree = 1; update_cats(c, pnode); c->pnodes_have = c->pnodes_have + 1; } err = dbg_check_lpt_nodes(c, (struct ubifs_cnode *)c->nroot, 0, 0); if (err != 0) { goto out; } else { } err = dbg_check_cats(c); if (err != 0) { goto out; } else { } } else { } if ((ret & 2) != 0) { err = 0; goto ldv_28098; } else { } if (lnum == end_lnum) { err = -28; goto out; } else { } if (lnum + 1 >= c->leb_cnt) { start_lnum = c->main_first; goto again; } else { } if (iip + 1 <= 3) { iip = iip + 1; goto ldv_28099; } else { } iip = pnode->iip; ldv_28101: h = h + -1; tmp___13 = ldv__builtin_expect(h < 0, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_scan_nolock", 2176, tmp___12->pid); dump_stack(); } else { } nnode = (path + (unsigned long )h)->ptr.nnode; if (iip + 1 <= 3) { goto ldv_28100; } else { } iip = nnode->iip; goto ldv_28101; ldv_28100: iip = iip + 1; h = h + 1; goto ldv_28103; ldv_28102: nnode = scan_get_nnode(c, path + (unsigned long )h, nnode, iip); tmp___15 = IS_ERR((void const *)nnode); if (tmp___15 != 0L) { tmp___14 = PTR_ERR((void const *)nnode); err = (int )tmp___14; goto out; } else { } iip = 0; h = h + 1; ldv_28103: ; if (c->lpt_hght > h) { goto ldv_28102; } else { } pnode = scan_get_pnode(c, path + (unsigned long )h, nnode, iip); tmp___17 = IS_ERR((void const *)pnode); if (tmp___17 != 0L) { tmp___16 = PTR_ERR((void const *)pnode); err = (int )tmp___16; goto out; } else { } iip = 0; ldv_28099: ; goto ldv_28105; ldv_28098: ; out: kfree((void const *)path); return (err); } } static int dbg_chk_pnode(struct ubifs_info *c , struct ubifs_pnode *pnode , int col ) { int i ; struct task_struct *tmp ; struct ubifs_lprops *lp ; struct ubifs_lprops *lprops ; int lnum ; int found ; int cat ; struct ubifs_lpt_heap *heap ; struct list_head *list ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; { if (pnode->num != col) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: pnode num %d expected %d parent num %d iip %d\n", tmp->pid, "dbg_chk_pnode", pnode->num, col, (pnode->parent)->num, pnode->iip); return (-22); } else { } i = 0; goto ldv_28157; ldv_28156: lprops = (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )i; lnum = ((pnode->num << 2) + i) + c->main_first; cat = lprops->flags & 15; list = 0; if (c->leb_cnt <= lnum) { goto ldv_28120; } else { } if (lprops->lnum != lnum) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad LEB number %d expected %d\n", tmp___0->pid, "dbg_chk_pnode", lprops->lnum, lnum); return (-22); } else { } if ((lprops->flags & 16) != 0) { if (cat != 0) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d taken but not uncat %d\n", tmp___1->pid, "dbg_chk_pnode", lprops->lnum, cat); return (-22); } else { } goto ldv_28120; } else { } if ((lprops->flags & 32) != 0) { switch (cat) { case 0: ; case 2: ; case 6: ; goto ldv_28124; default: tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d index but cat %d\n", tmp___2->pid, "dbg_chk_pnode", lprops->lnum, cat); return (-22); } ldv_28124: ; } else { switch (cat) { case 0: ; case 1: ; case 3: ; case 4: ; case 5: ; goto ldv_28131; default: tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d not index but cat %d\n", tmp___3->pid, "dbg_chk_pnode", lprops->lnum, cat); return (-22); } ldv_28131: ; } switch (cat) { case 0: list = & c->uncat_list; goto ldv_28134; case 4: list = & c->empty_list; goto ldv_28134; case 5: list = & c->freeable_list; goto ldv_28134; case 6: list = & c->frdi_idx_list; goto ldv_28134; } ldv_28134: found = 0; switch (cat) { case 1: ; case 2: ; case 3: heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); if (lprops->ldv_25977.hpos < heap->cnt && (unsigned long )*(heap->arr + (unsigned long )lprops->ldv_25977.hpos) == (unsigned long )lprops) { found = 1; } else { } goto ldv_28141; case 0: ; case 4: ; case 5: ; case 6: __mptr = (struct list_head const *)list->next; lp = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; goto ldv_28152; ldv_28151: ; if ((unsigned long )lprops == (unsigned long )lp) { found = 1; goto ldv_28150; } else { } __mptr___0 = (struct list_head const *)lp->ldv_25977.list.next; lp = (struct ubifs_lprops *)__mptr___0 + 0xfffffffffffffff0UL; ldv_28152: ; if ((unsigned long )(& lp->ldv_25977.list) != (unsigned long )list) { goto ldv_28151; } else { } ldv_28150: ; goto ldv_28141; } ldv_28141: ; if (found == 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d cat %d not found in cat heap/list\n", tmp___4->pid, "dbg_chk_pnode", lprops->lnum, cat); return (-22); } else { } switch (cat) { case 4: ; if (lprops->free != c->leb_size) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d cat %d free %d dirty %d\n", tmp___5->pid, "dbg_chk_pnode", lprops->lnum, cat, lprops->free, lprops->dirty); return (-22); } else { } case 5: ; case 6: ; if (lprops->free + lprops->dirty != c->leb_size) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d cat %d free %d dirty %d\n", tmp___6->pid, "dbg_chk_pnode", lprops->lnum, cat, lprops->free, lprops->dirty); return (-22); } else { } } ldv_28120: i = i + 1; ldv_28157: ; if (i <= 3) { goto ldv_28156; } else { } return (0); } } int dbg_check_lpt_nodes(struct ubifs_info *c , struct ubifs_cnode *cnode , int row , int col ) { struct ubifs_nnode *nnode ; struct ubifs_nnode *nn ; struct ubifs_cnode *cn ; int num ; int iip ; int err ; int tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; struct ubifs_pnode *pnode ; { iip = 0; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } goto ldv_28175; ldv_28177: tmp___1 = ldv__builtin_expect(row < 0, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dbg_check_lpt_nodes", 2353, tmp___0->pid); dump_stack(); } else { } nnode = cnode->parent; if (cnode->level != 0) { num = calc_nnode_num(row, col); if (cnode->num != num) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: nnode num %d expected %d parent num %d iip %d\n", tmp___2->pid, "dbg_check_lpt_nodes", cnode->num, num, (unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0) ? nnode->num : 0, cnode->iip); return (-22); } else { } nn = (struct ubifs_nnode *)cnode; goto ldv_28174; ldv_28173: cn = nn->nbranch[iip].ldv_26015.cnode; if ((unsigned long )cn != (unsigned long )((struct ubifs_cnode *)0)) { row = row + 1; col = col << 2; col = col + iip; iip = 0; cnode = cn; goto ldv_28172; } else { } iip = iip + 1; ldv_28174: ; if (iip <= 3) { goto ldv_28173; } else { } ldv_28172: ; if (iip <= 3) { goto ldv_28175; } else { } } else { pnode = (struct ubifs_pnode *)cnode; err = dbg_chk_pnode(c, pnode, col); if (err != 0) { return (err); } else { } } row = row + -1; col = col >> 2; iip = cnode->iip + 1; cnode = (struct ubifs_cnode *)nnode; ldv_28175: ; if ((unsigned long )cnode != (unsigned long )((struct ubifs_cnode *)0)) { goto ldv_28177; } else { } return (0); } } void ldv_mutex_lock_583(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_584(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_585(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_586(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_587(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_588(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_589(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_590(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void list_replace(struct list_head *old , struct list_head *new ) { { new->next = old->next; (new->next)->prev = new; new->prev = old->prev; (new->prev)->next = new; return; } } void ldv_mutex_lock_nested_603(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_600(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_602(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_604(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_606(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_599(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_601(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_605(struct mutex *ldv_func_arg1 ) ; int ubifs_calc_dark(struct ubifs_info const *c , int spc ) ; void ubifs_dump_heap(struct ubifs_info *c , struct ubifs_lpt_heap *heap , int cat ) ; void dbg_check_heap(struct ubifs_info *c , struct ubifs_lpt_heap *heap , int cat , int add_pos ) ; __inline static int ubifs_wbuf_sync___2(struct ubifs_wbuf *wbuf ) { int err ; { ldv_mutex_lock_nested_603(& wbuf->io_mutex, (unsigned int )wbuf->jhead); err = ubifs_wbuf_sync_nolock(wbuf); ldv_mutex_unlock_604(& wbuf->io_mutex); return (err); } } __inline static void ubifs_get_lprops___3(struct ubifs_info *c ) { { ldv_mutex_lock_605(& c->lp_mutex); return; } } __inline static void ubifs_release_lprops___3(struct ubifs_info *c ) { struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 280, tmp->pid); dump_stack(); } else { } tmp___3 = ldv__builtin_expect(c->lst.empty_lebs < 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lst.empty_lebs > c->main_lebs, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_release_lprops", 282, tmp___2->pid); dump_stack(); } else { } } ldv_mutex_unlock_606(& c->lp_mutex); return; } } static int get_heap_comp_val(struct ubifs_lprops *lprops , int cat ) { { switch (cat) { case 3: ; return (lprops->free); case 2: ; return (lprops->free + lprops->dirty); default: ; return (lprops->dirty); } } } static void move_up_lpt_heap(struct ubifs_info *c , struct ubifs_lpt_heap *heap , struct ubifs_lprops *lprops , int cat ) { int val1 ; int val2 ; int hpos ; int ppos ; { hpos = lprops->ldv_25977.hpos; if (hpos == 0) { return; } else { } val1 = get_heap_comp_val(lprops, cat); ldv_27503: ppos = (hpos + -1) / 2; val2 = get_heap_comp_val(*(heap->arr + (unsigned long )ppos), cat); if (val2 >= val1) { return; } else { } (*(heap->arr + (unsigned long )ppos))->ldv_25977.hpos = hpos; *(heap->arr + (unsigned long )hpos) = *(heap->arr + (unsigned long )ppos); *(heap->arr + (unsigned long )ppos) = lprops; lprops->ldv_25977.hpos = ppos; hpos = ppos; if (hpos != 0) { goto ldv_27503; } else { } return; } } static void adjust_lpt_heap(struct ubifs_info *c , struct ubifs_lpt_heap *heap , struct ubifs_lprops *lprops , int hpos , int cat ) { int val1 ; int val2 ; int val3 ; int cpos ; int ppos ; { val1 = get_heap_comp_val(lprops, cat); if (hpos != 0) { ppos = (hpos + -1) / 2; val2 = get_heap_comp_val(*(heap->arr + (unsigned long )ppos), cat); if (val1 > val2) { ldv_27517: (*(heap->arr + (unsigned long )ppos))->ldv_25977.hpos = hpos; *(heap->arr + (unsigned long )hpos) = *(heap->arr + (unsigned long )ppos); *(heap->arr + (unsigned long )ppos) = lprops; lprops->ldv_25977.hpos = ppos; hpos = ppos; if (hpos == 0) { return; } else { } ppos = (hpos + -1) / 2; val2 = get_heap_comp_val(*(heap->arr + (unsigned long )ppos), cat); if (val1 <= val2) { return; } else { } goto ldv_27517; } else { } } else { } ldv_27519: cpos = hpos * 2 + 1; if (heap->cnt <= cpos) { return; } else { } val2 = get_heap_comp_val(*(heap->arr + (unsigned long )cpos), cat); if (val1 < val2) { if (cpos + 1 < heap->cnt) { val3 = get_heap_comp_val(*(heap->arr + ((unsigned long )cpos + 1UL)), cat); if (val3 > val2) { cpos = cpos + 1; } else { } } else { } (*(heap->arr + (unsigned long )cpos))->ldv_25977.hpos = hpos; *(heap->arr + (unsigned long )hpos) = *(heap->arr + (unsigned long )cpos); *(heap->arr + (unsigned long )cpos) = lprops; lprops->ldv_25977.hpos = cpos; hpos = cpos; goto ldv_27518; } else { } cpos = cpos + 1; if (heap->cnt <= cpos) { return; } else { } val3 = get_heap_comp_val(*(heap->arr + (unsigned long )cpos), cat); if (val1 < val3) { (*(heap->arr + (unsigned long )cpos))->ldv_25977.hpos = hpos; *(heap->arr + (unsigned long )hpos) = *(heap->arr + (unsigned long )cpos); *(heap->arr + (unsigned long )cpos) = lprops; lprops->ldv_25977.hpos = cpos; hpos = cpos; goto ldv_27518; } else { } return; ldv_27518: ; goto ldv_27519; } } static int add_to_lpt_heap(struct ubifs_info *c , struct ubifs_lprops *lprops , int cat ) { struct ubifs_lpt_heap *heap ; int b ; int cpos ; int val1 ; int val2 ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct ubifs_lprops *lp ; int tmp___5 ; { heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); if (heap->cnt >= heap->max_cnt) { b = 127; cpos = (int )(((unsigned int )((unsigned long )lprops >> 4) & (unsigned int )b) + (unsigned int )b); tmp___0 = ldv__builtin_expect(cpos < b, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "add_to_lpt_heap", 309, tmp->pid); dump_stack(); } else { } tmp___2 = ldv__builtin_expect(cpos > 255, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "add_to_lpt_heap", 310, tmp___1->pid); dump_stack(); } else { } tmp___4 = ldv__builtin_expect(heap->cnt <= cpos, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "add_to_lpt_heap", 311, tmp___3->pid); dump_stack(); } else { } val1 = get_heap_comp_val(lprops, cat); val2 = get_heap_comp_val(*(heap->arr + (unsigned long )cpos), cat); if (val1 > val2) { lp = *(heap->arr + (unsigned long )cpos); lp->flags = lp->flags & -16; lp->flags = lp->flags; list_add(& lp->ldv_25977.list, & c->uncat_list); lprops->ldv_25977.hpos = cpos; *(heap->arr + (unsigned long )cpos) = lprops; move_up_lpt_heap(c, heap, lprops, cat); dbg_check_heap(c, heap, cat, lprops->ldv_25977.hpos); return (1); } else { } dbg_check_heap(c, heap, cat, -1); return (0); } else { tmp___5 = heap->cnt; heap->cnt = heap->cnt + 1; lprops->ldv_25977.hpos = tmp___5; *(heap->arr + (unsigned long )lprops->ldv_25977.hpos) = lprops; move_up_lpt_heap(c, heap, lprops, cat); dbg_check_heap(c, heap, cat, lprops->ldv_25977.hpos); return (1); } } } static void remove_from_lpt_heap(struct ubifs_info *c , struct ubifs_lprops *lprops , int cat ) { struct ubifs_lpt_heap *heap ; int hpos ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; { hpos = lprops->ldv_25977.hpos; heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); tmp___0 = ldv__builtin_expect(hpos < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "remove_from_lpt_heap", 352, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(heap->cnt <= hpos, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "remove_from_lpt_heap", 352, tmp->pid); dump_stack(); } else { } } tmp___3 = ldv__builtin_expect((unsigned long )*(heap->arr + (unsigned long )hpos) != (unsigned long )lprops, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "remove_from_lpt_heap", 353, tmp___2->pid); dump_stack(); } else { } heap->cnt = heap->cnt + -1; if (heap->cnt > hpos) { *(heap->arr + (unsigned long )hpos) = *(heap->arr + (unsigned long )heap->cnt); (*(heap->arr + (unsigned long )hpos))->ldv_25977.hpos = hpos; adjust_lpt_heap(c, heap, *(heap->arr + (unsigned long )hpos), hpos, cat); } else { } dbg_check_heap(c, heap, cat, -1); return; } } static void lpt_heap_replace(struct ubifs_info *c , struct ubifs_lprops *old_lprops , struct ubifs_lprops *new_lprops , int cat ) { struct ubifs_lpt_heap *heap ; int hpos ; { hpos = new_lprops->ldv_25977.hpos; heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); *(heap->arr + (unsigned long )hpos) = new_lprops; return; } } void ubifs_add_to_cat(struct ubifs_info *c , struct ubifs_lprops *lprops , int cat ) { int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { switch (cat) { case 1: ; case 2: ; case 3: tmp = add_to_lpt_heap(c, lprops, cat); if (tmp != 0) { goto ldv_27556; } else { } cat = 0; case 0: list_add(& lprops->ldv_25977.list, & c->uncat_list); goto ldv_27556; case 4: list_add(& lprops->ldv_25977.list, & c->empty_list); goto ldv_27556; case 5: list_add(& lprops->ldv_25977.list, & c->freeable_list); c->freeable_cnt = c->freeable_cnt + 1; goto ldv_27556; case 6: list_add(& lprops->ldv_25977.list, & c->frdi_idx_list); goto ldv_27556; default: tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_to_cat", 420, tmp___0->pid); dump_stack(); } ldv_27556: lprops->flags = lprops->flags & -16; lprops->flags = lprops->flags | cat; c->in_a_category_cnt = c->in_a_category_cnt + 1; tmp___2 = ldv__builtin_expect(c->in_a_category_cnt > c->main_lebs, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_add_to_cat", 426, tmp___1->pid); dump_stack(); } else { } return; } } static void ubifs_remove_from_cat(struct ubifs_info *c , struct ubifs_lprops *lprops , int cat ) { struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; { switch (cat) { case 1: ; case 2: ; case 3: remove_from_lpt_heap(c, lprops, cat); goto ldv_27571; case 5: c->freeable_cnt = c->freeable_cnt + -1; tmp___0 = ldv__builtin_expect(c->freeable_cnt < 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remove_from_cat", 448, tmp->pid); dump_stack(); } else { } case 0: ; case 4: ; case 6: tmp___2 = list_empty((struct list_head const *)(& lprops->ldv_25977.list)); tmp___3 = ldv__builtin_expect(tmp___2 != 0, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remove_from_cat", 453, tmp___1->pid); dump_stack(); } else { } list_del(& lprops->ldv_25977.list); goto ldv_27571; default: tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remove_from_cat", 457, tmp___4->pid); dump_stack(); } ldv_27571: c->in_a_category_cnt = c->in_a_category_cnt + -1; tmp___6 = ldv__builtin_expect(c->in_a_category_cnt < 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_remove_from_cat", 461, tmp___5->pid); dump_stack(); } else { } return; } } void ubifs_replace_cat(struct ubifs_info *c , struct ubifs_lprops *old_lprops , struct ubifs_lprops *new_lprops ) { int cat ; struct task_struct *tmp ; { cat = new_lprops->flags & 15; switch (cat) { case 1: ; case 2: ; case 3: lpt_heap_replace(c, old_lprops, new_lprops, cat); goto ldv_27587; case 0: ; case 4: ; case 5: ; case 6: list_replace(& old_lprops->ldv_25977.list, & new_lprops->ldv_25977.list); goto ldv_27587; default: tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_replace_cat", 493, tmp->pid); dump_stack(); } ldv_27587: ; return; } } void ubifs_ensure_cat(struct ubifs_info *c , struct ubifs_lprops *lprops ) { int cat ; { cat = lprops->flags & 15; if (cat != 0) { return; } else { } cat = ubifs_categorize_lprops((struct ubifs_info const *)c, (struct ubifs_lprops const *)lprops); if (cat == 0) { return; } else { } ubifs_remove_from_cat(c, lprops, 0); ubifs_add_to_cat(c, lprops, cat); return; } } int ubifs_categorize_lprops(struct ubifs_info const *c , struct ubifs_lprops const *lprops ) { struct task_struct *tmp ; long tmp___0 ; { if (((int )lprops->flags & 16) != 0) { return (0); } else { } if ((int )lprops->free == (int )c->leb_size) { tmp___0 = ldv__builtin_expect(((int )lprops->flags & 32) != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_categorize_lprops", 536, tmp->pid); dump_stack(); } else { } return (4); } else { } if ((int )lprops->free + (int )lprops->dirty == (int )c->leb_size) { if (((int )lprops->flags & 32) != 0) { return (6); } else { return (5); } } else { } if (((int )lprops->flags & 32) != 0) { if ((int )lprops->dirty + (int )lprops->free >= (int )c->min_idx_node_sz) { return (2); } else { if ((int )lprops->dirty >= (int )c->dead_wm && (int )lprops->dirty > (int )lprops->free) { return (1); } else { } if ((int )lprops->free > 0) { return (3); } else { } } } else { } return (0); } } static void change_category(struct ubifs_info *c , struct ubifs_lprops *lprops ) { int old_cat ; int new_cat ; int tmp ; struct ubifs_lpt_heap *heap ; { old_cat = lprops->flags & 15; tmp = ubifs_categorize_lprops((struct ubifs_info const *)c, (struct ubifs_lprops const *)lprops); new_cat = tmp; if (old_cat == new_cat) { if (new_cat <= 0 || new_cat > 3) { return; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )new_cat + 0xffffffffffffffffUL); adjust_lpt_heap(c, heap, lprops, lprops->ldv_25977.hpos, new_cat); } else { ubifs_remove_from_cat(c, lprops, old_cat); ubifs_add_to_cat(c, lprops, new_cat); } return; } } int ubifs_calc_dark(struct ubifs_info const *c , int spc ) { struct task_struct *tmp ; long tmp___0 ; { tmp___0 = ldv__builtin_expect((spc & 7) != 0, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_calc_dark", 602, tmp->pid); dump_stack(); } else { } if ((int )c->dark_wm > spc) { return (spc); } else { } if ((unsigned int )(spc - (int )c->dark_wm) <= 55U) { return ((int )((unsigned int )spc - 56U)); } else { } return ((int )c->dark_wm); } } static int is_lprops_dirty(struct ubifs_info *c , struct ubifs_lprops *lprops ) { struct ubifs_pnode *pnode ; int pos ; struct ubifs_lprops const *__mptr ; int tmp ; int tmp___0 ; int tmp___1 ; { pos = (lprops->lnum - c->main_first) & 3; __mptr = (struct ubifs_lprops const *)(lprops + - ((unsigned long )pos)); pnode = (struct ubifs_pnode *)__mptr + 0xffffffffffffffd8UL; tmp = constant_test_bit(2U, (unsigned long const volatile *)(& pnode->flags)); if (tmp == 0) { tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& pnode->flags)); if (tmp___0 != 0) { tmp___1 = 1; } else { tmp___1 = 0; } } else { tmp___1 = 0; } return (tmp___1); } } struct ubifs_lprops const *ubifs_change_lp(struct ubifs_info *c , struct ubifs_lprops const *lp , int free , int dirty , int flags , int idx_gc_cnt ) { struct ubifs_lprops *lprops ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; int tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; struct task_struct *tmp___11 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; struct task_struct *tmp___15 ; long tmp___16 ; long tmp___17 ; struct task_struct *tmp___18 ; long tmp___19 ; long tmp___20 ; struct task_struct *tmp___21 ; long tmp___22 ; struct task_struct *tmp___23 ; long tmp___24 ; long tmp___25 ; struct task_struct *tmp___26 ; long tmp___27 ; long tmp___28 ; long tmp___29 ; struct task_struct *tmp___30 ; struct ubifs_lprops *tmp___31 ; long tmp___32 ; int tmp___33 ; struct task_struct *tmp___34 ; long tmp___35 ; long tmp___36 ; int old_spc ; int tmp___37 ; int new_spc ; int tmp___38 ; { lprops = (struct ubifs_lprops *)lp; descriptor.modname = "ubifs"; descriptor.function = "ubifs_change_lp"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lprops.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d, free %d, dirty %d, flags %d\n"; descriptor.lineno = 665U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d, free %d, dirty %d, flags %d\n", tmp->pid, lprops->lnum, free, dirty, flags); } else { } tmp___2 = mutex_is_locked(& c->lp_mutex); tmp___3 = ldv__builtin_expect(tmp___2 == 0, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 667, tmp___1->pid); dump_stack(); } else { } tmp___5 = ldv__builtin_expect(c->lst.empty_lebs < 0, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 669, tmp___4->pid); dump_stack(); } else { tmp___6 = ldv__builtin_expect(c->lst.empty_lebs > c->main_lebs, 0L); if (tmp___6 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 669, tmp___4->pid); dump_stack(); } else { } } tmp___8 = ldv__builtin_expect(c->freeable_cnt < 0, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 670, tmp___7->pid); dump_stack(); } else { } tmp___10 = ldv__builtin_expect(c->freeable_cnt > c->main_lebs, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 671, tmp___9->pid); dump_stack(); } else { } tmp___12 = ldv__builtin_expect(c->lst.taken_empty_lebs < 0, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 672, tmp___11->pid); dump_stack(); } else { } tmp___14 = ldv__builtin_expect(c->lst.taken_empty_lebs > c->lst.empty_lebs, 0L); if (tmp___14 != 0L) { tmp___13 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 673, tmp___13->pid); dump_stack(); } else { } tmp___16 = ldv__builtin_expect((c->lst.total_free & 7LL) != 0LL, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 674, tmp___15->pid); dump_stack(); } else { tmp___17 = ldv__builtin_expect((c->lst.total_dirty & 7LL) != 0LL, 0L); if (tmp___17 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 674, tmp___15->pid); dump_stack(); } else { } } tmp___19 = ldv__builtin_expect((c->lst.total_dead & 7LL) != 0LL, 0L); if (tmp___19 != 0L) { tmp___18 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 675, tmp___18->pid); dump_stack(); } else { tmp___20 = ldv__builtin_expect((c->lst.total_dark & 7LL) != 0LL, 0L); if (tmp___20 != 0L) { tmp___18 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 675, tmp___18->pid); dump_stack(); } else { } } tmp___22 = ldv__builtin_expect((c->lst.total_used & 7LL) != 0LL, 0L); if (tmp___22 != 0L) { tmp___21 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 676, tmp___21->pid); dump_stack(); } else { } tmp___24 = ldv__builtin_expect(free != -2147483647, 0L); if (tmp___24 != 0L) { tmp___25 = ldv__builtin_expect(free < 0, 0L); if (tmp___25 != 0L) { tmp___23 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 677, tmp___23->pid); dump_stack(); } else { } } else { } tmp___27 = ldv__builtin_expect(dirty != -2147483647, 0L); if (tmp___27 != 0L) { tmp___28 = ldv__builtin_expect(dirty < 0, 0L); if (tmp___28 != 0L) { tmp___26 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 678, tmp___26->pid); dump_stack(); } else { } } else { } tmp___33 = is_lprops_dirty(c, lprops); if (tmp___33 == 0) { lprops = ubifs_lpt_lookup_dirty(c, lprops->lnum); tmp___29 = IS_ERR((void const *)lprops); if (tmp___29 != 0L) { return ((struct ubifs_lprops const *)lprops); } else { } } else { tmp___31 = ubifs_lpt_lookup_dirty(c, lprops->lnum); tmp___32 = ldv__builtin_expect((unsigned long )tmp___31 != (unsigned long )lprops, 0L); if (tmp___32 != 0L) { tmp___30 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 685, tmp___30->pid); dump_stack(); } else { } } tmp___35 = ldv__builtin_expect((lprops->free & 7) != 0, 0L); if (tmp___35 != 0L) { tmp___34 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 687, tmp___34->pid); dump_stack(); } else { tmp___36 = ldv__builtin_expect((lprops->dirty & 7) != 0, 0L); if (tmp___36 != 0L) { tmp___34 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_change_lp", 687, tmp___34->pid); dump_stack(); } else { } } spin_lock(& c->space_lock); if ((lprops->flags & 16) != 0 && lprops->free == c->leb_size) { c->lst.taken_empty_lebs = c->lst.taken_empty_lebs + -1; } else { } if ((lprops->flags & 32) == 0) { old_spc = lprops->free + lprops->dirty; if (c->dead_wm > old_spc) { c->lst.total_dead = c->lst.total_dead - (long long )old_spc; } else { tmp___37 = ubifs_calc_dark((struct ubifs_info const *)c, old_spc); c->lst.total_dark = c->lst.total_dark - (long long )tmp___37; } c->lst.total_used = c->lst.total_used - (long long )(c->leb_size - old_spc); } else { } if (free != -2147483647) { free = (free + 7) & -8; c->lst.total_free = c->lst.total_free + (long long )(free - lprops->free); if (c->leb_size == free) { if (lprops->free != c->leb_size) { c->lst.empty_lebs = c->lst.empty_lebs + 1; } else if (lprops->free == c->leb_size) { c->lst.empty_lebs = c->lst.empty_lebs + -1; } else { } } else { } lprops->free = free; } else { } if (dirty != -2147483647) { dirty = (dirty + 7) & -8; c->lst.total_dirty = c->lst.total_dirty + (long long )(dirty - lprops->dirty); lprops->dirty = dirty; } else { } if (flags != -2147483647) { if ((lprops->flags & 32) != 0) { if ((flags & 32) == 0) { c->lst.idx_lebs = c->lst.idx_lebs + -1; } else if ((flags & 32) != 0) { c->lst.idx_lebs = c->lst.idx_lebs + 1; } else { } } else { } lprops->flags = flags; } else { } if ((lprops->flags & 32) == 0) { new_spc = lprops->free + lprops->dirty; if (c->dead_wm > new_spc) { c->lst.total_dead = c->lst.total_dead + (long long )new_spc; } else { tmp___38 = ubifs_calc_dark((struct ubifs_info const *)c, new_spc); c->lst.total_dark = c->lst.total_dark + (long long )tmp___38; } c->lst.total_used = c->lst.total_used + (long long )(c->leb_size - new_spc); } else { } if ((lprops->flags & 16) != 0 && lprops->free == c->leb_size) { c->lst.taken_empty_lebs = c->lst.taken_empty_lebs + 1; } else { } change_category(c, lprops); c->idx_gc_cnt = c->idx_gc_cnt + idx_gc_cnt; spin_unlock(& c->space_lock); return ((struct ubifs_lprops const *)lprops); } } void ubifs_get_lp_stats(struct ubifs_info *c , struct ubifs_lp_stats *lst ) { size_t __len ; void *__ret ; { spin_lock(& c->space_lock); __len = 56UL; if (__len > 63UL) { __ret = memcpy((void *)lst, (void const *)(& c->lst), __len); } else { __ret = memcpy((void *)lst, (void const *)(& c->lst), __len); } spin_unlock(& c->space_lock); return; } } int ubifs_change_one_lp(struct ubifs_info *c , int lnum , int free , int dirty , int flags_set , int flags_clean , int idx_gc_cnt ) { int err ; int flags ; struct ubifs_lprops const *lp ; struct ubifs_lprops *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; { err = 0; ubifs_get_lprops___3(c); tmp = ubifs_lpt_lookup_dirty(c, lnum); lp = (struct ubifs_lprops const *)tmp; tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)lp); err = (int )tmp___0; goto out; } else { } flags = ((int )lp->flags | flags_set) & ~ flags_clean; lp = ubifs_change_lp(c, lp, free, dirty, flags, idx_gc_cnt); tmp___3 = IS_ERR((void const *)lp); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)lp); err = (int )tmp___2; } else { } out: ubifs_release_lprops___3(c); if (err != 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot change properties of LEB %d, error %d\n", tmp___4->pid, "ubifs_change_one_lp", lnum, err); } else { } return (err); } } int ubifs_update_one_lp(struct ubifs_info *c , int lnum , int free , int dirty , int flags_set , int flags_clean ) { int err ; int flags ; struct ubifs_lprops const *lp ; struct ubifs_lprops *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; { err = 0; ubifs_get_lprops___3(c); tmp = ubifs_lpt_lookup_dirty(c, lnum); lp = (struct ubifs_lprops const *)tmp; tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)lp); err = (int )tmp___0; goto out; } else { } flags = ((int )lp->flags | flags_set) & ~ flags_clean; lp = ubifs_change_lp(c, lp, free, (int )lp->dirty + dirty, flags, 0); tmp___3 = IS_ERR((void const *)lp); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)lp); err = (int )tmp___2; } else { } out: ubifs_release_lprops___3(c); if (err != 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot update properties of LEB %d, error %d\n", tmp___4->pid, "ubifs_update_one_lp", lnum, err); } else { } return (err); } } int ubifs_read_one_lp(struct ubifs_info *c , int lnum , struct ubifs_lprops *lp ) { int err ; struct ubifs_lprops const *lpp ; struct ubifs_lprops *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; size_t __len ; void *__ret ; { err = 0; ubifs_get_lprops___3(c); tmp = ubifs_lpt_lookup(c, lnum); lpp = (struct ubifs_lprops const *)tmp; tmp___2 = IS_ERR((void const *)lpp); if (tmp___2 != 0L) { tmp___0 = PTR_ERR((void const *)lpp); err = (int )tmp___0; tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read properties of LEB %d, error %d\n", tmp___1->pid, "ubifs_read_one_lp", lnum, err); goto out; } else { } __len = 32UL; if (__len > 63UL) { __ret = memcpy((void *)lp, (void const *)lpp, __len); } else { __ret = memcpy((void *)lp, (void const *)lpp, __len); } out: ubifs_release_lprops___3(c); return (err); } } struct ubifs_lprops const *ubifs_fast_find_free(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct ubifs_lpt_heap *heap ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_free", 892, tmp->pid); dump_stack(); } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 2UL; if (heap->cnt == 0) { return (0); } else { } lprops = *(heap->arr); tmp___3 = ldv__builtin_expect((lprops->flags & 16) != 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_free", 899, tmp___2->pid); dump_stack(); } else { } tmp___5 = ldv__builtin_expect((lprops->flags & 32) != 0, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_free", 900, tmp___4->pid); dump_stack(); } else { } return ((struct ubifs_lprops const *)lprops); } } struct ubifs_lprops const *ubifs_fast_find_empty(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; struct list_head const *__mptr ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_empty", 915, tmp->pid); dump_stack(); } else { } tmp___2 = list_empty((struct list_head const *)(& c->empty_list)); if (tmp___2 != 0) { return (0); } else { } __mptr = (struct list_head const *)c->empty_list.next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; tmp___4 = ldv__builtin_expect((lprops->flags & 16) != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_empty", 921, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect((lprops->flags & 32) != 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_empty", 922, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect(lprops->free != c->leb_size, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_empty", 923, tmp___7->pid); dump_stack(); } else { } return ((struct ubifs_lprops const *)lprops); } } struct ubifs_lprops const *ubifs_fast_find_freeable(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; struct list_head const *__mptr ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_freeable", 938, tmp->pid); dump_stack(); } else { } tmp___2 = list_empty((struct list_head const *)(& c->freeable_list)); if (tmp___2 != 0) { return (0); } else { } __mptr = (struct list_head const *)c->freeable_list.next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; tmp___4 = ldv__builtin_expect((lprops->flags & 16) != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_freeable", 944, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect((lprops->flags & 32) != 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_freeable", 945, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect(lprops->free + lprops->dirty != c->leb_size, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_freeable", 946, tmp___7->pid); dump_stack(); } else { } tmp___10 = ldv__builtin_expect(c->freeable_cnt <= 0, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_freeable", 947, tmp___9->pid); dump_stack(); } else { } return ((struct ubifs_lprops const *)lprops); } } struct ubifs_lprops const *ubifs_fast_find_frdi_idx(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; int tmp___2 ; struct list_head const *__mptr ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; { tmp___0 = mutex_is_locked(& c->lp_mutex); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_frdi_idx", 962, tmp->pid); dump_stack(); } else { } tmp___2 = list_empty((struct list_head const *)(& c->frdi_idx_list)); if (tmp___2 != 0) { return (0); } else { } __mptr = (struct list_head const *)c->frdi_idx_list.next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; tmp___4 = ldv__builtin_expect((lprops->flags & 16) != 0, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_frdi_idx", 968, tmp___3->pid); dump_stack(); } else { } tmp___6 = ldv__builtin_expect((lprops->flags & 32) == 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_frdi_idx", 969, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect(lprops->free + lprops->dirty != c->leb_size, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_fast_find_frdi_idx", 970, tmp___7->pid); dump_stack(); } else { } return ((struct ubifs_lprops const *)lprops); } } int dbg_check_cats(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct list_head *pos ; int i ; int cat ; int tmp ; int tmp___0 ; struct list_head const *__mptr ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct list_head const *__mptr___2 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; struct list_head const *__mptr___3 ; struct task_struct *tmp___7 ; struct task_struct *tmp___8 ; struct task_struct *tmp___9 ; struct list_head const *__mptr___4 ; struct ubifs_lpt_heap *heap ; struct task_struct *tmp___10 ; struct task_struct *tmp___11 ; struct task_struct *tmp___12 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { tmp___0 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___0 == 0) { return (0); } else { } } else { } __mptr = (struct list_head const *)c->empty_list.next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; goto ldv_27723; ldv_27722: ; if (lprops->free != c->leb_size) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: non-empty LEB %d on empty list (free %d dirty %d flags %d)\n", tmp___1->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } if ((lprops->flags & 16) != 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: taken LEB %d on empty list (free %d dirty %d flags %d)\n", tmp___2->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27723: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->empty_list)) { goto ldv_27722; } else { } i = 0; __mptr___1 = (struct list_head const *)c->freeable_list.next; lprops = (struct ubifs_lprops *)__mptr___1 + 0xfffffffffffffff0UL; goto ldv_27730; ldv_27729: ; if (lprops->free + lprops->dirty != c->leb_size) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: non-freeable LEB %d on freeable list (free %d dirty %d flags %d)\n", tmp___3->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } if ((lprops->flags & 16) != 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: taken LEB %d on freeable list (free %d dirty %d flags %d)\n", tmp___4->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } i = i + 1; __mptr___2 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___2 + 0xfffffffffffffff0UL; ldv_27730: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->freeable_list)) { goto ldv_27729; } else { } if (c->freeable_cnt != i) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: freeable list count %d expected %d\n", tmp___5->pid, "dbg_check_cats", i, c->freeable_cnt); return (-22); } else { } i = 0; pos = c->idx_gc.next; goto ldv_27733; ldv_27732: i = i + 1; pos = pos->next; ldv_27733: ; if ((unsigned long )(& c->idx_gc) != (unsigned long )pos) { goto ldv_27732; } else { } if (c->idx_gc_cnt != i) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: idx_gc list count %d expected %d\n", tmp___6->pid, "dbg_check_cats", i, c->idx_gc_cnt); return (-22); } else { } __mptr___3 = (struct list_head const *)c->frdi_idx_list.next; lprops = (struct ubifs_lprops *)__mptr___3 + 0xfffffffffffffff0UL; goto ldv_27740; ldv_27739: ; if (lprops->free + lprops->dirty != c->leb_size) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: non-freeable LEB %d on frdi_idx list (free %d dirty %d flags %d)\n", tmp___7->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } if ((lprops->flags & 16) != 0) { tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: taken LEB %d on frdi_idx list (free %d dirty %d flags %d)\n", tmp___8->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } if ((lprops->flags & 32) == 0) { tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: non-index LEB %d on frdi_idx list (free %d dirty %d flags %d)\n", tmp___9->pid, "dbg_check_cats", lprops->lnum, lprops->free, lprops->dirty, lprops->flags); return (-22); } else { } __mptr___4 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___4 + 0xfffffffffffffff0UL; ldv_27740: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->frdi_idx_list)) { goto ldv_27739; } else { } cat = 1; goto ldv_27747; ldv_27746: heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); i = 0; goto ldv_27744; ldv_27743: lprops = *(heap->arr + (unsigned long )i); if ((unsigned long )lprops == (unsigned long )((struct ubifs_lprops *)0)) { tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: null ptr in LPT heap cat %d\n", tmp___10->pid, "dbg_check_cats", cat); return (-22); } else { } if (lprops->ldv_25977.hpos != i) { tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: bad ptr in LPT heap cat %d\n", tmp___11->pid, "dbg_check_cats", cat); return (-22); } else { } if ((lprops->flags & 16) != 0) { tmp___12 = get_current(); printk("\vUBIFS error (pid %d): %s: taken LEB in LPT heap cat %d\n", tmp___12->pid, "dbg_check_cats", cat); return (-22); } else { } i = i + 1; ldv_27744: ; if (heap->cnt > i) { goto ldv_27743; } else { } cat = cat + 1; ldv_27747: ; if (cat <= 3) { goto ldv_27746; } else { } return (0); } } void dbg_check_heap(struct ubifs_info *c , struct ubifs_lpt_heap *heap , int cat , int add_pos ) { int i ; int j ; int err ; int tmp ; int tmp___0 ; struct ubifs_lprops *lprops ; struct ubifs_lprops *lp ; long tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; { i = 0; err = 0; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { tmp___0 = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp___0 == 0) { return; } else { } } else { } i = 0; goto ldv_27766; ldv_27765: lprops = *(heap->arr + (unsigned long )i); if (i != add_pos) { if ((lprops->flags & 15) != cat) { err = 1; goto out; } else { } } else { } if (lprops->ldv_25977.hpos != i) { err = 2; goto out; } else { } lp = ubifs_lpt_lookup(c, lprops->lnum); tmp___1 = IS_ERR((void const *)lp); if (tmp___1 != 0L) { err = 3; goto out; } else { } if ((unsigned long )lprops != (unsigned long )lp) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: lprops %zx lp %zx lprops->lnum %d lp->lnum %d\n", tmp___2->pid, "dbg_check_heap", (unsigned long )lprops, (unsigned long )lp, lprops->lnum, lp->lnum); err = 4; goto out; } else { } j = 0; goto ldv_27763; ldv_27762: lp = *(heap->arr + (unsigned long )j); if ((unsigned long )lp == (unsigned long )lprops) { err = 5; goto out; } else { } if (lp->lnum == lprops->lnum) { err = 6; goto out; } else { } j = j + 1; ldv_27763: ; if (j < i) { goto ldv_27762; } else { } i = i + 1; ldv_27766: ; if (heap->cnt > i) { goto ldv_27765; } else { } out: ; if (err != 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: failed cat %d hpos %d err %d\n", tmp___3->pid, "dbg_check_heap", cat, i, err); dump_stack(); ubifs_dump_heap(c, heap, cat); } else { } return; } } static int scan_check_cb(struct ubifs_info *c , struct ubifs_lprops const *lp , int in_tree , struct ubifs_lp_stats *lst ) { struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; int cat ; int lnum ; int is_idx ; int used ; int free ; int dirty ; int ret ; void *buf ; struct task_struct *tmp ; struct list_head *list ; struct ubifs_lprops *lprops ; int found ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___0 ; struct ubifs_lpt_heap *heap ; struct task_struct *tmp___1 ; pgprot_t __constr_expr_0 ; int tmp___2 ; int tmp___3 ; long tmp___4 ; long tmp___5 ; struct list_head const *__mptr___1 ; int found___0 ; int level ; struct task_struct *tmp___6 ; struct ubifs_idx_node *idx ; void *tmp___7 ; struct list_head const *__mptr___2 ; struct task_struct *tmp___8 ; struct task_struct *tmp___9 ; struct task_struct *tmp___10 ; int spc ; int tmp___11 ; struct task_struct *tmp___12 ; { lnum = lp->lnum; is_idx = 0; used = 0; buf = 0; cat = (int )lp->flags & 15; if (cat != 0) { cat = ubifs_categorize_lprops((struct ubifs_info const *)c, lp); if (((int )lp->flags & 15) != cat) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: bad LEB category %d expected %d\n", tmp->pid, "scan_check_cb", (int )lp->flags & 15, cat); return (-22); } else { } } else { } if (in_tree != 0) { list = 0; switch (cat) { case 4: list = & c->empty_list; goto ldv_27787; case 5: list = & c->freeable_list; goto ldv_27787; case 6: list = & c->frdi_idx_list; goto ldv_27787; case 0: list = & c->uncat_list; goto ldv_27787; } ldv_27787: ; if ((unsigned long )list != (unsigned long )((struct list_head *)0)) { found = 0; __mptr = (struct list_head const *)list->next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; goto ldv_27799; ldv_27798: ; if ((unsigned long )((struct ubifs_lprops const *)lprops) == (unsigned long )lp) { found = 1; goto ldv_27797; } else { } __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27799: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )list) { goto ldv_27798; } else { } ldv_27797: ; if (found == 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad LPT list (category %d)\n", tmp___0->pid, "scan_check_cb", cat); return (-22); } else { } } else { } } else { } if ((in_tree != 0 && cat > 0) && cat <= 3) { heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + ((unsigned long )cat + 0xffffffffffffffffUL); if (((int )lp->ldv_25977.hpos != -1 && (*(heap->arr + (unsigned long )lp->ldv_25977.hpos))->lnum != lnum) || (unsigned long )((struct ubifs_lprops const *)*(heap->arr + (unsigned long )lp->ldv_25977.hpos)) != (unsigned long )lp) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: bad LPT heap (category %d)\n", tmp___1->pid, "scan_check_cb", cat); return (-22); } else { } } else { } __constr_expr_0.pgprot = 0x8000000000000163UL; buf = __vmalloc((unsigned long )c->leb_size, 80U, __constr_expr_0); if ((unsigned long )buf == (unsigned long )((void *)0)) { return (-12); } else { } if ((int )lp->free == c->leb_size) { lst->empty_lebs = lst->empty_lebs + 1; lst->total_free = lst->total_free + (long long )c->leb_size; tmp___2 = ubifs_calc_dark((struct ubifs_info const *)c, c->leb_size); lst->total_dark = lst->total_dark + (long long )tmp___2; return (0); } else { } if ((int )lp->free + (int )lp->dirty == c->leb_size && ((int )lp->flags & 32) == 0) { lst->total_free = lst->total_free + (long long )lp->free; lst->total_dirty = lst->total_dirty + (long long )lp->dirty; tmp___3 = ubifs_calc_dark((struct ubifs_info const *)c, c->leb_size); lst->total_dark = lst->total_dark + (long long )tmp___3; return (0); } else { } sleb = ubifs_scan((struct ubifs_info const *)c, lnum, 0, buf, 0); tmp___5 = IS_ERR((void const *)sleb); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)sleb); ret = (int )tmp___4; if (ret == -117) { ubifs_dump_lprops(c); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); } else { } goto out; } else { } is_idx = -1; __mptr___1 = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr___1; goto ldv_27813; ldv_27812: level = 0; __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lprops.c.prepared", 1249, 0); _cond_resched(); if (is_idx == -1) { is_idx = snod->type == 9; } else { } if (is_idx != 0 && snod->type != 9) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: indexing node in data LEB %d:%d\n", tmp___6->pid, "scan_check_cb", lnum, snod->offs); goto out_destroy; } else { } if (snod->type == 9) { idx = (struct ubifs_idx_node *)snod->node; tmp___7 = ubifs_idx_key((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx); key_read((struct ubifs_info const *)c, (void const *)tmp___7, & snod->key); level = (int )idx->level; } else { } found___0 = ubifs_tnc_has_node(c, & snod->key, level, lnum, snod->offs, is_idx); if (found___0 != 0) { if (found___0 < 0) { goto out_destroy; } else { } used = ((snod->len + 7) & -8) + used; } else { } __mptr___2 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___2; ldv_27813: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_27812; } else { } free = c->leb_size - sleb->endpt; dirty = sleb->endpt - used; if (((c->leb_size < free || free < 0) || c->leb_size < dirty) || dirty < 0) { tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: bad calculated accounting for LEB %d: free %d, dirty %d\n", tmp___8->pid, "scan_check_cb", lnum, free, dirty); goto out_destroy; } else { } if ((int )lp->free + (int )lp->dirty == c->leb_size && free + dirty == c->leb_size) { if (((is_idx != 0 && ((int )lp->flags & 32) == 0) || (is_idx == 0 && c->leb_size == free)) || (int )lp->free == c->leb_size) { free = lp->free; dirty = lp->dirty; is_idx = 0; } else { } } else { } if ((is_idx != 0 && (int )lp->free + (int )lp->dirty == free + dirty) && c->ihead_lnum != lnum) { free = lp->free; dirty = lp->dirty; } else { } if ((int )lp->free != free || (int )lp->dirty != dirty) { goto out_print; } else { } if (is_idx != 0 && ((int )lp->flags & 32) == 0) { if (c->leb_size == free) { is_idx = 0; } else { tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: indexing node without indexing flag\n", tmp___9->pid, "scan_check_cb"); goto out_print; } } else { } if (is_idx == 0 && ((int )lp->flags & 32) != 0) { tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: data node with indexing flag\n", tmp___10->pid, "scan_check_cb"); goto out_print; } else { } if (c->leb_size == free) { lst->empty_lebs = lst->empty_lebs + 1; } else { } if (is_idx != 0) { lst->idx_lebs = lst->idx_lebs + 1; } else { } if (((int )lp->flags & 32) == 0) { lst->total_used = lst->total_used + (long long )((c->leb_size - free) - dirty); } else { } lst->total_free = lst->total_free + (long long )free; lst->total_dirty = lst->total_dirty + (long long )dirty; if (((int )lp->flags & 32) == 0) { spc = free + dirty; if (c->dead_wm > spc) { lst->total_dead = lst->total_dead + (long long )spc; } else { tmp___11 = ubifs_calc_dark((struct ubifs_info const *)c, spc); lst->total_dark = lst->total_dark + (long long )tmp___11; } } else { } ubifs_scan_destroy(sleb); vfree((void const *)buf); return (0); out_print: tmp___12 = get_current(); printk("\vUBIFS error (pid %d): %s: bad accounting of LEB %d: free %d, dirty %d flags %#x, should be free %d, dirty %d\n", tmp___12->pid, "scan_check_cb", lnum, lp->free, lp->dirty, lp->flags, free, dirty); ubifs_dump_leb((struct ubifs_info const *)c, lnum); out_destroy: ubifs_scan_destroy(sleb); ret = -22; out: vfree((void const *)buf); return (ret); } } int dbg_check_lprops(struct ubifs_info *c ) { int i ; int err ; struct ubifs_lp_stats lst ; int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } i = 0; goto ldv_27824; ldv_27823: err = ubifs_wbuf_sync___2(& (c->jheads + (unsigned long )i)->wbuf); if (err != 0) { return (err); } else { } i = i + 1; ldv_27824: ; if (c->jhead_cnt > i) { goto ldv_27823; } else { } memset((void *)(& lst), 0, 56UL); err = ubifs_lpt_scan_nolock(c, c->main_first, c->leb_cnt + -1, (int (*)(struct ubifs_info * , struct ubifs_lprops const * , int , void * ))(& scan_check_cb), (void *)(& lst)); if (err != 0 && err != -28) { goto out; } else { } if ((((lst.empty_lebs != c->lst.empty_lebs || lst.idx_lebs != c->lst.idx_lebs) || lst.total_free != c->lst.total_free) || lst.total_dirty != c->lst.total_dirty) || lst.total_used != c->lst.total_used) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad overall accounting\n", tmp___0->pid, "dbg_check_lprops"); tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: calculated: empty_lebs %d, idx_lebs %d, total_free %lld, total_dirty %lld, total_used %lld\n", tmp___1->pid, "dbg_check_lprops", lst.empty_lebs, lst.idx_lebs, lst.total_free, lst.total_dirty, lst.total_used); tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: read from lprops: empty_lebs %d, idx_lebs %d, total_free %lld, total_dirty %lld, total_used %lld\n", tmp___2->pid, "dbg_check_lprops", c->lst.empty_lebs, c->lst.idx_lebs, c->lst.total_free, c->lst.total_dirty, c->lst.total_used); err = -22; goto out; } else { } if (lst.total_dead != c->lst.total_dead || lst.total_dark != c->lst.total_dark) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: bad dead/dark space accounting\n", tmp___3->pid, "dbg_check_lprops"); tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: calculated: total_dead %lld, total_dark %lld\n", tmp___4->pid, "dbg_check_lprops", lst.total_dead, lst.total_dark); tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: read from lprops: total_dead %lld, total_dark %lld\n", tmp___5->pid, "dbg_check_lprops", c->lst.total_dead, c->lst.total_dark); err = -22; goto out; } else { } err = dbg_check_cats(c); out: ; return (err); } } void ldv_mutex_lock_599(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_600(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_601(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_602(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_603(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_604(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_605(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_606(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_619(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_lock_nested_623(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_616(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_618(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_620(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_622(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_624(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_615(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_617(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_621(struct mutex *ldv_func_arg1 ) ; static int is_empty(void *buf , int len ) { uint8_t *p ; int i ; uint8_t *tmp ; { p = (uint8_t *)buf; i = 0; goto ldv_27523; ldv_27522: tmp = p; p = p + 1; if ((unsigned int )*tmp != 255U) { return (0); } else { } i = i + 1; ldv_27523: ; if (i < len) { goto ldv_27522; } else { } return (1); } } static int first_non_ff(void *buf , int len ) { uint8_t *p ; int i ; uint8_t *tmp ; { p = (uint8_t *)buf; i = 0; goto ldv_27532; ldv_27531: tmp = p; p = p + 1; if ((unsigned int )*tmp != 255U) { return (i); } else { } i = i + 1; ldv_27532: ; if (i < len) { goto ldv_27531; } else { } return (-1); } } static int get_master_node(struct ubifs_info const *c , int lnum , void **pbuf , struct ubifs_mst_node **mst , void **cor ) { int sz ; int err ; int offs ; int len ; void *sbuf ; void *buf ; struct ubifs_ch *ch ; int ret ; struct ubifs_ch *ch___0 ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; int __min1 ; int __min2 ; int tmp___3 ; int tmp___4 ; { sz = c->mst_node_alsz; sbuf = vmalloc((unsigned long )c->leb_size); if ((unsigned long )sbuf == (unsigned long )((void *)0)) { return (-12); } else { } err = ubifs_leb_read(c, lnum, sbuf, 0, c->leb_size, 0); if (err != 0 && err != -74) { goto out_free; } else { } offs = 0; buf = sbuf; len = c->leb_size; goto ldv_27551; ldv_27550: ch = (struct ubifs_ch *)buf; if (ch->magic != 101718065U) { goto ldv_27549; } else { } offs = offs + sz; buf = buf + (unsigned long )sz; len = len - sz; ldv_27551: ; if ((unsigned long )offs + 512UL <= (unsigned long )c->leb_size) { goto ldv_27550; } else { } ldv_27549: ; if (offs != 0) { offs = offs - sz; buf = buf + - ((unsigned long )sz); len = len + sz; ret = ubifs_scan_a_node(c, buf, len, lnum, offs, 1); if (ret != -2 && offs != 0) { offs = offs - sz; buf = buf + - ((unsigned long )sz); len = len + sz; ret = ubifs_scan_a_node(c, buf, len, lnum, offs, 1); if (ret != -2) { goto out_err; } else { } } else { } if (ret == -2) { ch___0 = (struct ubifs_ch *)buf; if ((unsigned int )ch___0->node_type != 7U) { goto out_err; } else { } descriptor.modname = "ubifs"; descriptor.function = "get_master_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): found a master node at %d:%d\n"; descriptor.lineno = 283U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): found a master node at %d:%d\n", tmp->pid, lnum, offs); } else { } *mst = (struct ubifs_mst_node *)buf; offs = offs + sz; buf = buf + (unsigned long )sz; len = len - sz; } else { } } else { } if ((int )c->leb_size > offs) { __min1 = len; __min2 = sz; tmp___3 = is_empty(buf, __min1 < __min2 ? __min1 : __min2); if (tmp___3 == 0) { *cor = buf; descriptor___0.modname = "ubifs"; descriptor___0.function = "get_master_node"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): found corruption at %d:%d\n"; descriptor___0.lineno = 294U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): found corruption at %d:%d\n", tmp___1->pid, lnum, offs); } else { } } else { } offs = offs + sz; buf = buf + (unsigned long )sz; len = len - sz; } else { } if ((int )c->leb_size > offs) { tmp___4 = is_empty(buf, len); if (tmp___4 == 0) { goto out_err; } else { } } else { } *pbuf = sbuf; return (0); out_err: err = -22; out_free: vfree((void const *)sbuf); *mst = 0; *cor = 0; return (err); } } static int write_rcvrd_mst_node(struct ubifs_info *c , struct ubifs_mst_node *mst ) { int err ; int lnum ; int sz ; __le32 save_flags ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { err = 0; lnum = 1; sz = c->mst_node_alsz; descriptor.modname = "ubifs"; descriptor.function = "write_rcvrd_mst_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): recovery\n"; descriptor.lineno = 329U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): recovery\n", tmp->pid); } else { } save_flags = mst->flags; mst->flags = mst->flags | 4U; ubifs_prepare_node(c, (void *)mst, 512, 1); err = ubifs_leb_change(c, lnum, (void const *)mst, sz); if (err != 0) { goto out; } else { } err = ubifs_leb_change(c, lnum + 1, (void const *)mst, sz); if (err != 0) { } else { } out: mst->flags = save_flags; return (err); } } int ubifs_recover_master_node(struct ubifs_info *c ) { void *buf1 ; void *buf2 ; void *cor1 ; void *cor2 ; struct ubifs_mst_node *mst1 ; struct ubifs_mst_node *mst2 ; struct ubifs_mst_node *mst ; int sz ; int err ; int offs1 ; int offs2 ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___1 ; long tmp___2 ; int tmp___3 ; size_t __len ; void *__ret ; void *tmp___4 ; size_t __len___0 ; void *__ret___0 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; { buf1 = 0; buf2 = 0; cor1 = 0; cor2 = 0; mst1 = 0; mst2 = 0; sz = c->mst_node_alsz; descriptor.modname = "ubifs"; descriptor.function = "ubifs_recover_master_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): recovery\n"; descriptor.lineno = 362U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): recovery\n", tmp->pid); } else { } err = get_master_node((struct ubifs_info const *)c, 1, & buf1, & mst1, & cor1); if (err != 0) { goto out_free; } else { } err = get_master_node((struct ubifs_info const *)c, 2, & buf2, & mst2, & cor2); if (err != 0) { goto out_free; } else { } if ((unsigned long )mst1 != (unsigned long )((struct ubifs_mst_node *)0)) { offs1 = (int )((unsigned int )((long )mst1) - (unsigned int )((long )buf1)); if ((mst1->flags & 4U) != 0U && (offs1 == 0 && (unsigned long )cor1 == (unsigned long )((void *)0))) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_recover_master_node"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): recovery recovery\n"; descriptor___0.lineno = 380U; descriptor___0.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): recovery recovery\n", tmp___1->pid); } else { } mst = mst1; } else if ((unsigned long )mst2 != (unsigned long )((struct ubifs_mst_node *)0)) { offs2 = (int )((unsigned int )((long )mst2) - (unsigned int )((long )buf2)); if (offs1 == offs2) { tmp___3 = memcmp((void const *)mst1 + 24U, (void const *)mst2 + 24U, 488UL); if (tmp___3 != 0) { goto out_err; } else { } mst = mst1; } else if (offs2 + sz == offs1) { if ((unsigned long )cor1 != (unsigned long )((void *)0)) { goto out_err; } else { } mst = mst1; } else if (offs1 == 0 && (c->leb_size - offs2) - sz < sz) { if ((unsigned long )cor1 != (unsigned long )((void *)0)) { goto out_err; } else { } mst = mst1; } else { goto out_err; } } else { if (offs1 != 0 || (unsigned long )cor1 != (unsigned long )((void *)0)) { goto out_err; } else { } mst = mst1; } } else { if ((unsigned long )mst2 == (unsigned long )((struct ubifs_mst_node *)0)) { goto out_err; } else { } offs2 = (int )((unsigned int )((long )mst2) - (unsigned int )((long )buf2)); if ((offs2 + sz) + sz <= c->leb_size) { goto out_err; } else { } mst = mst2; } printk("\rUBIFS: recovered master node from LEB %d\n", (unsigned long )mst == (unsigned long )mst1 ? 1 : 2); __len = 512UL; if (__len > 63UL) { __ret = memcpy((void *)c->mst_node, (void const *)mst, __len); } else { __ret = memcpy((void *)c->mst_node, (void const *)mst, __len); } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { tmp___4 = kmalloc((size_t )sz, 208U); c->rcvrd_mst_node = (struct ubifs_mst_node *)tmp___4; if ((unsigned long )c->rcvrd_mst_node == (unsigned long )((struct ubifs_mst_node *)0)) { err = -12; goto out_free; } else { } __len___0 = 512UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)c->rcvrd_mst_node, (void const *)c->mst_node, __len___0); } else { __ret___0 = memcpy((void *)c->rcvrd_mst_node, (void const *)c->mst_node, __len___0); } (c->mst_node)->flags = (c->mst_node)->flags | 1U; } else { c->max_sqnum = mst->ch.sqnum - 1ULL; err = write_rcvrd_mst_node(c, c->mst_node); if (err != 0) { goto out_free; } else { } } vfree((void const *)buf2); vfree((void const *)buf1); return (0); out_err: err = -22; out_free: tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: failed to recover master node\n", tmp___5->pid, "ubifs_recover_master_node"); if ((unsigned long )mst1 != (unsigned long )((struct ubifs_mst_node *)0)) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: dumping first master node\n", tmp___6->pid, "ubifs_recover_master_node"); ubifs_dump_node((struct ubifs_info const *)c, (void const *)mst1); } else { } if ((unsigned long )mst2 != (unsigned long )((struct ubifs_mst_node *)0)) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: dumping second master node\n", tmp___7->pid, "ubifs_recover_master_node"); ubifs_dump_node((struct ubifs_info const *)c, (void const *)mst2); } else { } vfree((void const *)buf2); vfree((void const *)buf1); return (err); } } int ubifs_write_rcvrd_mst_node(struct ubifs_info *c ) { int err ; { if ((unsigned long )c->rcvrd_mst_node == (unsigned long )((struct ubifs_mst_node *)0)) { return (0); } else { } (c->rcvrd_mst_node)->flags = (c->rcvrd_mst_node)->flags | 1U; (c->mst_node)->flags = (c->mst_node)->flags | 1U; err = write_rcvrd_mst_node(c, c->rcvrd_mst_node); if (err != 0) { return (err); } else { } kfree((void const *)c->rcvrd_mst_node); c->rcvrd_mst_node = 0; return (0); } } static int is_last_write(struct ubifs_info const *c , void *buf , int offs ) { int empty_offs ; int check_len ; uint8_t *p ; int tmp ; { empty_offs = ((offs + 1) + ((int )c->max_write_size + -1)) & - ((int )c->max_write_size); check_len = (int )c->leb_size - empty_offs; p = (uint8_t *)(buf + ((unsigned long )empty_offs - (unsigned long )offs)); tmp = is_empty((void *)p, check_len); return (tmp); } } static void clean_buf(struct ubifs_info const *c , void **buf , int lnum , int *offs , int *len ) { int empty_offs ; int pad_len ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; { lnum = lnum; descriptor.modname = "ubifs"; descriptor.function = "clean_buf"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): cleaning corruption at %d:%d\n"; descriptor.lineno = 565U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): cleaning corruption at %d:%d\n", tmp->pid, lnum, *offs); } else { } tmp___2 = ldv__builtin_expect((*offs & 7) != 0, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "clean_buf", 567, tmp___1->pid); dump_stack(); } else { } empty_offs = (*offs + ((int )c->min_io_size + -1)) & - ((int )c->min_io_size); pad_len = empty_offs - *offs; ubifs_pad(c, *buf, pad_len); *offs = *offs + pad_len; *buf = *buf + (unsigned long )pad_len; *len = *len - pad_len; memset(*buf, 255, (size_t )((int )c->leb_size - empty_offs)); return; } } static int no_more_nodes(struct ubifs_info const *c , void *buf , int len , int lnum , int offs ) { struct ubifs_ch *ch ; int skip ; int dlen ; int tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; { ch = (struct ubifs_ch *)buf; dlen = (int )ch->len; skip = (int )(((((unsigned int )c->max_write_size + (unsigned int )offs) + 23U) & - ((unsigned int )c->max_write_size)) - (unsigned int )offs); tmp = is_empty(buf + (unsigned long )skip, len - skip); if (tmp != 0) { return (1); } else { } tmp___2 = ubifs_check_node(c, (void const *)buf, lnum, offs, 1, 0); if (tmp___2 != -117) { descriptor.modname = "ubifs"; descriptor.function = "no_more_nodes"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): unexpected bad common header at %d:%d\n"; descriptor.lineno = 604U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): unexpected bad common header at %d:%d\n", tmp___0->pid, lnum, offs); } else { } return (0); } else { } skip = (((offs + dlen) + ((int )c->max_write_size + -1)) & - ((int )c->max_write_size)) - offs; tmp___3 = is_empty(buf + (unsigned long )skip, len - skip); if (tmp___3 != 0) { return (1); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "no_more_nodes"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): unexpected data at %d:%d\n"; descriptor___0.lineno = 612U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): unexpected data at %d:%d\n", tmp___4->pid, lnum, offs + skip); } else { } return (0); } } static int fix_unclean_leb(struct ubifs_info *c , struct ubifs_scan_leb *sleb , int start ) { int lnum ; int endpt ; struct ubifs_scan_node *snod ; struct list_head const *__mptr ; int tmp ; struct ubifs_unclean_leb *ucleb ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; void *tmp___2 ; int err ; struct _ddebug descriptor___0 ; struct task_struct *tmp___3 ; long tmp___4 ; int len ; int pad_len ; void *buf ; { lnum = sleb->lnum; endpt = start; tmp = list_empty((struct list_head const *)(& sleb->nodes)); if (tmp == 0) { __mptr = (struct list_head const *)sleb->nodes.prev; snod = (struct ubifs_scan_node *)__mptr; endpt = snod->offs + snod->len; } else { } if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U && (unsigned int )*((unsigned char *)c + 5528UL) == 0U) { descriptor.modname = "ubifs"; descriptor.function = "fix_unclean_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): need to fix LEB %d start %d endpt %d\n"; descriptor.lineno = 641U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): need to fix LEB %d start %d endpt %d\n", tmp___0->pid, lnum, start, sleb->endpt); } else { } tmp___2 = kzalloc(24UL, 80U); ucleb = (struct ubifs_unclean_leb *)tmp___2; if ((unsigned long )ucleb == (unsigned long )((struct ubifs_unclean_leb *)0)) { return (-12); } else { } ucleb->lnum = lnum; ucleb->endpt = endpt; list_add_tail(& ucleb->list, & c->unclean_leb_list); } else { descriptor___0.modname = "ubifs"; descriptor___0.function = "fix_unclean_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): fixing LEB %d start %d endpt %d\n"; descriptor___0.lineno = 653U; descriptor___0.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): fixing LEB %d start %d endpt %d\n", tmp___3->pid, lnum, start, sleb->endpt); } else { } if (endpt == 0) { err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } } else { len = ((c->min_io_size + -1) + endpt) & - c->min_io_size; if (start != 0) { err = ubifs_leb_read((struct ubifs_info const *)c, lnum, sleb->buf, 0, start, 1); if (err != 0) { return (err); } else { } } else { } if (len > endpt) { pad_len = len - ((endpt + 7) & -8); if (pad_len > 0) { buf = sleb->buf + ((unsigned long )len - (unsigned long )pad_len); ubifs_pad((struct ubifs_info const *)c, buf, pad_len); } else { } } else { } err = ubifs_leb_change(c, lnum, (void const *)sleb->buf, len); if (err != 0) { return (err); } else { } } } return (0); } } static void drop_last_group(struct ubifs_scan_leb *sleb , int *offs ) { struct ubifs_scan_node *snod ; struct ubifs_ch *ch ; struct list_head const *__mptr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { goto ldv_27663; ldv_27662: __mptr = (struct list_head const *)sleb->nodes.prev; snod = (struct ubifs_scan_node *)__mptr; ch = (struct ubifs_ch *)snod->node; if ((unsigned int )ch->group_type != 1U) { goto ldv_27659; } else { } descriptor.modname = "ubifs"; descriptor.function = "drop_last_group"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): dropping grouped node at %d:%d\n"; descriptor.lineno = 706U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): dropping grouped node at %d:%d\n", tmp->pid, sleb->lnum, snod->offs); } else { } *offs = snod->offs; list_del(& snod->list); kfree((void const *)snod); sleb->nodes_cnt = sleb->nodes_cnt + -1; ldv_27663: tmp___1 = list_empty((struct list_head const *)(& sleb->nodes)); if (tmp___1 == 0) { goto ldv_27662; } else { } ldv_27659: ; return; } } static void drop_last_node(struct ubifs_scan_leb *sleb , int *offs ) { struct ubifs_scan_node *snod ; struct list_head const *__mptr ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { tmp___1 = list_empty((struct list_head const *)(& sleb->nodes)); if (tmp___1 == 0) { __mptr = (struct list_head const *)sleb->nodes.prev; snod = (struct ubifs_scan_node *)__mptr; descriptor.modname = "ubifs"; descriptor.function = "drop_last_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): dropping last node at %d:%d\n"; descriptor.lineno = 732U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): dropping last node at %d:%d\n", tmp->pid, sleb->lnum, snod->offs); } else { } *offs = snod->offs; list_del(& snod->list); kfree((void const *)snod); sleb->nodes_cnt = sleb->nodes_cnt + -1; } else { } return; } } struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c , int lnum , int offs , void *sbuf , int jhead ) { int ret ; int err ; int len ; int start ; int min_io_unit ; int grouped ; struct ubifs_scan_leb *sleb ; void *buf ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; struct ubifs_ch *ch ; int node_len ; struct _ddebug descriptor___1 ; struct task_struct *tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; int corruption ; int tmp___9 ; struct task_struct *tmp___10 ; int tmp___11 ; int tmp___12 ; int tmp___13 ; int tmp___14 ; struct task_struct *tmp___15 ; struct task_struct *tmp___16 ; void *tmp___17 ; { ret = 0; len = c->leb_size - offs; start = offs; grouped = jhead != -1 ? (int )(c->jheads + (unsigned long )jhead)->grouped : 0; buf = sbuf + (unsigned long )offs; descriptor.modname = "ubifs"; descriptor.function = "ubifs_recover_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): %d:%d, jhead %d, grouped %d\n"; descriptor.lineno = 762U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): %d:%d, jhead %d, grouped %d\n", tmp->pid, lnum, offs, jhead, grouped); } else { } sleb = ubifs_start_scan((struct ubifs_info const *)c, lnum, offs, sbuf); tmp___1 = IS_ERR((void const *)sleb); if (tmp___1 != 0L) { return (sleb); } else { } tmp___3 = ldv__builtin_expect(len <= 7, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_recover_leb", 768, tmp___2->pid); dump_stack(); } else { } goto ldv_27698; ldv_27697: descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_recover_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG scan (pid %d): look at LEB %d:%d (%d bytes left)\n"; descriptor___0.lineno = 771U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG scan (pid %d): look at LEB %d:%d (%d bytes left)\n", tmp___4->pid, lnum, offs, len); } else { } __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared", 773, 0); _cond_resched(); ret = ubifs_scan_a_node((struct ubifs_info const *)c, buf, len, lnum, offs, 1); if (ret == -2) { ch = (struct ubifs_ch *)buf; err = ubifs_add_snod((struct ubifs_info const *)c, sleb, buf, offs); if (err != 0) { goto error; } else { } node_len = (int )(ch->len + 7U) & -8; offs = offs + node_len; buf = buf + (unsigned long )node_len; len = len - node_len; } else if (ret > 0) { offs = offs + ret; buf = buf + (unsigned long )ret; len = len - ret; } else if (((ret == -1 || ret == 0) || ret == -4) || ret == -3) { descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_recover_leb"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___1.format = "UBIFS DBG rcvry (pid %d): found corruption (%d) at %d:%d\n"; descriptor___1.lineno = 802U; descriptor___1.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG rcvry (pid %d): found corruption (%d) at %d:%d\n", tmp___6->pid, ret, lnum, offs); } else { } goto ldv_27696; } else { tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected return value %d\n", tmp___8->pid, "ubifs_recover_leb", ret); err = -22; goto error; } ldv_27698: ; if (len > 7) { goto ldv_27697; } else { } ldv_27696: ; if (ret == 0 || ret == -4) { tmp___14 = is_last_write((struct ubifs_info const *)c, buf, offs); if (tmp___14 == 0) { goto corrupted_rescan; } else if (ret == -3) { tmp___13 = no_more_nodes((struct ubifs_info const *)c, buf, len, lnum, offs); if (tmp___13 == 0) { goto corrupted_rescan; } else { tmp___12 = is_empty(buf, len); if (tmp___12 == 0) { tmp___11 = is_last_write((struct ubifs_info const *)c, buf, offs); if (tmp___11 == 0) { tmp___9 = first_non_ff(buf, len); corruption = tmp___9; tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: corrupt empty space LEB %d:%d, corruption starts at %d\n", tmp___10->pid, "ubifs_recover_leb", lnum, offs, corruption); offs = offs + corruption; buf = buf + (unsigned long )corruption; goto corrupted; } else { } } else { } } } else { } } else { } min_io_unit = - c->min_io_size & offs; if (grouped != 0) { drop_last_group(sleb, & offs); } else { } if (jhead == 0) { goto ldv_27703; ldv_27702: drop_last_node(sleb, & offs); ldv_27703: ; if (offs > min_io_unit) { goto ldv_27702; } else { } } else { } buf = sbuf + (unsigned long )offs; len = c->leb_size - offs; clean_buf((struct ubifs_info const *)c, & buf, lnum, & offs, & len); ubifs_end_scan((struct ubifs_info const *)c, sleb, lnum, offs); err = fix_unclean_leb(c, sleb, start); if (err != 0) { goto error; } else { } return (sleb); corrupted_rescan: tmp___15 = get_current(); printk("\vUBIFS error (pid %d): %s: corruption %d\n", tmp___15->pid, "ubifs_recover_leb", ret); ubifs_scan_a_node((struct ubifs_info const *)c, buf, len, lnum, offs, 1); corrupted: ubifs_scanned_corruption((struct ubifs_info const *)c, lnum, offs, buf); err = -117; error: tmp___16 = get_current(); printk("\vUBIFS error (pid %d): %s: LEB %d scanning failed\n", tmp___16->pid, "ubifs_recover_leb", lnum); ubifs_scan_destroy(sleb); tmp___17 = ERR_PTR((long )err); return ((struct ubifs_scan_leb *)tmp___17); } } static int get_cs_sqnum(struct ubifs_info *c , int lnum , int offs , unsigned long long *cs_sqnum ) { struct ubifs_cs_node *cs_node ; int err ; int ret ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; { cs_node = 0; descriptor.modname = "ubifs"; descriptor.function = "get_cs_sqnum"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): at %d:%d\n"; descriptor.lineno = 937U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): at %d:%d\n", tmp->pid, lnum, offs); } else { } tmp___1 = kmalloc(32UL, 208U); cs_node = (struct ubifs_cs_node *)tmp___1; if ((unsigned long )cs_node == (unsigned long )((struct ubifs_cs_node *)0)) { return (-12); } else { } if ((unsigned int )(c->leb_size - offs) <= 31U) { goto out_err; } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, (void *)cs_node, offs, 32, 0); if (err != 0 && err != -74) { goto out_free; } else { } ret = ubifs_scan_a_node((struct ubifs_info const *)c, (void *)cs_node, 32, lnum, offs, 0); if (ret != -2) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: Not a valid node\n", tmp___2->pid, "get_cs_sqnum"); goto out_err; } else { } if ((unsigned int )cs_node->ch.node_type != 10U) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: Node a CS node, type is %d\n", tmp___3->pid, "get_cs_sqnum", (int )cs_node->ch.node_type); goto out_err; } else { } if (cs_node->cmt_no != c->cmt_no) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: CS node cmt_no %llu != current cmt_no %llu\n", tmp___4->pid, "get_cs_sqnum", cs_node->cmt_no, c->cmt_no); goto out_err; } else { } *cs_sqnum = cs_node->ch.sqnum; descriptor___0.modname = "ubifs"; descriptor___0.function = "get_cs_sqnum"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): commit start sqnum %llu\n"; descriptor___0.lineno = 963U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): commit start sqnum %llu\n", tmp___5->pid, *cs_sqnum); } else { } kfree((void const *)cs_node); return (0); out_err: err = -22; out_free: tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: failed to get CS sqnum\n", tmp___7->pid, "get_cs_sqnum"); kfree((void const *)cs_node); return (err); } } struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c , int lnum , int offs , void *sbuf ) { struct ubifs_scan_leb *sleb ; int next_lnum ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct ubifs_scan_node *snod ; unsigned long long cs_sqnum ; struct list_head const *__mptr ; int err ; void *tmp___2 ; struct task_struct *tmp___3 ; void *tmp___4 ; struct ubifs_scan_leb *tmp___5 ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_recover_log_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): LEB %d\n"; descriptor.lineno = 994U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): LEB %d\n", tmp->pid, lnum); } else { } next_lnum = lnum + 1; if (c->log_lebs + 3 <= next_lnum) { next_lnum = 3; } else { } if (c->ltail_lnum != next_lnum) { sleb = ubifs_scan((struct ubifs_info const *)c, next_lnum, 0, sbuf, 0); tmp___1 = IS_ERR((void const *)sleb); if (tmp___1 != 0L) { return (sleb); } else { } if (sleb->nodes_cnt != 0) { cs_sqnum = c->cs_sqnum; __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; if (cs_sqnum == 0ULL) { err = get_cs_sqnum(c, lnum, offs, & cs_sqnum); if (err != 0) { ubifs_scan_destroy(sleb); tmp___2 = ERR_PTR((long )err); return ((struct ubifs_scan_leb *)tmp___2); } else { } } else { } if (snod->sqnum > cs_sqnum) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: unrecoverable log corruption in LEB %d\n", tmp___3->pid, "ubifs_recover_log_leb", lnum); ubifs_scan_destroy(sleb); tmp___4 = ERR_PTR(-117L); return ((struct ubifs_scan_leb *)tmp___4); } else { } } else { } ubifs_scan_destroy(sleb); } else { } tmp___5 = ubifs_recover_leb(c, lnum, offs, sbuf, -1); return (tmp___5); } } static int recover_head(struct ubifs_info *c , int lnum , int offs , void *sbuf ) { int len ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; int tmp___2 ; int tmp___3 ; { len = c->max_write_size; if (offs + len > c->leb_size) { len = c->leb_size - offs; } else { } if (len == 0) { return (0); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, sbuf, offs, len, 1); if (err != 0) { goto _L; } else { tmp___3 = is_empty(sbuf, len); if (tmp___3 == 0) { _L: /* CIL Label */ descriptor.modname = "ubifs"; descriptor.function = "recover_head"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): cleaning head at %d:%d\n"; descriptor.lineno = 1057U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): cleaning head at %d:%d\n", tmp->pid, lnum, offs); } else { } if (offs == 0) { tmp___1 = ubifs_leb_unmap(c, lnum); return (tmp___1); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, sbuf, 0, offs, 1); if (err != 0) { return (err); } else { } tmp___2 = ubifs_leb_change(c, lnum, (void const *)sbuf, offs); return (tmp___2); } else { } } return (0); } } int ubifs_recover_inl_heads(struct ubifs_info *c , void *sbuf ) { int err ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct _ddebug descriptor ; struct task_struct *tmp___2 ; long tmp___3 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; { tmp___0 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 4080UL) != 0U, 0L); if (tmp___0 != 0L) { tmp___1 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 5528UL) == 0U, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_recover_inl_heads", 1090, tmp->pid); dump_stack(); } else { } } else { } descriptor.modname = "ubifs"; descriptor.function = "ubifs_recover_inl_heads"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): checking index head at %d:%d\n"; descriptor.lineno = 1092U; descriptor.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): checking index head at %d:%d\n", tmp___2->pid, c->ihead_lnum, c->ihead_offs); } else { } err = recover_head(c, c->ihead_lnum, c->ihead_offs, sbuf); if (err != 0) { return (err); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_recover_inl_heads"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): checking LPT head at %d:%d\n"; descriptor___0.lineno = 1097U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): checking LPT head at %d:%d\n", tmp___4->pid, c->nhead_lnum, c->nhead_offs); } else { } err = recover_head(c, c->nhead_lnum, c->nhead_offs, sbuf); if (err != 0) { return (err); } else { } return (0); } } static int clean_an_unclean_leb(struct ubifs_info *c , struct ubifs_unclean_leb *ucleb , void *sbuf ) { int err ; int lnum ; int offs ; int len ; int quiet ; void *buf ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int ret ; struct ubifs_ch *ch ; int node_len ; struct task_struct *tmp___1 ; int pad_len ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; { lnum = ucleb->lnum; offs = 0; len = ucleb->endpt; quiet = 1; buf = sbuf; descriptor.modname = "ubifs"; descriptor.function = "clean_an_unclean_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): LEB %d len %d\n"; descriptor.lineno = 1123U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): LEB %d len %d\n", tmp->pid, lnum, len); } else { } if (len == 0) { err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } return (0); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, buf, offs, len, 0); if (err != 0 && err != -74) { return (err); } else { } goto ldv_27769; ldv_27770: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared", 1140, 0); _cond_resched(); ret = ubifs_scan_a_node((struct ubifs_info const *)c, buf, len, lnum, offs, quiet); if (ret == -2) { ch = (struct ubifs_ch *)buf; node_len = (int )(ch->len + 7U) & -8; offs = offs + node_len; buf = buf + (unsigned long )node_len; len = len - node_len; goto ldv_27769; } else { } if (ret > 0) { offs = offs + ret; buf = buf + (unsigned long )ret; len = len - ret; goto ldv_27769; } else { } if (ret == -1) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected empty space at %d:%d\n", tmp___1->pid, "clean_an_unclean_leb", lnum, offs); return (-117); } else { } if (quiet != 0) { quiet = 0; goto ldv_27769; } else { } ubifs_scanned_corruption((struct ubifs_info const *)c, lnum, offs, buf); return (-117); ldv_27769: ; if (len > 7) { goto ldv_27770; } else { } len = (ucleb->endpt + (c->min_io_size + -1)) & - c->min_io_size; if (ucleb->endpt < len) { pad_len = len - ((ucleb->endpt + 7) & -8); if (pad_len > 0) { buf = c->sbuf + ((unsigned long )len - (unsigned long )pad_len); ubifs_pad((struct ubifs_info const *)c, buf, pad_len); } else { } } else { } err = ubifs_leb_change(c, lnum, (void const *)sbuf, len); if (err != 0) { return (err); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "clean_an_unclean_leb"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): cleaned LEB %d\n"; descriptor___0.lineno = 1197U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): cleaned LEB %d\n", tmp___2->pid, lnum); } else { } return (0); } } int ubifs_clean_lebs(struct ubifs_info *c , void *sbuf ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct ubifs_unclean_leb *ucleb ; int err ; struct list_head const *__mptr ; int tmp___1 ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_clean_lebs"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): recovery\n"; descriptor.lineno = 1215U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): recovery\n", tmp->pid); } else { } goto ldv_27785; ldv_27784: __mptr = (struct list_head const *)c->unclean_leb_list.next; ucleb = (struct ubifs_unclean_leb *)__mptr; err = clean_an_unclean_leb(c, ucleb, sbuf); if (err != 0) { return (err); } else { } list_del(& ucleb->list); kfree((void const *)ucleb); ldv_27785: tmp___1 = list_empty((struct list_head const *)(& c->unclean_leb_list)); if (tmp___1 == 0) { goto ldv_27784; } else { } return (0); } } static int grab_empty_leb(struct ubifs_info *c ) { int lnum ; int err ; struct task_struct *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; { lnum = ubifs_find_free_leb_for_idx(c); if (lnum < 0) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: could not find an empty LEB\n", tmp->pid, "grab_empty_leb"); ubifs_dump_lprops(c); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); return (lnum); } else { } err = ubifs_change_one_lp(c, lnum, -2147483647, -2147483647, 0, 32, 0); if (err != 0) { return (err); } else { } c->gc_lnum = lnum; descriptor.modname = "ubifs"; descriptor.function = "grab_empty_leb"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): found empty LEB %d, run commit\n"; descriptor.lineno = 1273U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): found empty LEB %d, run commit\n", tmp___0->pid, lnum); } else { } tmp___2 = ubifs_run_commit(c); return (tmp___2); } } int ubifs_rcvry_gc_commit(struct ubifs_info *c ) { struct ubifs_wbuf *wbuf ; struct ubifs_lprops lp ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___9 ; long tmp___10 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___11 ; long tmp___12 ; int err2 ; int tmp___13 ; struct task_struct *tmp___14 ; struct task_struct *tmp___15 ; long tmp___16 ; struct _ddebug descriptor___3 ; struct task_struct *tmp___17 ; long tmp___18 ; { wbuf = & (c->jheads)->wbuf; descriptor.modname = "ubifs"; descriptor.function = "ubifs_rcvry_gc_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): GC head LEB %d, offs %d\n"; descriptor.lineno = 1302U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): GC head LEB %d, offs %d\n", tmp->pid, wbuf->lnum, wbuf->offs); } else { } c->gc_lnum = -1; if (wbuf->lnum == -1 || wbuf->offs == c->leb_size) { tmp___1 = grab_empty_leb(c); return (tmp___1); } else { } err = ubifs_find_dirty_leb(c, & lp, wbuf->offs, 2); if (err != 0) { if (err != -28) { return (err); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_rcvry_gc_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): could not find a dirty LEB\n"; descriptor___0.lineno = 1313U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): could not find a dirty LEB\n", tmp___2->pid); } else { } tmp___4 = grab_empty_leb(c); return (tmp___4); } else { } tmp___6 = ldv__builtin_expect((lp.flags & 32) != 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rcvry_gc_commit", 1317, tmp___5->pid); dump_stack(); } else { } tmp___8 = ldv__builtin_expect(lp.free + lp.dirty < wbuf->offs, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rcvry_gc_commit", 1318, tmp___7->pid); dump_stack(); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_rcvry_gc_commit"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___1.format = "UBIFS DBG rcvry (pid %d): committing\n"; descriptor___1.lineno = 1324U; descriptor___1.flags = 0U; tmp___10 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___10 != 0L) { tmp___9 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG rcvry (pid %d): committing\n", tmp___9->pid); } else { } err = ubifs_run_commit(c); if (err != 0) { return (err); } else { } descriptor___2.modname = "ubifs"; descriptor___2.function = "ubifs_rcvry_gc_commit"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___2.format = "UBIFS DBG rcvry (pid %d): GC\'ing LEB %d\n"; descriptor___2.lineno = 1329U; descriptor___2.flags = 0U; tmp___12 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___12 != 0L) { tmp___11 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG rcvry (pid %d): GC\'ing LEB %d\n", tmp___11->pid, lp.lnum); } else { } ldv_mutex_lock_nested_623(& wbuf->io_mutex, (unsigned int )wbuf->jhead); err = ubifs_garbage_collect_leb(c, & lp); if (err >= 0) { tmp___13 = ubifs_wbuf_sync_nolock(wbuf); err2 = tmp___13; if (err2 != 0) { err = err2; } else { } } else { } ldv_mutex_unlock_624(& wbuf->io_mutex); if (err < 0) { tmp___14 = get_current(); printk("\vUBIFS error (pid %d): %s: GC failed, error %d\n", tmp___14->pid, "ubifs_rcvry_gc_commit", err); if (err == -11) { err = -22; } else { } return (err); } else { } tmp___16 = ldv__builtin_expect(err != 2, 0L); if (tmp___16 != 0L) { tmp___15 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_rcvry_gc_commit", 1346, tmp___15->pid); dump_stack(); } else { } if (err != 2) { return (-22); } else { } err = ubifs_leb_unmap(c, c->gc_lnum); if (err != 0) { return (err); } else { } descriptor___3.modname = "ubifs"; descriptor___3.function = "ubifs_rcvry_gc_commit"; descriptor___3.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___3.format = "UBIFS DBG rcvry (pid %d): allocated LEB %d for GC\n"; descriptor___3.lineno = 1354U; descriptor___3.flags = 0U; tmp___18 = ldv__builtin_expect((long )descriptor___3.flags & 1L, 0L); if (tmp___18 != 0L) { tmp___17 = get_current(); __dynamic_pr_debug(& descriptor___3, "UBIFS DBG rcvry (pid %d): allocated LEB %d for GC\n", tmp___17->pid, lp.lnum); } else { } return (0); } } static int add_ino(struct ubifs_info *c , ino_t inum , loff_t i_size , loff_t d_size , int exists ) { struct rb_node **p ; struct rb_node *parent ; struct size_entry *e ; struct rb_node const *__mptr ; void *tmp ; { p = & c->size_tree.rb_node; parent = 0; goto ldv_27827; ldv_27826: parent = *p; __mptr = (struct rb_node const *)parent; e = (struct size_entry *)__mptr; if (e->inum > inum) { p = & (*p)->rb_left; } else { p = & (*p)->rb_right; } ldv_27827: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_27826; } else { } tmp = kzalloc(64UL, 208U); e = (struct size_entry *)tmp; if ((unsigned long )e == (unsigned long )((struct size_entry *)0)) { return (-12); } else { } e->inum = inum; e->i_size = i_size; e->d_size = d_size; e->exists = exists; rb_link_node(& e->rb, parent, p); rb_insert_color(& e->rb, & c->size_tree); return (0); } } static struct size_entry *find_ino(struct ubifs_info *c , ino_t inum ) { struct rb_node *p ; struct size_entry *e ; struct rb_node const *__mptr ; { p = c->size_tree.rb_node; goto ldv_27838; ldv_27837: __mptr = (struct rb_node const *)p; e = (struct size_entry *)__mptr; if (e->inum > inum) { p = p->rb_left; } else if (e->inum < inum) { p = p->rb_right; } else { return (e); } ldv_27838: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_27837; } else { } return (0); } } static void remove_ino(struct ubifs_info *c , ino_t inum ) { struct size_entry *e ; struct size_entry *tmp ; { tmp = find_ino(c, inum); e = tmp; if ((unsigned long )e == (unsigned long )((struct size_entry *)0)) { return; } else { } rb_erase(& e->rb, & c->size_tree); kfree((void const *)e); return; } } void ubifs_destroy_size_tree(struct ubifs_info *c ) { struct rb_node *this ; struct size_entry *e ; struct rb_node const *__mptr ; struct rb_root __constr_expr_0 ; { this = c->size_tree.rb_node; goto ldv_27850; ldv_27853: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; goto ldv_27850; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; goto ldv_27850; } else { } __mptr = (struct rb_node const *)this; e = (struct size_entry *)__mptr; if ((unsigned long )e->inode != (unsigned long )((struct inode *)0)) { iput(e->inode); } else { } this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& e->rb)) { this->rb_left = 0; } else { this->rb_right = 0; } } else { } kfree((void const *)e); ldv_27850: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_27853; } else { } __constr_expr_0.rb_node = 0; c->size_tree = __constr_expr_0; return; } } int ubifs_recover_size_accum(struct ubifs_info *c , union ubifs_key *key , int deletion , loff_t new_size ) { ino_t inum ; ino_t tmp ; struct size_entry *e ; int err ; int tmp___0 ; { tmp = key_inum((struct ubifs_info const *)c, (void const *)key); inum = tmp; tmp___0 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key); switch (tmp___0) { case 0: ; if (deletion != 0) { remove_ino(c, inum); } else { e = find_ino(c, inum); if ((unsigned long )e != (unsigned long )((struct size_entry *)0)) { e->i_size = new_size; e->exists = 1; } else { err = add_ino(c, inum, new_size, 0LL, 1); if (err != 0) { return (err); } else { } } } goto ldv_27866; case 1: e = find_ino(c, inum); if ((unsigned long )e != (unsigned long )((struct size_entry *)0)) { if (e->d_size < new_size) { e->d_size = new_size; } else { err = add_ino(c, inum, 0LL, new_size, 0); if (err != 0) { return (err); } else { } } } else { } goto ldv_27866; case 4: e = find_ino(c, inum); if ((unsigned long )e != (unsigned long )((struct size_entry *)0)) { e->d_size = new_size; } else { } goto ldv_27866; } ldv_27866: ; return (0); } } static int fix_size_in_place(struct ubifs_info *c , struct size_entry *e ) { struct ubifs_ino_node *ino ; unsigned char *p ; union ubifs_key key ; int err ; int lnum ; int offs ; int len ; loff_t i_size ; uint32_t crc ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; { ino = (struct ubifs_ino_node *)c->sbuf; ino_key_init((struct ubifs_info const *)c, & key, e->inum); err = ubifs_tnc_locate(c, (union ubifs_key const *)(& key), (void *)ino, & lnum, & offs); if (err != 0) { goto out; } else { } i_size = (loff_t )ino->size; if (e->d_size <= i_size) { return (0); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, c->sbuf, 0, c->leb_size, 1); if (err != 0) { goto out; } else { } ino = (struct ubifs_ino_node *)c->sbuf + (unsigned long )offs; ino->size = (unsigned long long )e->d_size; len = (int )ino->ch.len; crc = crc32_le(4294967295U, (unsigned char const *)ino + 8U, (size_t )(len + -8)); ino->ch.crc = crc; p = (unsigned char *)c->sbuf; len = c->leb_size + -1; goto ldv_27884; ldv_27883: len = len + -1; ldv_27884: ; if ((unsigned int )*(p + (unsigned long )len) == 255U) { goto ldv_27883; } else { } len = ((len + 1) + (c->min_io_size + -1)) & - c->min_io_size; err = ubifs_leb_change(c, lnum, (void const *)c->sbuf, len); if (err != 0) { goto out; } else { } descriptor.modname = "ubifs"; descriptor.function = "fix_size_in_place"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): inode %lu at %d:%d size %lld -> %lld\n"; descriptor.lineno = 1598U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): inode %lu at %d:%d size %lld -> %lld\n", tmp->pid, e->inum, lnum, offs, i_size, e->d_size); } else { } return (0); out: tmp___1 = get_current(); printk("\fUBIFS warning (pid %d): %s: inode %lu failed to fix size %lld -> %lld error %d\n", tmp___1->pid, "fix_size_in_place", e->inum, e->i_size, e->d_size, err); return (err); } } int ubifs_recover_size(struct ubifs_info *c ) { struct rb_node *this ; struct rb_node *tmp ; struct size_entry *e ; int err ; struct rb_node const *__mptr ; union ubifs_key key ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct ubifs_ino_node *ino ; struct inode *inode ; struct ubifs_inode *ui ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___6 ; long tmp___7 ; { tmp = rb_first((struct rb_root const *)(& c->size_tree)); this = tmp; goto ldv_27903; ldv_27904: __mptr = (struct rb_node const *)this; e = (struct size_entry *)__mptr; if (e->exists == 0) { ino_key_init((struct ubifs_info const *)c, & key, e->inum); err = ubifs_tnc_lookup(c, (union ubifs_key const *)(& key), c->sbuf); if (err != 0 && err != -2) { return (err); } else { } if (err == -2) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_recover_size"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor.format = "UBIFS DBG rcvry (pid %d): removing ino %lu\n"; descriptor.lineno = 1635U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG rcvry (pid %d): removing ino %lu\n", tmp___0->pid, e->inum); } else { } err = ubifs_tnc_remove_ino(c, e->inum); if (err != 0) { return (err); } else { } } else { ino = (struct ubifs_ino_node *)c->sbuf; e->exists = 1; e->i_size = (loff_t )ino->size; } } else { } if (e->exists != 0 && e->i_size < e->d_size) { if ((unsigned int )*((unsigned char *)c + 4080UL) != 0U) { tmp___3 = ldv__builtin_expect((unsigned long )e->inode != (unsigned long )((struct inode *)0), 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_recover_size", 1653, tmp___2->pid); dump_stack(); } else { } inode = ubifs_iget(c->vfs_sb, e->inum); tmp___5 = IS_ERR((void const *)inode); if (tmp___5 != 0L) { tmp___4 = PTR_ERR((void const *)inode); return ((int )tmp___4); } else { } ui = ubifs_inode((struct inode const *)inode); if (inode->i_size < e->d_size) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_recover_size"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/recovery.c.prepared"; descriptor___0.format = "UBIFS DBG rcvry (pid %d): ino %lu size %lld -> %lld\n"; descriptor___0.lineno = 1663U; descriptor___0.flags = 0U; tmp___7 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG rcvry (pid %d): ino %lu size %lld -> %lld\n", tmp___6->pid, e->inum, inode->i_size, e->d_size); } else { } inode->i_size = e->d_size; ui->ui_size = e->d_size; ui->synced_i_size = e->d_size; e->inode = inode; this = rb_next((struct rb_node const *)this); goto ldv_27903; } else { } iput(inode); } else { err = fix_size_in_place(c, e); if (err != 0) { return (err); } else { } if ((unsigned long )e->inode != (unsigned long )((struct inode *)0)) { iput(e->inode); } else { } } } else { } this = rb_next((struct rb_node const *)this); rb_erase(& e->rb, & c->size_tree); kfree((void const *)e); ldv_27903: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_27904; } else { } return (0); } } void ldv_mutex_lock_615(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_616(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_617(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_618(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_619(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_620(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_621(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_622(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_623(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_624(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern void might_fault(void) ; void ldv_mutex_lock_nested_639(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_636(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_638(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_640(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_642(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_644(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_645(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_635(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_637(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_641(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_643(struct mutex *ldv_func_arg1 ) ; extern bool inode_owner_or_capable(struct inode const * ) ; extern int write_inode_now(struct inode * , int ) ; __inline static void *compat_ptr(compat_uptr_t uptr ) { { return ((void *)((unsigned long )uptr)); } } extern int mnt_want_write_file(struct file * ) ; extern void mnt_drop_write_file(struct file * ) ; void ubifs_set_inode_flags(struct inode *inode ) { unsigned int flags ; struct ubifs_inode *tmp ; { tmp = ubifs_inode((struct inode const *)inode); flags = (unsigned int )tmp->flags; inode->i_flags = inode->i_flags & 4294967218U; if ((flags & 2U) != 0U) { inode->i_flags = inode->i_flags | 1U; } else { } if ((flags & 8U) != 0U) { inode->i_flags = inode->i_flags | 4U; } else { } if ((flags & 4U) != 0U) { inode->i_flags = inode->i_flags | 8U; } else { } if ((flags & 16U) != 0U) { inode->i_flags = inode->i_flags | 64U; } else { } return; } } static int ioctl2ubifs(int ioctl_flags ) { int ubifs_flags ; { ubifs_flags = 0; if ((ioctl_flags & 4) != 0) { ubifs_flags = ubifs_flags | 1; } else { } if ((ioctl_flags & 8) != 0) { ubifs_flags = ubifs_flags | 2; } else { } if ((ioctl_flags & 32) != 0) { ubifs_flags = ubifs_flags | 8; } else { } if ((ioctl_flags & 16) != 0) { ubifs_flags = ubifs_flags | 4; } else { } if ((ioctl_flags & 65536) != 0) { ubifs_flags = ubifs_flags | 16; } else { } return (ubifs_flags); } } static int ubifs2ioctl(int ubifs_flags ) { int ioctl_flags ; { ioctl_flags = 0; if (ubifs_flags & 1) { ioctl_flags = ioctl_flags | 4; } else { } if ((ubifs_flags & 2) != 0) { ioctl_flags = ioctl_flags | 8; } else { } if ((ubifs_flags & 8) != 0) { ioctl_flags = ioctl_flags | 32; } else { } if ((ubifs_flags & 4) != 0) { ioctl_flags = ioctl_flags | 16; } else { } if ((ubifs_flags & 16) != 0) { ioctl_flags = ioctl_flags | 65536; } else { } return (ioctl_flags); } } static int setflags(struct inode *inode , int flags ) { int oldflags ; int err ; int release ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; struct ubifs_info *c ; struct ubifs_budget_req req ; bool tmp___0 ; int tmp___1 ; struct task_struct *tmp___2 ; { tmp = ubifs_inode((struct inode const *)inode); ui = tmp; c = (struct ubifs_info *)(inode->i_sb)->s_fs_info; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned short )ui->data_len; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } ldv_mutex_lock_643(& ui->ui_mutex); oldflags = ubifs2ioctl(ui->flags); if (((flags ^ oldflags) & 48) != 0) { tmp___0 = capable(9); if (tmp___0) { tmp___1 = 0; } else { tmp___1 = 1; } if (tmp___1) { err = -1; goto out_unlock; } else { } } else { } ui->flags = ioctl2ubifs(flags); ubifs_set_inode_flags(inode); inode->i_ctime = ubifs_current_time(inode); release = (int )ui->dirty; mark_inode_dirty_sync(inode); ldv_mutex_unlock_644(& ui->ui_mutex); if (release != 0) { ubifs_release_budget(c, & req); } else { } if (((inode->i_sb)->s_flags & 16UL) != 0UL || (int )inode->i_flags & 1) { err = write_inode_now(inode, 1); } else { } return (err); out_unlock: tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: can\'t modify inode %lu attributes\n", tmp___2->pid, "setflags", inode->i_ino); ldv_mutex_unlock_645(& ui->ui_mutex); ubifs_release_budget(c, & req); return (err); } } long ubifs_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { int flags ; int err ; struct inode *inode ; struct ubifs_inode *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int __ret_pu ; int __pu_val ; bool tmp___2 ; int tmp___3 ; int __ret_gu ; unsigned long __val_gu ; struct _ddebug descriptor___0 ; struct task_struct *tmp___4 ; long tmp___5 ; { inode = (file->f_path.dentry)->d_inode; switch (cmd) { case 2148034049U: tmp = ubifs_inode((struct inode const *)inode); flags = ubifs2ioctl(tmp->flags); descriptor.modname = "ubifs"; descriptor.function = "ubifs_ioctl"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/ioctl.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): get flags: %#x, i_flags %#x\n"; descriptor.lineno = 276U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): get flags: %#x, i_flags %#x\n", tmp___0->pid, flags, inode->i_flags); } else { } might_fault(); __pu_val = flags; switch (4UL) { case 1UL: __asm__ volatile ("call __put_user_1": "=a" (__ret_pu): "0" (__pu_val), "c" ((int *)arg): "ebx"); goto ldv_28770; case 2UL: __asm__ volatile ("call __put_user_2": "=a" (__ret_pu): "0" (__pu_val), "c" ((int *)arg): "ebx"); goto ldv_28770; case 4UL: __asm__ volatile ("call __put_user_4": "=a" (__ret_pu): "0" (__pu_val), "c" ((int *)arg): "ebx"); goto ldv_28770; case 8UL: __asm__ volatile ("call __put_user_8": "=a" (__ret_pu): "0" (__pu_val), "c" ((int *)arg): "ebx"); goto ldv_28770; default: __asm__ volatile ("call __put_user_X": "=a" (__ret_pu): "0" (__pu_val), "c" ((int *)arg): "ebx"); goto ldv_28770; } ldv_28770: ; return ((long )__ret_pu); case 1074292226U: ; if ((int )(inode->i_sb)->s_flags & 1) { return (-30L); } else { } tmp___2 = inode_owner_or_capable((struct inode const *)inode); if (tmp___2) { tmp___3 = 0; } else { tmp___3 = 1; } if (tmp___3) { return (-13L); } else { } might_fault(); switch (4UL) { case 1UL: __asm__ volatile ("call __get_user_1": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_28780; case 2UL: __asm__ volatile ("call __get_user_2": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_28780; case 4UL: __asm__ volatile ("call __get_user_4": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_28780; case 8UL: __asm__ volatile ("call __get_user_8": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_28780; default: __asm__ volatile ("call __get_user_X": "=a" (__ret_gu), "=d" (__val_gu): "0" ((int *)arg)); goto ldv_28780; } ldv_28780: flags = (int )__val_gu; if (__ret_gu != 0) { return (-14L); } else { } if (((int )inode->i_mode & 61440) != 16384) { flags = flags & -65537; } else { } err = mnt_want_write_file(file); if (err != 0) { return ((long )err); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_ioctl"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/ioctl.c.prepared"; descriptor___0.format = "UBIFS DBG gen (pid %d): set flags: %#x, i_flags %#x\n"; descriptor___0.lineno = 299U; descriptor___0.flags = 0U; tmp___5 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG gen (pid %d): set flags: %#x, i_flags %#x\n", tmp___4->pid, flags, inode->i_flags); } else { } err = setflags(inode, flags); mnt_drop_write_file(file); return ((long )err); default: ; return (-25L); } } } long ubifs_compat_ioctl(struct file *file , unsigned int cmd , unsigned long arg ) { void *tmp ; long tmp___0 ; { switch (cmd) { case 2147771905U: cmd = 2148034049U; goto ldv_28794; case 1074030082U: cmd = 1074292226U; goto ldv_28794; default: ; return (-515L); } ldv_28794: tmp = compat_ptr((compat_uptr_t )arg); tmp___0 = ubifs_ioctl(file, cmd, (unsigned long )tmp); return (tmp___0); } } void ldv_main22_sequence_infinite_withcheck_stateful(void) { int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_28816; ldv_28815: tmp = __VERIFIER_nondet_int(); switch (tmp) { default: ; goto ldv_28814; } ldv_28814: ; ldv_28816: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_28815; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_635(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_636(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_637(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_638(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_639(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_640(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_641(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_642(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_643(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_644(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_645(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_661(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_658(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_660(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_662(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_664(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_666(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_668(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_670(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_672(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_674(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_676(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_678(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_657(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_659(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_663(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_665(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_667(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_669(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_671(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_673(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_675(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_677(struct mutex *ldv_func_arg1 ) ; void ubifs_dump_lpt_info(struct ubifs_info *c ) ; void ubifs_dump_lpt_lebs(struct ubifs_info const *c ) ; int dbg_check_ltab(struct ubifs_info *c ) ; int dbg_chk_lpt_free_spc(struct ubifs_info *c ) ; int dbg_chk_lpt_sz(struct ubifs_info *c , int action , int len ) ; static int dbg_populate_lsave(struct ubifs_info *c ) ; static struct ubifs_cnode *first_dirty_cnode(struct ubifs_nnode *nnode ) { struct task_struct *tmp ; long tmp___0 ; int i ; int cont ; struct ubifs_cnode *cnode ; int tmp___1 ; { tmp___0 = ldv__builtin_expect((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "first_dirty_cnode", 163, tmp->pid); dump_stack(); } else { } ldv_27627: cont = 0; i = 0; goto ldv_27626; ldv_27625: cnode = nnode->nbranch[i].ldv_26015.cnode; if ((unsigned long )cnode != (unsigned long )((struct ubifs_cnode *)0)) { tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& cnode->flags)); if (tmp___1 != 0) { if (cnode->level == 0) { return (cnode); } else { } nnode = (struct ubifs_nnode *)cnode; cont = 1; goto ldv_27624; } else { } } else { } i = i + 1; ldv_27626: ; if (i <= 3) { goto ldv_27625; } else { } ldv_27624: ; if (cont == 0) { return ((struct ubifs_cnode *)nnode); } else { } goto ldv_27627; } } static struct ubifs_cnode *next_dirty_cnode(struct ubifs_cnode *cnode ) { struct ubifs_nnode *nnode ; int i ; struct task_struct *tmp ; long tmp___0 ; struct ubifs_cnode *tmp___1 ; int tmp___2 ; { tmp___0 = ldv__builtin_expect((unsigned long )cnode == (unsigned long )((struct ubifs_cnode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "next_dirty_cnode", 196, tmp->pid); dump_stack(); } else { } nnode = cnode->parent; if ((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) { return (0); } else { } i = cnode->iip + 1; goto ldv_27635; ldv_27634: cnode = nnode->nbranch[i].ldv_26015.cnode; if ((unsigned long )cnode != (unsigned long )((struct ubifs_cnode *)0)) { tmp___2 = constant_test_bit(0U, (unsigned long const volatile *)(& cnode->flags)); if (tmp___2 != 0) { if (cnode->level == 0) { return (cnode); } else { } tmp___1 = first_dirty_cnode((struct ubifs_nnode *)cnode); return (tmp___1); } else { } } else { } i = i + 1; ldv_27635: ; if (i <= 3) { goto ldv_27634; } else { } return ((struct ubifs_cnode *)nnode); } } static int get_cnodes_to_commit(struct ubifs_info *c ) { struct ubifs_cnode *cnode ; struct ubifs_cnode *cnext ; int cnt ; int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long tmp___2 ; struct _ddebug descriptor ; struct task_struct *tmp___3 ; long tmp___4 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; { cnt = 0; if ((unsigned long )c->nroot == (unsigned long )((struct ubifs_nnode *)0)) { return (0); } else { } tmp = constant_test_bit(0U, (unsigned long const volatile *)(& (c->nroot)->flags)); if (tmp == 0) { return (0); } else { } c->lpt_cnext = first_dirty_cnode(c->nroot); cnode = c->lpt_cnext; if ((unsigned long )cnode == (unsigned long )((struct ubifs_cnode *)0)) { return (0); } else { } cnt = cnt + 1; ldv_27645: tmp___1 = constant_test_bit(2U, (unsigned long const volatile *)(& cnode->flags)); tmp___2 = ldv__builtin_expect(tmp___1 != 0, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "get_cnodes_to_commit", 235, tmp___0->pid); dump_stack(); } else { } __set_bit(2, (unsigned long volatile *)(& cnode->flags)); cnext = next_dirty_cnode(cnode); if ((unsigned long )cnext == (unsigned long )((struct ubifs_cnode *)0)) { cnode->cnext = c->lpt_cnext; goto ldv_27644; } else { } cnode->cnext = cnext; cnode = cnext; cnt = cnt + 1; goto ldv_27645; ldv_27644: descriptor.modname = "ubifs"; descriptor.function = "get_cnodes_to_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG cmt (pid %d): committing %d cnodes\n"; descriptor.lineno = 246U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG cmt (pid %d): committing %d cnodes\n", tmp___3->pid, cnt); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "get_cnodes_to_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor___0.format = "UBIFS DBG lp (pid %d): committing %d cnodes\n"; descriptor___0.lineno = 247U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG lp (pid %d): committing %d cnodes\n", tmp___5->pid, cnt); } else { } tmp___8 = ldv__builtin_expect(c->dirty_nn_cnt + c->dirty_pn_cnt != cnt, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "get_cnodes_to_commit", 248, tmp___7->pid); dump_stack(); } else { } return (cnt); } } static void upd_ltab(struct ubifs_info *c , int lnum , int free , int dirty ) { struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; { descriptor.modname = "ubifs"; descriptor.function = "upd_ltab"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d free %d dirty %d to %d +%d\n"; descriptor.lineno = 263U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d free %d dirty %d to %d +%d\n", tmp->pid, lnum, (c->ltab + (unsigned long )(lnum - c->lpt_first))->free, (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty, free, dirty); } else { } tmp___2 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "upd_ltab", 264, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "upd_ltab", 264, tmp___1->pid); dump_stack(); } else { } } (c->ltab + (unsigned long )(lnum - c->lpt_first))->free = free; (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty = (c->ltab + (unsigned long )(lnum - c->lpt_first))->dirty + dirty; return; } } static int alloc_lpt_leb(struct ubifs_info *c , int *lnum ) { int i ; int n ; { n = (*lnum - c->lpt_first) + 1; i = n; goto ldv_27664; ldv_27663: ; if ((unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U || (unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U) { goto ldv_27662; } else { } if ((c->ltab + (unsigned long )i)->free == c->leb_size) { (c->ltab + (unsigned long )i)->cmt = 1U; *lnum = c->lpt_first + i; return (0); } else { } ldv_27662: i = i + 1; ldv_27664: ; if (c->lpt_lebs > i) { goto ldv_27663; } else { } i = 0; goto ldv_27668; ldv_27667: ; if ((unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U || (unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U) { goto ldv_27666; } else { } if ((c->ltab + (unsigned long )i)->free == c->leb_size) { (c->ltab + (unsigned long )i)->cmt = 1U; *lnum = c->lpt_first + i; return (0); } else { } ldv_27666: i = i + 1; ldv_27668: ; if (i < n) { goto ldv_27667; } else { } return (-28); } } static int layout_cnodes(struct ubifs_info *c ) { int lnum ; int offs ; int len ; int alen ; int done_lsave ; int done_ltab ; int err ; struct ubifs_cnode *cnode ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; { err = dbg_chk_lpt_sz(c, 0, 0); if (err != 0) { return (err); } else { } cnode = c->lpt_cnext; if ((unsigned long )cnode == (unsigned long )((struct ubifs_cnode *)0)) { return (0); } else { } lnum = c->nhead_lnum; offs = c->nhead_offs; done_lsave = (unsigned int )*((unsigned char *)c + 2048UL) == 0U; done_ltab = 0; if (done_lsave == 0 && c->lsave_sz + offs <= c->leb_size) { done_lsave = 1; c->lsave_lnum = lnum; c->lsave_offs = offs; offs = c->lsave_sz + offs; dbg_chk_lpt_sz(c, 1, c->lsave_sz); } else { } if (c->ltab_sz + offs <= c->leb_size) { done_ltab = 1; c->ltab_lnum = lnum; c->ltab_offs = offs; offs = c->ltab_sz + offs; dbg_chk_lpt_sz(c, 1, c->ltab_sz); } else { } ldv_27686: ; if (cnode->level != 0) { len = c->nnode_sz; c->dirty_nn_cnt = c->dirty_nn_cnt + -1; } else { len = c->pnode_sz; c->dirty_pn_cnt = c->dirty_pn_cnt + -1; } goto ldv_27683; ldv_27685: alen = ((c->min_io_size + -1) + offs) & - c->min_io_size; upd_ltab(c, lnum, c->leb_size - alen, alen - offs); dbg_chk_lpt_sz(c, 2, c->leb_size - offs); err = alloc_lpt_leb(c, & lnum); if (err != 0) { goto no_space; } else { } offs = 0; tmp___0 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_cnodes", 361, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_cnodes", 361, tmp->pid); dump_stack(); } else { } } if (done_lsave == 0) { done_lsave = 1; c->lsave_lnum = lnum; c->lsave_offs = offs; offs = c->lsave_sz + offs; dbg_chk_lpt_sz(c, 1, c->lsave_sz); goto ldv_27683; } else { } if (done_ltab == 0) { done_ltab = 1; c->ltab_lnum = lnum; c->ltab_offs = offs; offs = c->ltab_sz + offs; dbg_chk_lpt_sz(c, 1, c->ltab_sz); goto ldv_27683; } else { } goto ldv_27684; ldv_27683: ; if (offs + len > c->leb_size) { goto ldv_27685; } else { } ldv_27684: ; if ((unsigned long )cnode->parent != (unsigned long )((struct ubifs_nnode *)0)) { (cnode->parent)->nbranch[cnode->iip].lnum = lnum; (cnode->parent)->nbranch[cnode->iip].offs = offs; } else { c->lpt_lnum = lnum; c->lpt_offs = offs; } offs = offs + len; dbg_chk_lpt_sz(c, 1, len); cnode = cnode->cnext; if ((unsigned long )cnode != (unsigned long )((struct ubifs_cnode *)0) && (unsigned long )c->lpt_cnext != (unsigned long )cnode) { goto ldv_27686; } else { } if (done_lsave == 0) { if (c->lsave_sz + offs > c->leb_size) { alen = ((c->min_io_size + -1) + offs) & - c->min_io_size; upd_ltab(c, lnum, c->leb_size - alen, alen - offs); dbg_chk_lpt_sz(c, 2, c->leb_size - offs); err = alloc_lpt_leb(c, & lnum); if (err != 0) { goto no_space; } else { } offs = 0; tmp___3 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_cnodes", 404, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_cnodes", 404, tmp___2->pid); dump_stack(); } else { } } } else { } done_lsave = 1; c->lsave_lnum = lnum; c->lsave_offs = offs; offs = c->lsave_sz + offs; dbg_chk_lpt_sz(c, 1, c->lsave_sz); } else { } if (done_ltab == 0) { if (c->ltab_sz + offs > c->leb_size) { alen = ((c->min_io_size + -1) + offs) & - c->min_io_size; upd_ltab(c, lnum, c->leb_size - alen, alen - offs); dbg_chk_lpt_sz(c, 2, c->leb_size - offs); err = alloc_lpt_leb(c, & lnum); if (err != 0) { goto no_space; } else { } offs = 0; tmp___6 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_cnodes", 424, tmp___5->pid); dump_stack(); } else { tmp___7 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "layout_cnodes", 424, tmp___5->pid); dump_stack(); } else { } } } else { } done_ltab = 1; c->ltab_lnum = lnum; c->ltab_offs = offs; offs = c->ltab_sz + offs; dbg_chk_lpt_sz(c, 1, c->ltab_sz); } else { } alen = ((c->min_io_size + -1) + offs) & - c->min_io_size; upd_ltab(c, lnum, c->leb_size - alen, alen - offs); dbg_chk_lpt_sz(c, 4, alen - offs); err = dbg_chk_lpt_sz(c, 3, alen); if (err != 0) { return (err); } else { } return (0); no_space: tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT out of space at LEB %d:%d needing %d, done_ltab %d, done_lsave %d\n", tmp___8->pid, "layout_cnodes", lnum, offs, len, done_ltab, done_lsave); ubifs_dump_lpt_info(c); ubifs_dump_lpt_lebs((struct ubifs_info const *)c); dump_stack(); return (err); } } static int realloc_lpt_leb(struct ubifs_info *c , int *lnum ) { int i ; int n ; { n = (*lnum - c->lpt_first) + 1; i = n; goto ldv_27695; ldv_27694: ; if ((unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U) { (c->ltab + (unsigned long )i)->cmt = 0U; *lnum = c->lpt_first + i; return (0); } else { } i = i + 1; ldv_27695: ; if (c->lpt_lebs > i) { goto ldv_27694; } else { } i = 0; goto ldv_27698; ldv_27697: ; if ((unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U) { (c->ltab + (unsigned long )i)->cmt = 0U; *lnum = c->lpt_first + i; return (0); } else { } i = i + 1; ldv_27698: ; if (i < n) { goto ldv_27697; } else { } return (-28); } } static int write_cnodes(struct ubifs_info *c ) { int lnum ; int offs ; int len ; int from ; int err ; int wlen ; int alen ; int done_ltab ; int done_lsave ; struct ubifs_cnode *cnode ; void *buf ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; long tmp___7 ; struct _ddebug descriptor ; struct task_struct *tmp___8 ; long tmp___9 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___10 ; long tmp___11 ; struct _ddebug descriptor___1 ; struct task_struct *tmp___12 ; long tmp___13 ; struct _ddebug descriptor___2 ; struct task_struct *tmp___14 ; long tmp___15 ; struct task_struct *tmp___16 ; { buf = c->lpt_buf; cnode = c->lpt_cnext; if ((unsigned long )cnode == (unsigned long )((struct ubifs_cnode *)0)) { return (0); } else { } lnum = c->nhead_lnum; offs = c->nhead_offs; from = offs; if (offs == 0) { err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } } else { } done_lsave = (unsigned int )*((unsigned char *)c + 2048UL) == 0U; done_ltab = 0; if (done_lsave == 0 && c->lsave_sz + offs <= c->leb_size) { done_lsave = 1; ubifs_pack_lsave(c, buf + (unsigned long )offs, c->lsave); offs = c->lsave_sz + offs; dbg_chk_lpt_sz(c, 1, c->lsave_sz); } else { } if (c->ltab_sz + offs <= c->leb_size) { done_ltab = 1; ubifs_pack_ltab(c, buf + (unsigned long )offs, c->ltab_cmt); offs = c->ltab_sz + offs; dbg_chk_lpt_sz(c, 1, c->ltab_sz); } else { } ldv_27719: ; if (cnode->level != 0) { len = c->nnode_sz; } else { len = c->pnode_sz; } goto ldv_27716; ldv_27718: wlen = offs - from; if (wlen != 0) { alen = ((c->min_io_size + -1) + wlen) & - c->min_io_size; memset(buf + (unsigned long )offs, 255, (size_t )(alen - wlen)); err = ubifs_leb_write(c, lnum, (void const *)buf + (unsigned long )from, from, alen); if (err != 0) { return (err); } else { } } else { } dbg_chk_lpt_sz(c, 2, c->leb_size - offs); err = realloc_lpt_leb(c, & lnum); if (err != 0) { goto no_space; } else { } from = 0; offs = from; tmp___0 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_cnodes", 548, tmp->pid); dump_stack(); } else { tmp___1 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_cnodes", 548, tmp->pid); dump_stack(); } else { } } err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } if (done_lsave == 0) { done_lsave = 1; ubifs_pack_lsave(c, buf + (unsigned long )offs, c->lsave); offs = c->lsave_sz + offs; dbg_chk_lpt_sz(c, 1, c->lsave_sz); goto ldv_27716; } else { } if (done_ltab == 0) { done_ltab = 1; ubifs_pack_ltab(c, buf + (unsigned long )offs, c->ltab_cmt); offs = c->ltab_sz + offs; dbg_chk_lpt_sz(c, 1, c->ltab_sz); goto ldv_27716; } else { } goto ldv_27717; ldv_27716: ; if (offs + len > c->leb_size) { goto ldv_27718; } else { } ldv_27717: ; if (cnode->level != 0) { ubifs_pack_nnode(c, buf + (unsigned long )offs, (struct ubifs_nnode *)cnode); } else { ubifs_pack_pnode(c, buf + (unsigned long )offs, (struct ubifs_pnode *)cnode); } clear_bit(0, (unsigned long volatile *)(& cnode->flags)); __asm__ volatile ("": : : "memory"); clear_bit(2, (unsigned long volatile *)(& cnode->flags)); __asm__ volatile ("": : : "memory"); offs = offs + len; dbg_chk_lpt_sz(c, 1, len); cnode = cnode->cnext; if ((unsigned long )cnode != (unsigned long )((struct ubifs_cnode *)0) && (unsigned long )c->lpt_cnext != (unsigned long )cnode) { goto ldv_27719; } else { } if (done_lsave == 0) { if (c->lsave_sz + offs > c->leb_size) { wlen = offs - from; alen = ((c->min_io_size + -1) + wlen) & - c->min_io_size; memset(buf + (unsigned long )offs, 255, (size_t )(alen - wlen)); err = ubifs_leb_write(c, lnum, (void const *)buf + (unsigned long )from, from, alen); if (err != 0) { return (err); } else { } dbg_chk_lpt_sz(c, 2, c->leb_size - offs); err = realloc_lpt_leb(c, & lnum); if (err != 0) { goto no_space; } else { } from = 0; offs = from; tmp___3 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_cnodes", 605, tmp___2->pid); dump_stack(); } else { tmp___4 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_cnodes", 605, tmp___2->pid); dump_stack(); } else { } } err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } } else { } done_lsave = 1; ubifs_pack_lsave(c, buf + (unsigned long )offs, c->lsave); offs = c->lsave_sz + offs; dbg_chk_lpt_sz(c, 1, c->lsave_sz); } else { } if (done_ltab == 0) { if (c->ltab_sz + offs > c->leb_size) { wlen = offs - from; alen = ((c->min_io_size + -1) + wlen) & - c->min_io_size; memset(buf + (unsigned long )offs, 255, (size_t )(alen - wlen)); err = ubifs_leb_write(c, lnum, (void const *)buf + (unsigned long )from, from, alen); if (err != 0) { return (err); } else { } dbg_chk_lpt_sz(c, 2, c->leb_size - offs); err = realloc_lpt_leb(c, & lnum); if (err != 0) { goto no_space; } else { } from = 0; offs = from; tmp___6 = ldv__builtin_expect(c->lpt_first > lnum, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_cnodes", 631, tmp___5->pid); dump_stack(); } else { tmp___7 = ldv__builtin_expect(c->lpt_last < lnum, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "write_cnodes", 631, tmp___5->pid); dump_stack(); } else { } } err = ubifs_leb_unmap(c, lnum); if (err != 0) { return (err); } else { } } else { } done_ltab = 1; ubifs_pack_ltab(c, buf + (unsigned long )offs, c->ltab_cmt); offs = c->ltab_sz + offs; dbg_chk_lpt_sz(c, 1, c->ltab_sz); } else { } wlen = offs - from; alen = ((c->min_io_size + -1) + wlen) & - c->min_io_size; memset(buf + (unsigned long )offs, 255, (size_t )(alen - wlen)); err = ubifs_leb_write(c, lnum, (void const *)buf + (unsigned long )from, from, alen); if (err != 0) { return (err); } else { } dbg_chk_lpt_sz(c, 4, alen - wlen); err = dbg_chk_lpt_sz(c, 3, ((c->min_io_size + -1) + offs) & - c->min_io_size); if (err != 0) { return (err); } else { } c->nhead_lnum = lnum; c->nhead_offs = ((c->min_io_size + -1) + offs) & - c->min_io_size; descriptor.modname = "ubifs"; descriptor.function = "write_cnodes"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LPT root is at %d:%d\n"; descriptor.lineno = 658U; descriptor.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LPT root is at %d:%d\n", tmp___8->pid, c->lpt_lnum, c->lpt_offs); } else { } descriptor___0.modname = "ubifs"; descriptor___0.function = "write_cnodes"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor___0.format = "UBIFS DBG lp (pid %d): LPT head is at %d:%d\n"; descriptor___0.lineno = 659U; descriptor___0.flags = 0U; tmp___11 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG lp (pid %d): LPT head is at %d:%d\n", tmp___10->pid, c->nhead_lnum, c->nhead_offs); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "write_cnodes"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor___1.format = "UBIFS DBG lp (pid %d): LPT ltab is at %d:%d\n"; descriptor___1.lineno = 660U; descriptor___1.flags = 0U; tmp___13 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___13 != 0L) { tmp___12 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG lp (pid %d): LPT ltab is at %d:%d\n", tmp___12->pid, c->ltab_lnum, c->ltab_offs); } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { descriptor___2.modname = "ubifs"; descriptor___2.function = "write_cnodes"; descriptor___2.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor___2.format = "UBIFS DBG lp (pid %d): LPT lsave is at %d:%d\n"; descriptor___2.lineno = 662U; descriptor___2.flags = 0U; tmp___15 = ldv__builtin_expect((long )descriptor___2.flags & 1L, 0L); if (tmp___15 != 0L) { tmp___14 = get_current(); __dynamic_pr_debug(& descriptor___2, "UBIFS DBG lp (pid %d): LPT lsave is at %d:%d\n", tmp___14->pid, c->lsave_lnum, c->lsave_offs); } else { } } else { } return (0); no_space: tmp___16 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT out of space mismatch at LEB %d:%d needing %d, done_ltab %d, done_lsave %d\n", tmp___16->pid, "write_cnodes", lnum, offs, len, done_ltab, done_lsave); ubifs_dump_lpt_info(c); ubifs_dump_lpt_lebs((struct ubifs_info const *)c); dump_stack(); return (err); } } static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c , struct ubifs_pnode *pnode ) { struct ubifs_nnode *nnode ; int iip ; struct ubifs_pnode *tmp ; long tmp___0 ; long tmp___1 ; struct ubifs_pnode *tmp___2 ; { nnode = pnode->parent; iip = pnode->iip + 1; goto ldv_27732; ldv_27731: ; if (nnode->nbranch[iip].lnum != 0) { tmp = ubifs_get_pnode(c, nnode, iip); return (tmp); } else { } iip = iip + 1; ldv_27732: ; if (iip <= 3) { goto ldv_27731; } else { } ldv_27737: iip = nnode->iip + 1; nnode = nnode->parent; if ((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) { return (0); } else { } goto ldv_27736; ldv_27735: ; if (nnode->nbranch[iip].lnum != 0) { goto ldv_27734; } else { } iip = iip + 1; ldv_27736: ; if (iip <= 3) { goto ldv_27735; } else { } ldv_27734: ; if (iip > 3) { goto ldv_27737; } else { } nnode = ubifs_get_nnode(c, nnode, iip); tmp___0 = IS_ERR((void const *)nnode); if (tmp___0 != 0L) { return ((struct ubifs_pnode *)nnode); } else { } goto ldv_27743; ldv_27742: iip = 0; goto ldv_27741; ldv_27740: ; if (nnode->nbranch[iip].lnum != 0) { goto ldv_27739; } else { } iip = iip + 1; ldv_27741: ; if (iip <= 3) { goto ldv_27740; } else { } ldv_27739: ; if (iip > 3) { iip = 0; } else { } nnode = ubifs_get_nnode(c, nnode, iip); tmp___1 = IS_ERR((void const *)nnode); if (tmp___1 != 0L) { return ((struct ubifs_pnode *)nnode); } else { } ldv_27743: ; if (nnode->level > 1) { goto ldv_27742; } else { } iip = 0; goto ldv_27747; ldv_27746: ; if (nnode->nbranch[iip].lnum != 0) { goto ldv_27745; } else { } iip = iip + 1; ldv_27747: ; if (iip <= 3) { goto ldv_27746; } else { } ldv_27745: ; if (iip > 3) { iip = 0; } else { } tmp___2 = ubifs_get_pnode(c, nnode, iip); return (tmp___2); } } static struct ubifs_pnode *pnode_lookup(struct ubifs_info *c , int i ) { int err ; int h ; int iip ; int shft ; struct ubifs_nnode *nnode ; void *tmp ; void *tmp___0 ; long tmp___1 ; struct ubifs_pnode *tmp___2 ; { if ((unsigned long )c->nroot == (unsigned long )((struct ubifs_nnode *)0)) { err = ubifs_read_nnode(c, 0, 0); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_pnode *)tmp); } else { } } else { } i = i << 2; nnode = c->nroot; shft = c->lpt_hght * 2; h = 1; goto ldv_27758; ldv_27757: iip = (i >> shft) & 3; shft = shft + -2; nnode = ubifs_get_nnode(c, nnode, iip); tmp___1 = IS_ERR((void const *)nnode); if (tmp___1 != 0L) { tmp___0 = ERR_CAST((void const *)nnode); return ((struct ubifs_pnode *)tmp___0); } else { } h = h + 1; ldv_27758: ; if (c->lpt_hght > h) { goto ldv_27757; } else { } iip = (i >> shft) & 3; tmp___2 = ubifs_get_pnode(c, nnode, iip); return (tmp___2); } } static void add_pnode_dirt___0(struct ubifs_info *c , struct ubifs_pnode *pnode ) { { ubifs_add_lpt_dirt(c, (pnode->parent)->nbranch[pnode->iip].lnum, c->pnode_sz); return; } } static void do_make_pnode_dirty(struct ubifs_info *c , struct ubifs_pnode *pnode ) { struct ubifs_nnode *nnode ; int tmp ; int tmp___0 ; { tmp___0 = test_and_set_bit(0, (unsigned long volatile *)(& pnode->flags)); if (tmp___0 == 0) { c->dirty_pn_cnt = c->dirty_pn_cnt + 1; add_pnode_dirt___0(c, pnode); nnode = pnode->parent; goto ldv_27771; ldv_27770: tmp = test_and_set_bit(0, (unsigned long volatile *)(& nnode->flags)); if (tmp == 0) { c->dirty_nn_cnt = c->dirty_nn_cnt + 1; ubifs_add_nnode_dirt(c, nnode); nnode = nnode->parent; } else { goto ldv_27769; } ldv_27771: ; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { goto ldv_27770; } else { } ldv_27769: ; } else { } return; } } static int make_tree_dirty(struct ubifs_info *c ) { struct ubifs_pnode *pnode ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { pnode = pnode_lookup(c, 0); tmp___0 = IS_ERR((void const *)pnode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)pnode); return ((int )tmp); } else { } goto ldv_27777; ldv_27776: do_make_pnode_dirty(c, pnode); pnode = next_pnode_to_dirty(c, pnode); tmp___2 = IS_ERR((void const *)pnode); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)pnode); return ((int )tmp___1); } else { } ldv_27777: ; if ((unsigned long )pnode != (unsigned long )((struct ubifs_pnode *)0)) { goto ldv_27776; } else { } return (0); } } static int need_write_all(struct ubifs_info *c ) { long long free ; int i ; { free = 0LL; i = 0; goto ldv_27785; ldv_27784: ; if (c->lpt_first + i == c->nhead_lnum) { free = (long long )(c->leb_size - c->nhead_offs) + free; } else if ((c->ltab + (unsigned long )i)->free == c->leb_size) { free = (long long )c->leb_size + free; } else if ((c->ltab + (unsigned long )i)->free + (c->ltab + (unsigned long )i)->dirty == c->leb_size) { free = (long long )c->leb_size + free; } else { } i = i + 1; ldv_27785: ; if (c->lpt_lebs > i) { goto ldv_27784; } else { } if (c->lpt_sz * 2LL >= free) { return (1); } else { } return (0); } } static void lpt_tgc_start(struct ubifs_info *c ) { int i ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { i = 0; goto ldv_27795; ldv_27794: ; if (c->lpt_first + i == c->nhead_lnum) { goto ldv_27791; } else { } if ((c->ltab + (unsigned long )i)->dirty > 0 && (c->ltab + (unsigned long )i)->free + (c->ltab + (unsigned long )i)->dirty == c->leb_size) { (c->ltab + (unsigned long )i)->tgc = 1U; (c->ltab + (unsigned long )i)->free = c->leb_size; (c->ltab + (unsigned long )i)->dirty = 0; descriptor.modname = "ubifs"; descriptor.function = "lpt_tgc_start"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d\n"; descriptor.lineno = 884U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d\n", tmp->pid, c->lpt_first + i); } else { } } else { } ldv_27791: i = i + 1; ldv_27795: ; if (c->lpt_lebs > i) { goto ldv_27794; } else { } return; } } static int lpt_tgc_end(struct ubifs_info *c ) { int i ; int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { i = 0; goto ldv_27805; ldv_27804: ; if ((unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U) { err = ubifs_leb_unmap(c, c->lpt_first + i); if (err != 0) { return (err); } else { } (c->ltab + (unsigned long )i)->tgc = 0U; descriptor.modname = "ubifs"; descriptor.function = "lpt_tgc_end"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d\n"; descriptor.lineno = 908U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d\n", tmp->pid, c->lpt_first + i); } else { } } else { } i = i + 1; ldv_27805: ; if (c->lpt_lebs > i) { goto ldv_27804; } else { } return (0); } } static void populate_lsave(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct ubifs_lpt_heap *heap ; int i ; int cnt ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; struct list_head const *__mptr ; int tmp___2 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; int tmp___3 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; int tmp___4 ; struct list_head const *__mptr___4 ; int tmp___5 ; int tmp___6 ; int tmp___7 ; int tmp___8 ; { cnt = 0; tmp___0 = ldv__builtin_expect((unsigned int )*((unsigned char *)c + 2048UL) == 0U, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "populate_lsave", 931, tmp->pid); dump_stack(); } else { } if ((c->lpt_drty_flgs & 2) == 0) { c->lpt_drty_flgs = c->lpt_drty_flgs | 2; ubifs_add_lpt_dirt(c, c->lsave_lnum, c->lsave_sz); } else { } tmp___1 = dbg_populate_lsave(c); if (tmp___1 != 0) { return; } else { } __mptr = (struct list_head const *)c->empty_list.next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; goto ldv_27820; ldv_27819: tmp___2 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___2) = lprops->lnum; if (c->lsave_cnt <= cnt) { return; } else { } __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___0 + 0xfffffffffffffff0UL; ldv_27820: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->empty_list)) { goto ldv_27819; } else { } __mptr___1 = (struct list_head const *)c->freeable_list.next; lprops = (struct ubifs_lprops *)__mptr___1 + 0xfffffffffffffff0UL; goto ldv_27827; ldv_27826: tmp___3 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___3) = lprops->lnum; if (c->lsave_cnt <= cnt) { return; } else { } __mptr___2 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___2 + 0xfffffffffffffff0UL; ldv_27827: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->freeable_list)) { goto ldv_27826; } else { } __mptr___3 = (struct list_head const *)c->frdi_idx_list.next; lprops = (struct ubifs_lprops *)__mptr___3 + 0xfffffffffffffff0UL; goto ldv_27834; ldv_27833: tmp___4 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___4) = lprops->lnum; if (c->lsave_cnt <= cnt) { return; } else { } __mptr___4 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___4 + 0xfffffffffffffff0UL; ldv_27834: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->frdi_idx_list)) { goto ldv_27833; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 1UL; i = 0; goto ldv_27837; ldv_27836: tmp___5 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___5) = (*(heap->arr + (unsigned long )i))->lnum; if (c->lsave_cnt <= cnt) { return; } else { } i = i + 1; ldv_27837: ; if (heap->cnt > i) { goto ldv_27836; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap); i = 0; goto ldv_27840; ldv_27839: tmp___6 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___6) = (*(heap->arr + (unsigned long )i))->lnum; if (c->lsave_cnt <= cnt) { return; } else { } i = i + 1; ldv_27840: ; if (heap->cnt > i) { goto ldv_27839; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 2UL; i = 0; goto ldv_27843; ldv_27842: tmp___7 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___7) = (*(heap->arr + (unsigned long )i))->lnum; if (c->lsave_cnt <= cnt) { return; } else { } i = i + 1; ldv_27843: ; if (heap->cnt > i) { goto ldv_27842; } else { } goto ldv_27846; ldv_27845: tmp___8 = cnt; cnt = cnt + 1; *(c->lsave + (unsigned long )tmp___8) = c->main_first; ldv_27846: ; if (c->lsave_cnt > cnt) { goto ldv_27845; } else { } return; } } static struct ubifs_nnode *nnode_lookup(struct ubifs_info *c , int i ) { int err ; int iip ; struct ubifs_nnode *nnode ; void *tmp ; long tmp___0 ; { if ((unsigned long )c->nroot == (unsigned long )((struct ubifs_nnode *)0)) { err = ubifs_read_nnode(c, 0, 0); if (err != 0) { tmp = ERR_PTR((long )err); return ((struct ubifs_nnode *)tmp); } else { } } else { } nnode = c->nroot; ldv_27856: iip = i & 3; i = i >> 2; if (i == 0) { goto ldv_27855; } else { } nnode = ubifs_get_nnode(c, nnode, iip); tmp___0 = IS_ERR((void const *)nnode); if (tmp___0 != 0L) { return (nnode); } else { } goto ldv_27856; ldv_27855: ; return (nnode); } } static int make_nnode_dirty(struct ubifs_info *c , int node_num , int lnum , int offs ) { struct ubifs_nnode *nnode ; long tmp ; long tmp___0 ; struct ubifs_nbranch *branch ; int tmp___1 ; int tmp___2 ; { nnode = nnode_lookup(c, node_num); tmp___0 = IS_ERR((void const *)nnode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)nnode); return ((int )tmp); } else { } if ((unsigned long )nnode->parent != (unsigned long )((struct ubifs_nnode *)0)) { branch = (struct ubifs_nbranch *)(& (nnode->parent)->nbranch) + (unsigned long )nnode->iip; if (branch->lnum != lnum || branch->offs != offs) { return (0); } else { } } else if (c->lpt_lnum != lnum || c->lpt_offs != offs) { return (0); } else { } tmp___2 = test_and_set_bit(0, (unsigned long volatile *)(& nnode->flags)); if (tmp___2 == 0) { c->dirty_nn_cnt = c->dirty_nn_cnt + 1; ubifs_add_nnode_dirt(c, nnode); nnode = nnode->parent; goto ldv_27867; ldv_27866: tmp___1 = test_and_set_bit(0, (unsigned long volatile *)(& nnode->flags)); if (tmp___1 == 0) { c->dirty_nn_cnt = c->dirty_nn_cnt + 1; ubifs_add_nnode_dirt(c, nnode); nnode = nnode->parent; } else { goto ldv_27865; } ldv_27867: ; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { goto ldv_27866; } else { } ldv_27865: ; } else { } return (0); } } static int make_pnode_dirty(struct ubifs_info *c , int node_num , int lnum , int offs ) { struct ubifs_pnode *pnode ; struct ubifs_nbranch *branch ; long tmp ; long tmp___0 ; { pnode = pnode_lookup(c, node_num); tmp___0 = IS_ERR((void const *)pnode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)pnode); return ((int )tmp); } else { } branch = (struct ubifs_nbranch *)(& (pnode->parent)->nbranch) + (unsigned long )pnode->iip; if (branch->lnum != lnum || branch->offs != offs) { return (0); } else { } do_make_pnode_dirty(c, pnode); return (0); } } static int make_ltab_dirty(struct ubifs_info *c , int lnum , int offs ) { { if (c->ltab_lnum != lnum || c->ltab_offs != offs) { return (0); } else { } if ((c->lpt_drty_flgs & 1) == 0) { c->lpt_drty_flgs = c->lpt_drty_flgs | 1; ubifs_add_lpt_dirt(c, c->ltab_lnum, c->ltab_sz); } else { } return (0); } } static int make_lsave_dirty(struct ubifs_info *c , int lnum , int offs ) { { if (c->lsave_lnum != lnum || c->lsave_offs != offs) { return (0); } else { } if ((c->lpt_drty_flgs & 2) == 0) { c->lpt_drty_flgs = c->lpt_drty_flgs | 2; ubifs_add_lpt_dirt(c, c->lsave_lnum, c->lsave_sz); } else { } return (0); } } static int make_node_dirty(struct ubifs_info *c , int node_type , int node_num , int lnum , int offs ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { switch (node_type) { case 1: tmp = make_nnode_dirty(c, node_num, lnum, offs); return (tmp); case 0: tmp___0 = make_pnode_dirty(c, node_num, lnum, offs); return (tmp___0); case 2: tmp___1 = make_ltab_dirty(c, lnum, offs); return (tmp___1); case 3: tmp___2 = make_lsave_dirty(c, lnum, offs); return (tmp___2); } return (-22); } } static int get_lpt_node_len(struct ubifs_info const *c , int node_type ) { { switch (node_type) { case 1: ; return ((int )c->nnode_sz); case 0: ; return ((int )c->pnode_sz); case 2: ; return ((int )c->ltab_sz); case 3: ; return ((int )c->lsave_sz); } return (0); } } static int get_pad_len(struct ubifs_info const *c , uint8_t *buf , int len ) { int offs ; int pad_len ; { if ((int )c->min_io_size == 1) { return (0); } else { } offs = (int )c->leb_size - len; pad_len = ((((int )c->min_io_size + -1) + offs) & - ((int )c->min_io_size)) - offs; return (pad_len); } } static int get_lpt_node_type(struct ubifs_info const *c , uint8_t *buf , int *node_num ) { uint8_t *addr ; int pos ; int node_type ; uint32_t tmp ; uint32_t tmp___0 ; { addr = buf + 2UL; pos = 0; tmp = ubifs_unpack_bits(& addr, & pos, 4); node_type = (int )tmp; tmp___0 = ubifs_unpack_bits(& addr, & pos, c->pcnt_bits); *node_num = (int )tmp___0; return (node_type); } } static int is_a_node(struct ubifs_info const *c , uint8_t *buf , int len ) { uint8_t *addr ; int pos ; int node_type ; int node_len ; uint16_t crc ; uint16_t calc_crc ; uint32_t tmp ; uint32_t tmp___0 ; { addr = buf + 2UL; pos = 0; if (len <= 2) { return (0); } else { } tmp = ubifs_unpack_bits(& addr, & pos, 4); node_type = (int )tmp; if (node_type == 15) { return (0); } else { } node_len = get_lpt_node_len(c, node_type); if (node_len == 0 || node_len > len) { return (0); } else { } pos = 0; addr = buf; tmp___0 = ubifs_unpack_bits(& addr, & pos, 16); crc = (uint16_t )tmp___0; calc_crc = crc16(65535, (u8 const *)buf + 2U, (size_t )(node_len + -2)); if ((int )crc != (int )calc_crc) { return (0); } else { } return (1); } } static int lpt_gc_lnum(struct ubifs_info *c , int lnum ) { int err ; int len ; int node_type ; int node_num ; int node_len ; int offs ; void *buf ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int pad_len ; int tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; { len = c->leb_size; buf = c->lpt_buf; descriptor.modname = "ubifs"; descriptor.function = "lpt_gc_lnum"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d\n"; descriptor.lineno = 1274U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d\n", tmp->pid, lnum); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, buf, 0, c->leb_size, 1); if (err != 0) { return (err); } else { } ldv_27946: tmp___1 = is_a_node((struct ubifs_info const *)c, (uint8_t *)buf, len); if (tmp___1 == 0) { pad_len = get_pad_len((struct ubifs_info const *)c, (uint8_t *)buf, len); if (pad_len != 0) { buf = buf + (unsigned long )pad_len; len = len - pad_len; goto ldv_27945; } else { } return (0); } else { } node_type = get_lpt_node_type((struct ubifs_info const *)c, (uint8_t *)buf, & node_num); node_len = get_lpt_node_len((struct ubifs_info const *)c, node_type); offs = c->leb_size - len; tmp___3 = ldv__builtin_expect(node_len == 0, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lpt_gc_lnum", 1295, tmp___2->pid); dump_stack(); } else { } ldv_mutex_lock_665(& c->lp_mutex); err = make_node_dirty(c, node_type, node_num, lnum, offs); ldv_mutex_unlock_666(& c->lp_mutex); if (err != 0) { return (err); } else { } buf = buf + (unsigned long )node_len; len = len - node_len; ldv_27945: ; goto ldv_27946; return (0); } } static int lpt_gc(struct ubifs_info *c ) { int i ; int lnum ; int dirty ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; { lnum = -1; dirty = 0; ldv_mutex_lock_667(& c->lp_mutex); i = 0; goto ldv_27956; ldv_27955: tmp___0 = ldv__builtin_expect((long )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "lpt_gc", 1320, tmp->pid); dump_stack(); } else { } if (c->lpt_first + i == c->nhead_lnum || (c->ltab + (unsigned long )i)->free + (c->ltab + (unsigned long )i)->dirty == c->leb_size) { goto ldv_27954; } else { } if ((c->ltab + (unsigned long )i)->dirty > dirty) { dirty = (c->ltab + (unsigned long )i)->dirty; lnum = c->lpt_first + i; } else { } ldv_27954: i = i + 1; ldv_27956: ; if (c->lpt_lebs > i) { goto ldv_27955; } else { } ldv_mutex_unlock_668(& c->lp_mutex); if (lnum == -1) { return (-28); } else { } tmp___1 = lpt_gc_lnum(c, lnum); return (tmp___1); } } int ubifs_lpt_start_commit(struct ubifs_info *c ) { int err ; int cnt ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; int tmp___1 ; struct _ddebug descriptor___0 ; struct task_struct *tmp___2 ; long tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; size_t __len ; void *__ret ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_lpt_start_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): \n"; descriptor.lineno = 1349U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): \n", tmp->pid); } else { } ldv_mutex_lock_669(& c->lp_mutex); err = dbg_chk_lpt_free_spc(c); if (err != 0) { goto out; } else { } err = dbg_check_ltab(c); if (err != 0) { goto out; } else { } if (c->check_lpt_free != 0) { c->check_lpt_free = 0; goto ldv_27967; ldv_27966: ldv_mutex_unlock_670(& c->lp_mutex); err = lpt_gc(c); if (err != 0) { return (err); } else { } ldv_mutex_lock_671(& c->lp_mutex); ldv_27967: tmp___1 = need_write_all(c); if (tmp___1 != 0) { goto ldv_27966; } else { } } else { } lpt_tgc_start(c); if (c->dirty_pn_cnt == 0) { descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_lpt_start_commit"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor___0.format = "UBIFS DBG cmt (pid %d): no cnodes to commit\n"; descriptor___0.lineno = 1379U; descriptor___0.flags = 0U; tmp___3 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___3 != 0L) { tmp___2 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG cmt (pid %d): no cnodes to commit\n", tmp___2->pid); } else { } err = 0; goto out; } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) == 0U) { tmp___4 = need_write_all(c); if (tmp___4 != 0) { err = make_tree_dirty(c); if (err != 0) { goto out; } else { } lpt_tgc_start(c); } else { } } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { populate_lsave(c); } else { } cnt = get_cnodes_to_commit(c); tmp___6 = ldv__builtin_expect(cnt == 0, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_lpt_start_commit", 1396, tmp___5->pid); dump_stack(); } else { } err = layout_cnodes(c); if (err != 0) { goto out; } else { } __len = (unsigned long )c->lpt_lebs * 12UL; __ret = memcpy((void *)c->ltab_cmt, (void const *)c->ltab, __len); c->lpt_drty_flgs = c->lpt_drty_flgs & -4; out: ldv_mutex_unlock_672(& c->lp_mutex); return (err); } } static void free_obsolete_cnodes(struct ubifs_info *c ) { struct ubifs_cnode *cnode ; struct ubifs_cnode *cnext ; int tmp ; { cnext = c->lpt_cnext; if ((unsigned long )cnext == (unsigned long )((struct ubifs_cnode *)0)) { return; } else { } ldv_27978: cnode = cnext; cnext = cnode->cnext; tmp = constant_test_bit(1U, (unsigned long const volatile *)(& cnode->flags)); if (tmp != 0) { kfree((void const *)cnode); } else { cnode->cnext = 0; } if ((unsigned long )c->lpt_cnext != (unsigned long )cnext) { goto ldv_27978; } else { } c->lpt_cnext = 0; return; } } int ubifs_lpt_end_commit(struct ubifs_info *c ) { int err ; struct _ddebug descriptor ; struct task_struct *tmp ; long tmp___0 ; { descriptor.modname = "ubifs"; descriptor.function = "ubifs_lpt_end_commit"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): \n"; descriptor.lineno = 1447U; descriptor.flags = 0U; tmp___0 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___0 != 0L) { tmp = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): \n", tmp->pid); } else { } if ((unsigned long )c->lpt_cnext == (unsigned long )((struct ubifs_cnode *)0)) { return (0); } else { } err = write_cnodes(c); if (err != 0) { return (err); } else { } ldv_mutex_lock_673(& c->lp_mutex); free_obsolete_cnodes(c); ldv_mutex_unlock_674(& c->lp_mutex); return (0); } } int ubifs_lpt_post_commit(struct ubifs_info *c ) { int err ; int tmp ; { ldv_mutex_lock_675(& c->lp_mutex); err = lpt_tgc_end(c); if (err != 0) { goto out; } else { } if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { goto ldv_27992; ldv_27991: ldv_mutex_unlock_676(& c->lp_mutex); err = lpt_gc(c); if (err != 0) { return (err); } else { } ldv_mutex_lock_677(& c->lp_mutex); ldv_27992: tmp = need_write_all(c); if (tmp != 0) { goto ldv_27991; } else { } } else { } out: ldv_mutex_unlock_678(& c->lp_mutex); return (err); } } static struct ubifs_nnode *first_nnode(struct ubifs_info *c , int *hght ) { struct ubifs_nnode *nnode ; int h ; int i ; int found ; { nnode = c->nroot; *hght = 0; if ((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) { return (0); } else { } h = 1; goto ldv_28007; ldv_28006: found = 0; i = 0; goto ldv_28004; ldv_28003: ; if ((unsigned long )nnode->nbranch[i].ldv_26015.nnode != (unsigned long )((struct ubifs_nnode *)0)) { found = 1; nnode = nnode->nbranch[i].ldv_26015.nnode; *hght = h; goto ldv_28002; } else { } i = i + 1; ldv_28004: ; if (i <= 3) { goto ldv_28003; } else { } ldv_28002: ; if (found == 0) { goto ldv_28005; } else { } h = h + 1; ldv_28007: ; if (c->lpt_hght > h) { goto ldv_28006; } else { } ldv_28005: ; return (nnode); } } static struct ubifs_nnode *next_nnode(struct ubifs_info *c , struct ubifs_nnode *nnode , int *hght ) { struct ubifs_nnode *parent ; int iip ; int h ; int i ; int found ; { parent = nnode->parent; if ((unsigned long )parent == (unsigned long )((struct ubifs_nnode *)0)) { return (0); } else { } if (nnode->iip == 3) { *hght = *hght + -1; return (parent); } else { } iip = nnode->iip + 1; goto ldv_28020; ldv_28019: nnode = parent->nbranch[iip].ldv_26015.nnode; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { goto ldv_28018; } else { } iip = iip + 1; ldv_28020: ; if (iip <= 3) { goto ldv_28019; } else { } ldv_28018: ; if ((unsigned long )nnode == (unsigned long )((struct ubifs_nnode *)0)) { *hght = *hght + -1; return (parent); } else { } h = *hght + 1; goto ldv_28026; ldv_28025: found = 0; i = 0; goto ldv_28023; ldv_28022: ; if ((unsigned long )nnode->nbranch[i].ldv_26015.nnode != (unsigned long )((struct ubifs_nnode *)0)) { found = 1; nnode = nnode->nbranch[i].ldv_26015.nnode; *hght = h; goto ldv_28021; } else { } i = i + 1; ldv_28023: ; if (i <= 3) { goto ldv_28022; } else { } ldv_28021: ; if (found == 0) { goto ldv_28024; } else { } h = h + 1; ldv_28026: ; if (c->lpt_hght > h) { goto ldv_28025; } else { } ldv_28024: ; return (nnode); } } void ubifs_lpt_free(struct ubifs_info *c , int wr_only ) { struct ubifs_nnode *nnode ; int i ; int hght ; { free_obsolete_cnodes(c); vfree((void const *)c->ltab_cmt); c->ltab_cmt = 0; vfree((void const *)c->lpt_buf); c->lpt_buf = 0; kfree((void const *)c->lsave); c->lsave = 0; if (wr_only != 0) { return; } else { } nnode = first_nnode(c, & hght); goto ldv_28038; ldv_28037: i = 0; goto ldv_28035; ldv_28034: kfree((void const *)nnode->nbranch[i].ldv_26015.nnode); i = i + 1; ldv_28035: ; if (i <= 3) { goto ldv_28034; } else { } nnode = next_nnode(c, nnode, & hght); ldv_28038: ; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { goto ldv_28037; } else { } i = 0; goto ldv_28041; ldv_28040: kfree((void const *)c->lpt_heap[i].arr); i = i + 1; ldv_28041: ; if (i <= 2) { goto ldv_28040; } else { } kfree((void const *)c->dirty_idx.arr); kfree((void const *)c->nroot); vfree((void const *)c->ltab); kfree((void const *)c->lpt_nod_buf); return; } } static int dbg_is_all_ff(uint8_t *buf , int len ) { int i ; { i = 0; goto ldv_28049; ldv_28048: ; if ((unsigned int )*(buf + (unsigned long )i) != 255U) { return (0); } else { } i = i + 1; ldv_28049: ; if (i < len) { goto ldv_28048; } else { } return (1); } } static int dbg_is_nnode_dirty(struct ubifs_info *c , int lnum , int offs ) { struct ubifs_nnode *nnode ; int hght ; struct ubifs_nbranch *branch ; int tmp ; int tmp___0 ; { nnode = first_nnode(c, & hght); goto ldv_28062; ldv_28061: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared", 1646, 0); _cond_resched(); if ((unsigned long )nnode->parent != (unsigned long )((struct ubifs_nnode *)0)) { branch = (struct ubifs_nbranch *)(& (nnode->parent)->nbranch) + (unsigned long )nnode->iip; if (branch->lnum != lnum || branch->offs != offs) { goto ldv_28060; } else { } tmp = constant_test_bit(0U, (unsigned long const volatile *)(& nnode->flags)); if (tmp != 0) { return (1); } else { } return (0); } else { if (c->lpt_lnum != lnum || c->lpt_offs != offs) { goto ldv_28060; } else { } tmp___0 = constant_test_bit(0U, (unsigned long const volatile *)(& nnode->flags)); if (tmp___0 != 0) { return (1); } else { } return (0); } ldv_28060: nnode = next_nnode(c, nnode, & hght); ldv_28062: ; if ((unsigned long )nnode != (unsigned long )((struct ubifs_nnode *)0)) { goto ldv_28061; } else { } return (1); } } static int dbg_is_pnode_dirty(struct ubifs_info *c , int lnum , int offs ) { int i ; int cnt ; struct ubifs_pnode *pnode ; struct ubifs_nbranch *branch ; long tmp ; long tmp___0 ; int tmp___1 ; { cnt = (c->main_lebs + 3) / 4; i = 0; goto ldv_28076; ldv_28075: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared", 1680, 0); _cond_resched(); pnode = pnode_lookup(c, i); tmp___0 = IS_ERR((void const *)pnode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)pnode); return ((int )tmp); } else { } branch = (struct ubifs_nbranch *)(& (pnode->parent)->nbranch) + (unsigned long )pnode->iip; if (branch->lnum != lnum || branch->offs != offs) { goto ldv_28074; } else { } tmp___1 = constant_test_bit(0U, (unsigned long const volatile *)(& pnode->flags)); if (tmp___1 != 0) { return (1); } else { } return (0); ldv_28074: i = i + 1; ldv_28076: ; if (i < cnt) { goto ldv_28075; } else { } return (1); } } static int dbg_is_ltab_dirty(struct ubifs_info *c , int lnum , int offs ) { { if (c->ltab_lnum != lnum || c->ltab_offs != offs) { return (1); } else { } return (c->lpt_drty_flgs & 1); } } static int dbg_is_lsave_dirty(struct ubifs_info *c , int lnum , int offs ) { { if (c->lsave_lnum != lnum || c->lsave_offs != offs) { return (1); } else { } return ((c->lpt_drty_flgs & 2) != 0); } } static int dbg_is_node_dirty(struct ubifs_info *c , int node_type , int lnum , int offs ) { int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; { switch (node_type) { case 1: tmp = dbg_is_nnode_dirty(c, lnum, offs); return (tmp); case 0: tmp___0 = dbg_is_pnode_dirty(c, lnum, offs); return (tmp___0); case 2: tmp___1 = dbg_is_ltab_dirty(c, lnum, offs); return (tmp___1); case 3: tmp___2 = dbg_is_lsave_dirty(c, lnum, offs); return (tmp___2); } return (1); } } static int dbg_check_ltab_lnum(struct ubifs_info *c , int lnum ) { int err ; int len ; int dirty ; int node_type ; int node_num ; int node_len ; int ret ; void *buf ; void *p ; int tmp ; pgprot_t __constr_expr_0 ; struct task_struct *tmp___0 ; struct _ddebug descriptor ; struct task_struct *tmp___1 ; long tmp___2 ; int i ; int pad_len ; struct task_struct *tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; { len = c->leb_size; dirty = 0; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } __constr_expr_0.pgprot = 0x8000000000000163UL; p = __vmalloc((unsigned long )c->leb_size, 80U, __constr_expr_0); buf = p; if ((unsigned long )buf == (unsigned long )((void *)0)) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot allocate memory for ltab checking\n", tmp___0->pid, "dbg_check_ltab_lnum"); return (0); } else { } descriptor.modname = "ubifs"; descriptor.function = "dbg_check_ltab_lnum"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): LEB %d\n"; descriptor.lineno = 1766U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): LEB %d\n", tmp___1->pid, lnum); } else { } err = ubifs_leb_read((struct ubifs_info const *)c, lnum, buf, 0, c->leb_size, 1); if (err != 0) { goto out; } else { } ldv_28118: tmp___7 = is_a_node((struct ubifs_info const *)c, (uint8_t *)p, len); if (tmp___7 == 0) { pad_len = get_pad_len((struct ubifs_info const *)c, (uint8_t *)p, len); if (pad_len != 0) { p = p + (unsigned long )pad_len; len = len - pad_len; dirty = dirty + pad_len; goto ldv_28117; } else { } tmp___4 = dbg_is_all_ff((uint8_t *)p, len); if (tmp___4 == 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: invalid empty space in LEB %d at %d\n", tmp___3->pid, "dbg_check_ltab_lnum", lnum, c->leb_size - len); err = -22; } else { } i = lnum - c->lpt_first; if ((c->ltab + (unsigned long )i)->free != len) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: invalid free space in LEB %d (free %d, expected %d)\n", tmp___5->pid, "dbg_check_ltab_lnum", lnum, len, (c->ltab + (unsigned long )i)->free); err = -22; } else { } if ((c->ltab + (unsigned long )i)->dirty != dirty) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: invalid dirty space in LEB %d (dirty %d, expected %d)\n", tmp___6->pid, "dbg_check_ltab_lnum", lnum, dirty, (c->ltab + (unsigned long )i)->dirty); err = -22; } else { } goto out; } else { } node_type = get_lpt_node_type((struct ubifs_info const *)c, (uint8_t *)p, & node_num); node_len = get_lpt_node_len((struct ubifs_info const *)c, node_type); ret = dbg_is_node_dirty(c, node_type, lnum, c->leb_size - len); if (ret == 1) { dirty = dirty + node_len; } else { } p = p + (unsigned long )node_len; len = len - node_len; ldv_28117: ; goto ldv_28118; err = 0; out: vfree((void const *)buf); return (err); } } int dbg_check_ltab(struct ubifs_info *c ) { int lnum ; int err ; int i ; int cnt ; int tmp ; struct ubifs_pnode *pnode ; long tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; struct _ddebug descriptor ; struct task_struct *tmp___3 ; long tmp___4 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } cnt = (c->main_lebs + 3) / 4; i = 0; goto ldv_28129; ldv_28128: pnode = pnode_lookup(c, i); tmp___1 = IS_ERR((void const *)pnode); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)pnode); return ((int )tmp___0); } else { } __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared", 1837, 0); _cond_resched(); i = i + 1; ldv_28129: ; if (i < cnt) { goto ldv_28128; } else { } err = dbg_check_lpt_nodes(c, (struct ubifs_cnode *)c->nroot, 0, 0); if (err != 0) { return (err); } else { } lnum = c->lpt_first; goto ldv_28133; ldv_28132: err = dbg_check_ltab_lnum(c, lnum); if (err != 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: failed at LEB %d\n", tmp___2->pid, "dbg_check_ltab", lnum); return (err); } else { } lnum = lnum + 1; ldv_28133: ; if (c->lpt_last >= lnum) { goto ldv_28132; } else { } descriptor.modname = "ubifs"; descriptor.function = "dbg_check_ltab"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/lpt_commit.c.prepared"; descriptor.format = "UBIFS DBG lp (pid %d): succeeded\n"; descriptor.lineno = 1854U; descriptor.flags = 0U; tmp___4 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___4 != 0L) { tmp___3 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG lp (pid %d): succeeded\n", tmp___3->pid); } else { } return (0); } } int dbg_chk_lpt_free_spc(struct ubifs_info *c ) { long long free ; int i ; int tmp ; struct task_struct *tmp___0 ; { free = 0LL; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } i = 0; goto ldv_28143; ldv_28142: ; if ((unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U || (unsigned int )*((unsigned char *)(c->ltab + (unsigned long )i) + 8UL) != 0U) { goto ldv_28141; } else { } if (c->lpt_first + i == c->nhead_lnum) { free = (long long )(c->leb_size - c->nhead_offs) + free; } else if ((c->ltab + (unsigned long )i)->free == c->leb_size) { free = (long long )c->leb_size + free; } else { } ldv_28141: i = i + 1; ldv_28143: ; if (c->lpt_lebs > i) { goto ldv_28142; } else { } if (c->lpt_sz > free) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT space error: free %lld lpt_sz %lld\n", tmp___0->pid, "dbg_chk_lpt_free_spc", free, c->lpt_sz); ubifs_dump_lpt_info(c); ubifs_dump_lpt_lebs((struct ubifs_info const *)c); dump_stack(); return (-22); } else { } return (0); } } int dbg_chk_lpt_sz(struct ubifs_info *c , int action , int len ) { struct ubifs_debug_info *d ; long long chk_lpt_sz ; long long lpt_sz ; int err ; int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; { d = c->dbg; err = 0; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } switch (action) { case 0: d->chk_lpt_sz = 0LL; d->chk_lpt_sz2 = 0LL; d->chk_lpt_lebs = 0; d->chk_lpt_wastage = 0LL; if (c->dirty_pn_cnt > c->pnode_cnt) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: dirty pnodes %d exceed max %d\n", tmp___0->pid, "dbg_chk_lpt_sz", c->dirty_pn_cnt, c->pnode_cnt); err = -22; } else { } if (c->dirty_nn_cnt > c->nnode_cnt) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: dirty nnodes %d exceed max %d\n", tmp___1->pid, "dbg_chk_lpt_sz", c->dirty_nn_cnt, c->nnode_cnt); err = -22; } else { } return (err); case 1: d->chk_lpt_sz = d->chk_lpt_sz + (long long )len; return (0); case 2: d->chk_lpt_sz = d->chk_lpt_sz + (long long )len; d->chk_lpt_wastage = d->chk_lpt_wastage + (long long )len; d->chk_lpt_lebs = d->chk_lpt_lebs + 1; return (0); case 3: chk_lpt_sz = (long long )c->leb_size; chk_lpt_sz = (long long )d->chk_lpt_lebs * chk_lpt_sz; chk_lpt_sz = (long long )(len - c->nhead_offs) + chk_lpt_sz; if (d->chk_lpt_sz != chk_lpt_sz) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT wrote %lld but space used was %lld\n", tmp___2->pid, "dbg_chk_lpt_sz", d->chk_lpt_sz, chk_lpt_sz); err = -22; } else { } if (d->chk_lpt_sz > c->lpt_sz) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT wrote %lld but lpt_sz is %lld\n", tmp___3->pid, "dbg_chk_lpt_sz", d->chk_lpt_sz, c->lpt_sz); err = -22; } else { } if (d->chk_lpt_sz2 != 0LL && d->chk_lpt_sz != d->chk_lpt_sz2) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT layout size %lld but wrote %lld\n", tmp___4->pid, "dbg_chk_lpt_sz", d->chk_lpt_sz, d->chk_lpt_sz2); err = -22; } else { } if (d->chk_lpt_sz2 != 0LL && d->new_nhead_offs != len) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT new nhead offs: expected %d was %d\n", tmp___5->pid, "dbg_chk_lpt_sz", d->new_nhead_offs, len); err = -22; } else { } lpt_sz = (long long )c->pnode_cnt * (long long )c->pnode_sz; lpt_sz = (long long )c->nnode_cnt * (long long )c->nnode_sz + lpt_sz; lpt_sz = (long long )c->ltab_sz + lpt_sz; if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { lpt_sz = (long long )c->lsave_sz + lpt_sz; } else { } if (d->chk_lpt_sz - d->chk_lpt_wastage > lpt_sz) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT chk_lpt_sz %lld + waste %lld exceeds %lld\n", tmp___6->pid, "dbg_chk_lpt_sz", d->chk_lpt_sz, d->chk_lpt_wastage, lpt_sz); err = -22; } else { } if (err != 0) { ubifs_dump_lpt_info(c); ubifs_dump_lpt_lebs((struct ubifs_info const *)c); dump_stack(); } else { } d->chk_lpt_sz2 = d->chk_lpt_sz; d->chk_lpt_sz = 0LL; d->chk_lpt_wastage = 0LL; d->chk_lpt_lebs = 0; d->new_nhead_offs = len; return (err); case 4: d->chk_lpt_sz = d->chk_lpt_sz + (long long )len; d->chk_lpt_wastage = d->chk_lpt_wastage + (long long )len; return (0); default: ; return (-22); } } } static void dump_lpt_leb(struct ubifs_info const *c , int lnum ) { int err ; int len ; int node_type ; int node_num ; int node_len ; int offs ; void *buf ; void *p ; struct task_struct *tmp ; pgprot_t __constr_expr_0 ; struct task_struct *tmp___0 ; int pad_len ; int tmp___1 ; int i ; struct ubifs_nnode nnode ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; { len = c->leb_size; tmp = get_current(); printk("\v(pid %d) start dumping LEB %d\n", tmp->pid, lnum); __constr_expr_0.pgprot = 0x8000000000000163UL; p = __vmalloc((unsigned long )c->leb_size, 80U, __constr_expr_0); buf = p; if ((unsigned long )buf == (unsigned long )((void *)0)) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot allocate memory to dump LPT\n", tmp___0->pid, "dump_lpt_leb"); return; } else { } err = ubifs_leb_read(c, lnum, buf, 0, c->leb_size, 1); if (err != 0) { goto out; } else { } ldv_28191: offs = (int )c->leb_size - len; tmp___1 = is_a_node(c, (uint8_t *)p, len); if (tmp___1 == 0) { pad_len = get_pad_len(c, (uint8_t *)p, len); if (pad_len != 0) { printk("\vLEB %d:%d, pad %d bytes\n", lnum, offs, pad_len); p = p + (unsigned long )pad_len; len = len - pad_len; goto ldv_28178; } else { } if (len != 0) { printk("\vLEB %d:%d, free %d bytes\n", lnum, offs, len); } else { } goto ldv_28179; } else { } node_type = get_lpt_node_type(c, (uint8_t *)p, & node_num); switch (node_type) { case 0: node_len = c->pnode_sz; if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { printk("\vLEB %d:%d, pnode num %d\n", lnum, offs, node_num); } else { printk("\vLEB %d:%d, pnode\n", lnum, offs); } goto ldv_28181; case 1: node_len = c->nnode_sz; if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { printk("\vLEB %d:%d, nnode num %d, ", lnum, offs, node_num); } else { printk("\vLEB %d:%d, nnode, ", lnum, offs); } err = ubifs_unpack_nnode(c, p, & nnode); i = 0; goto ldv_28186; ldv_28185: printk("%d:%d", nnode.nbranch[i].lnum, nnode.nbranch[i].offs); if (i != 3) { printk(", "); } else { } i = i + 1; ldv_28186: ; if (i <= 3) { goto ldv_28185; } else { } printk("\n"); goto ldv_28181; case 2: node_len = c->ltab_sz; printk("\vLEB %d:%d, ltab\n", lnum, offs); goto ldv_28181; case 3: node_len = c->lsave_sz; printk("\vLEB %d:%d, lsave len\n", lnum, offs); goto ldv_28181; default: tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: LPT node type %d not recognized\n", tmp___2->pid, "dump_lpt_leb", node_type); goto out; } ldv_28181: p = p + (unsigned long )node_len; len = len - node_len; ldv_28178: ; goto ldv_28191; ldv_28179: tmp___3 = get_current(); printk("\v(pid %d) finish dumping LEB %d\n", tmp___3->pid, lnum); out: vfree((void const *)buf); return; } } void ubifs_dump_lpt_lebs(struct ubifs_info const *c ) { int i ; struct task_struct *tmp ; struct task_struct *tmp___0 ; { tmp = get_current(); printk("\v(pid %d) start dumping all LPT LEBs\n", tmp->pid); i = 0; goto ldv_28197; ldv_28196: dump_lpt_leb(c, (int )c->lpt_first + i); i = i + 1; ldv_28197: ; if ((int )c->lpt_lebs > i) { goto ldv_28196; } else { } tmp___0 = get_current(); printk("\v(pid %d) finish dumping all LPT LEBs\n", tmp___0->pid); return; } } static int dbg_populate_lsave(struct ubifs_info *c ) { struct ubifs_lprops *lprops ; struct ubifs_lpt_heap *heap ; int i ; int tmp ; u32 tmp___0 ; struct list_head const *__mptr ; u32 tmp___1 ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; u32 tmp___2 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; u32 tmp___3 ; struct list_head const *__mptr___4 ; u32 tmp___4 ; u32 tmp___5 ; u32 tmp___6 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } tmp___0 = prandom_u32(); if ((tmp___0 & 3U) != 0U) { return (0); } else { } i = 0; goto ldv_28206; ldv_28205: *(c->lsave + (unsigned long )i) = c->main_first; i = i + 1; ldv_28206: ; if (c->lsave_cnt > i) { goto ldv_28205; } else { } __mptr = (struct list_head const *)c->empty_list.next; lprops = (struct ubifs_lprops *)__mptr + 0xfffffffffffffff0UL; goto ldv_28213; ldv_28212: tmp___1 = prandom_u32(); *(c->lsave + (unsigned long )(tmp___1 % (u32 )c->lsave_cnt)) = lprops->lnum; __mptr___0 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___0 + 0xfffffffffffffff0UL; ldv_28213: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->empty_list)) { goto ldv_28212; } else { } __mptr___1 = (struct list_head const *)c->freeable_list.next; lprops = (struct ubifs_lprops *)__mptr___1 + 0xfffffffffffffff0UL; goto ldv_28220; ldv_28219: tmp___2 = prandom_u32(); *(c->lsave + (unsigned long )(tmp___2 % (u32 )c->lsave_cnt)) = lprops->lnum; __mptr___2 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___2 + 0xfffffffffffffff0UL; ldv_28220: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->freeable_list)) { goto ldv_28219; } else { } __mptr___3 = (struct list_head const *)c->frdi_idx_list.next; lprops = (struct ubifs_lprops *)__mptr___3 + 0xfffffffffffffff0UL; goto ldv_28227; ldv_28226: tmp___3 = prandom_u32(); *(c->lsave + (unsigned long )(tmp___3 % (u32 )c->lsave_cnt)) = lprops->lnum; __mptr___4 = (struct list_head const *)lprops->ldv_25977.list.next; lprops = (struct ubifs_lprops *)__mptr___4 + 0xfffffffffffffff0UL; ldv_28227: ; if ((unsigned long )(& lprops->ldv_25977.list) != (unsigned long )(& c->frdi_idx_list)) { goto ldv_28226; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 1UL; i = 0; goto ldv_28230; ldv_28229: tmp___4 = prandom_u32(); *(c->lsave + (unsigned long )(tmp___4 % (u32 )c->lsave_cnt)) = (*(heap->arr + (unsigned long )i))->lnum; i = i + 1; ldv_28230: ; if (heap->cnt > i) { goto ldv_28229; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap); i = 0; goto ldv_28233; ldv_28232: tmp___5 = prandom_u32(); *(c->lsave + (unsigned long )(tmp___5 % (u32 )c->lsave_cnt)) = (*(heap->arr + (unsigned long )i))->lnum; i = i + 1; ldv_28233: ; if (heap->cnt > i) { goto ldv_28232; } else { } heap = (struct ubifs_lpt_heap *)(& c->lpt_heap) + 2UL; i = 0; goto ldv_28236; ldv_28235: tmp___6 = prandom_u32(); *(c->lsave + (unsigned long )(tmp___6 % (u32 )c->lsave_cnt)) = (*(heap->arr + (unsigned long )i))->lnum; i = i + 1; ldv_28236: ; if (heap->cnt > i) { goto ldv_28235; } else { } return (1); } } void ldv_mutex_lock_657(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_658(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_659(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_660(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_661(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_662(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_663(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_664(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_665(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_666(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_667(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_668(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_669(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_670(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_671(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_672(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_673(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_674(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_675(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_676(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_677(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_678(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_705(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_702(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_704(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_706(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_708(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_701(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_703(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_707(struct mutex *ldv_func_arg1 ) ; struct ubifs_znode *ubifs_tnc_postorder_first(struct ubifs_znode *znode ) ; struct ubifs_znode *ubifs_tnc_postorder_next(struct ubifs_znode *znode ) ; __inline static struct ubifs_znode *ubifs_tnc_find_child(struct ubifs_znode *znode , int start ) { { goto ldv_27225; ldv_27224: ; if ((unsigned long )znode->zbranch[start].ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { return (znode->zbranch[start].ldv_26076.znode); } else { } start = start + 1; ldv_27225: ; if (znode->child_cnt > start) { goto ldv_27224; } else { } return (0); } } struct ubifs_znode *ubifs_tnc_levelorder_next(struct ubifs_znode *zr , struct ubifs_znode *znode ) { int level ; int iip ; int level_search ; struct ubifs_znode *zn ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct ubifs_znode *tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; { level_search = 0; tmp___0 = ldv__builtin_expect((unsigned long )zr == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_levelorder_next", 165, tmp->pid); dump_stack(); } else { } tmp___1 = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___1 != 0L) { return (zr); } else { } tmp___3 = ldv__builtin_expect((unsigned long )znode == (unsigned long )zr, 0L); if (tmp___3 != 0L) { if (znode->level == 0) { return (0); } else { } tmp___2 = ubifs_tnc_find_child(zr, 0); return (tmp___2); } else { } level = znode->level; iip = znode->iip; ldv_27502: tmp___5 = ldv__builtin_expect(znode->level > zr->level, 0L); if (tmp___5 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_levelorder_next", 180, tmp___4->pid); dump_stack(); } else { } goto ldv_27496; ldv_27495: znode = znode->parent; iip = znode->iip; ldv_27496: ; if ((unsigned long )znode->parent != (unsigned long )zr && (znode->parent)->child_cnt <= iip) { goto ldv_27495; } else { } tmp___8 = ldv__builtin_expect((unsigned long )znode->parent == (unsigned long )zr, 0L); if (tmp___8 != 0L) { tmp___9 = ldv__builtin_expect((znode->parent)->child_cnt <= iip, 0L); if (tmp___9 != 0L) { level = level + -1; if (level_search != 0 || level < 0) { return (0); } else { } level_search = 1; iip = -1; znode = ubifs_tnc_find_child(zr, 0); tmp___7 = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___7 != 0L) { tmp___6 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_levelorder_next", 207, tmp___6->pid); dump_stack(); } else { } } else { } } else { } zn = ubifs_tnc_find_child(znode->parent, iip + 1); if ((unsigned long )zn == (unsigned long )((struct ubifs_znode *)0)) { iip = (znode->parent)->child_cnt; goto ldv_27498; } else { } goto ldv_27501; ldv_27500: znode = zn; zn = ubifs_tnc_find_child(zn, 0); if ((unsigned long )zn == (unsigned long )((struct ubifs_znode *)0)) { iip = znode->iip; goto ldv_27499; } else { } ldv_27501: ; if (zn->level != level) { goto ldv_27500; } else { } ldv_27499: ; if ((unsigned long )zn != (unsigned long )((struct ubifs_znode *)0)) { tmp___11 = ldv__builtin_expect(zn->level < 0, 0L); if (tmp___11 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_levelorder_next", 233, tmp___10->pid); dump_stack(); } else { } return (zn); } else { } ldv_27498: ; goto ldv_27502; } } int ubifs_search_zbranch(struct ubifs_info const *c , struct ubifs_znode const *znode , union ubifs_key const *key , int *n ) { int beg ; int end ; int mid ; int cmp ; struct ubifs_zbranch const *zbr ; struct task_struct *tmp ; long tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; long tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; int tmp___6 ; long tmp___7 ; int tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; int tmp___11 ; long tmp___12 ; { beg = 0; end = znode->child_cnt; mid = mid; cmp = cmp; zbr = (struct ubifs_zbranch const *)(& znode->zbranch); tmp___0 = ldv__builtin_expect(end <= beg, 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_search_zbranch", 262, tmp->pid); dump_stack(); } else { } goto ldv_27516; ldv_27515: mid = (beg + end) >> 1; cmp = keys_cmp(c, key, & (zbr + (unsigned long )mid)->key); if (cmp > 0) { beg = mid + 1; } else if (cmp < 0) { end = mid; } else { *n = mid; return (1); } ldv_27516: ; if (end > beg) { goto ldv_27515; } else { } *n = end + -1; tmp___2 = ldv__builtin_expect(*n < -1, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_search_zbranch", 280, tmp___1->pid); dump_stack(); } else { tmp___3 = ldv__builtin_expect(*n >= (int )znode->child_cnt, 0L); if (tmp___3 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_search_zbranch", 280, tmp___1->pid); dump_stack(); } else { } } if (*n == -1) { tmp___8 = keys_cmp(c, key, & zbr->key); tmp___9 = ldv__builtin_expect(tmp___8 >= 0, 0L); if (tmp___9 != 0L) { tmp___4 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_search_zbranch", 282, tmp___4->pid); dump_stack(); } else { tmp___6 = keys_cmp(c, key, & (zbr + (unsigned long )*n)->key); tmp___7 = ldv__builtin_expect(tmp___6 <= 0, 0L); if (tmp___7 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_search_zbranch", 284, tmp___5->pid); dump_stack(); } else { } } } else { } if (*n + 1 < (int )znode->child_cnt) { tmp___11 = keys_cmp(c, key, & (zbr + ((unsigned long )*n + 1UL))->key); tmp___12 = ldv__builtin_expect(tmp___11 >= 0, 0L); if (tmp___12 != 0L) { tmp___10 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_search_zbranch", 286, tmp___10->pid); dump_stack(); } else { } } else { } return (0); } } struct ubifs_znode *ubifs_tnc_postorder_first(struct ubifs_znode *znode ) { long tmp ; struct ubifs_znode *child ; { tmp = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp != 0L) { return (0); } else { } goto ldv_27523; ldv_27522: child = ubifs_tnc_find_child(znode, 0); if ((unsigned long )child == (unsigned long )((struct ubifs_znode *)0)) { return (znode); } else { } znode = child; ldv_27523: ; if (znode->level > 0) { goto ldv_27522; } else { } return (znode); } } struct ubifs_znode *ubifs_tnc_postorder_next(struct ubifs_znode *znode ) { struct ubifs_znode *zn ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; struct ubifs_znode *tmp___2 ; { tmp___0 = ldv__builtin_expect((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_tnc_postorder_next", 326, tmp->pid); dump_stack(); } else { } tmp___1 = ldv__builtin_expect((unsigned long )znode->parent == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___1 != 0L) { return (0); } else { } zn = ubifs_tnc_find_child(znode->parent, znode->iip + 1); if ((unsigned long )zn == (unsigned long )((struct ubifs_znode *)0)) { return (znode->parent); } else { } tmp___2 = ubifs_tnc_postorder_first(zn); return (tmp___2); } } long ubifs_destroy_tnc_subtree(struct ubifs_znode *znode ) { struct ubifs_znode *zn ; struct ubifs_znode *tmp ; long clean_freed ; int n ; struct task_struct *tmp___0 ; long tmp___1 ; int tmp___2 ; int tmp___3 ; { tmp = ubifs_tnc_postorder_first(znode); zn = tmp; clean_freed = 0L; tmp___1 = ldv__builtin_expect((unsigned long )zn == (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_destroy_tnc_subtree", 353, tmp___0->pid); dump_stack(); } else { } ldv_27542: n = 0; goto ldv_27540; ldv_27539: ; if ((unsigned long )zn->zbranch[n].ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_27537; } else { } if (zn->level > 0) { tmp___2 = ubifs_zn_dirty((struct ubifs_znode const *)zn->zbranch[n].ldv_26076.znode); if (tmp___2 == 0) { clean_freed = clean_freed + 1L; } else { } } else { } __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_misc.c.prepared", 363, 0); _cond_resched(); kfree((void const *)zn->zbranch[n].ldv_26076.znode); ldv_27537: n = n + 1; ldv_27540: ; if (zn->child_cnt > n) { goto ldv_27539; } else { } if ((unsigned long )zn == (unsigned long )znode) { tmp___3 = ubifs_zn_dirty((struct ubifs_znode const *)zn); if (tmp___3 == 0) { clean_freed = clean_freed + 1L; } else { } kfree((void const *)zn); return (clean_freed); } else { } zn = ubifs_tnc_postorder_next(zn); goto ldv_27542; } } static int read_znode(struct ubifs_info *c , int lnum , int offs , int len , struct ubifs_znode *znode ) { int i ; int err ; int type ; int cmp ; struct ubifs_idx_node *idx ; void *tmp ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct ubifs_branch const *br ; struct ubifs_branch *tmp___4 ; struct ubifs_zbranch *zbr ; struct task_struct *tmp___5 ; int tmp___6 ; int tmp___7 ; struct task_struct *tmp___8 ; struct task_struct *tmp___9 ; struct task_struct *tmp___10 ; struct task_struct *tmp___11 ; struct task_struct *tmp___12 ; union ubifs_key const *key1 ; union ubifs_key const *key2 ; struct task_struct *tmp___13 ; struct task_struct *tmp___14 ; int tmp___15 ; struct task_struct *tmp___16 ; { tmp = kmalloc((size_t )c->max_idx_node_sz, 80U); idx = (struct ubifs_idx_node *)tmp; if ((unsigned long )idx == (unsigned long )((struct ubifs_idx_node *)0)) { return (-12); } else { } err = ubifs_read_node((struct ubifs_info const *)c, (void *)idx, 9, len, lnum, offs); if (err < 0) { kfree((void const *)idx); return (err); } else { } znode->child_cnt = (int )idx->child_cnt; znode->level = (int )idx->level; descriptor.modname = "ubifs"; descriptor.function = "read_znode"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_misc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): LEB %d:%d, level %d, %d branch\n"; descriptor.lineno = 412U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): LEB %d:%d, level %d, %d branch\n", tmp___0->pid, lnum, offs, znode->level, znode->child_cnt); } else { } if (znode->child_cnt > c->fanout || znode->level > 512) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: current fanout %d, branch count %d\n", tmp___2->pid, "read_znode", c->fanout, znode->child_cnt); tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: max levels %d, znode level %d\n", tmp___3->pid, "read_znode", 512, znode->level); err = 1; goto out_dump; } else { } i = 0; goto ldv_27568; ldv_27567: tmp___4 = ubifs_idx_branch((struct ubifs_info const *)c, (struct ubifs_idx_node const *)idx, i); br = (struct ubifs_branch const *)tmp___4; zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )i; key_read((struct ubifs_info const *)c, (void const *)(& br->key), & zbr->key); zbr->lnum = (int )br->lnum; zbr->offs = (int )br->offs; zbr->len = (int )br->len; zbr->ldv_26076.znode = 0; if ((((zbr->lnum < c->main_first || zbr->lnum >= c->leb_cnt) || zbr->offs < 0) || zbr->offs + zbr->len > c->leb_size) || (zbr->offs & 7) != 0) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: bad branch %d\n", tmp___5->pid, "read_znode", i); err = 2; goto out_dump; } else { } tmp___6 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); switch (tmp___6) { case 0: ; case 1: ; case 2: ; case 3: ; goto ldv_27564; default: tmp___7 = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: bad key type at slot %d: %d\n", tmp___8->pid, "read_znode", i, tmp___7); err = 3; goto out_dump; } ldv_27564: ; if (znode->level != 0) { goto ldv_27566; } else { } type = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); if (c->ranges[type].max_len == 0) { if (zbr->len != c->ranges[type].ldv_26105.len) { tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: bad target node (type %d) length (%d)\n", tmp___9->pid, "read_znode", type, zbr->len); tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: have to be %d\n", tmp___10->pid, "read_znode", c->ranges[type].ldv_26105.len); err = 4; goto out_dump; } else if (zbr->len < c->ranges[type].ldv_26105.min_len || zbr->len > c->ranges[type].max_len) { tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: bad target node (type %d) length (%d)\n", tmp___11->pid, "read_znode", type, zbr->len); tmp___12 = get_current(); printk("\vUBIFS error (pid %d): %s: have to be in range of %d-%d\n", tmp___12->pid, "read_znode", c->ranges[type].ldv_26105.min_len, c->ranges[type].max_len); err = 5; goto out_dump; } else { } } else { } ldv_27566: i = i + 1; ldv_27568: ; if (znode->child_cnt > i) { goto ldv_27567; } else { } i = 0; goto ldv_27573; ldv_27572: key1 = (union ubifs_key const *)(& znode->zbranch[i].key); key2 = (union ubifs_key const *)(& znode->zbranch[i + 1].key); cmp = keys_cmp((struct ubifs_info const *)c, key1, key2); if (cmp > 0) { tmp___13 = get_current(); printk("\vUBIFS error (pid %d): %s: bad key order (keys %d and %d)\n", tmp___13->pid, "read_znode", i, i + 1); err = 6; goto out_dump; } else if (cmp == 0) { tmp___15 = is_hash_key((struct ubifs_info const *)c, key1); if (tmp___15 == 0) { tmp___14 = get_current(); printk("\vUBIFS error (pid %d): %s: keys %d and %d are not hashed but equivalent\n", tmp___14->pid, "read_znode", i, i + 1); err = 7; goto out_dump; } else { } } else { } i = i + 1; ldv_27573: ; if (znode->child_cnt + -1 > i) { goto ldv_27572; } else { } kfree((void const *)idx); return (0); out_dump: tmp___16 = get_current(); printk("\vUBIFS error (pid %d): %s: bad indexing node at LEB %d:%d, error %d\n", tmp___16->pid, "read_znode", lnum, offs, err); ubifs_dump_node((struct ubifs_info const *)c, (void const *)idx); kfree((void const *)idx); return (-22); } } struct ubifs_znode *ubifs_load_znode(struct ubifs_info *c , struct ubifs_zbranch *zbr , struct ubifs_znode *parent , int iip ) { int err ; struct ubifs_znode *znode ; struct task_struct *tmp ; long tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; { tmp___0 = ldv__builtin_expect((unsigned long )zbr->ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0), 0L); if (tmp___0 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_load_znode", 532, tmp->pid); dump_stack(); } else { } tmp___1 = kzalloc((size_t )c->max_znode_sz, 80U); znode = (struct ubifs_znode *)tmp___1; if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { tmp___2 = ERR_PTR(-12L); return ((struct ubifs_znode *)tmp___2); } else { } err = read_znode(c, zbr->lnum, zbr->offs, zbr->len, znode); if (err != 0) { goto out; } else { } atomic_long_inc(& c->clean_zn_cnt); atomic_long_inc(& ubifs_clean_zn_cnt); zbr->ldv_26076.znode = znode; znode->parent = parent; znode->time = get_seconds(); znode->iip = iip; return (znode); out: kfree((void const *)znode); tmp___3 = ERR_PTR((long )err); return ((struct ubifs_znode *)tmp___3); } } int ubifs_tnc_read_node(struct ubifs_info *c , struct ubifs_zbranch *zbr , void *node ) { union ubifs_key key1 ; union ubifs_key *key ; int err ; int type ; int tmp ; struct ubifs_wbuf *wbuf ; char __tmp_key_buf[48U] ; struct _ddebug descriptor ; char const *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; char __tmp_key_buf___0[48U] ; struct _ddebug descriptor___0 ; char const *tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; char __tmp_key_buf___1[48U] ; struct _ddebug descriptor___1 ; char const *tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; int tmp___10 ; { key = & zbr->key; tmp = key_type((struct ubifs_info const *)c, (union ubifs_key const *)key); type = tmp; wbuf = ubifs_get_wbuf(c, zbr->lnum); if ((unsigned long )wbuf != (unsigned long )((struct ubifs_wbuf *)0)) { err = ubifs_read_node_wbuf(wbuf, node, type, zbr->len, zbr->lnum, zbr->offs); } else { err = ubifs_read_node((struct ubifs_info const *)c, node, type, zbr->len, zbr->lnum, zbr->offs); } if (err != 0) { descriptor.modname = "ubifs"; descriptor.function = "ubifs_tnc_read_node"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_misc.c.prepared"; descriptor.format = "UBIFS DBG tnc (pid %d): key %s\n"; descriptor.lineno = 597U; descriptor.flags = 0U; tmp___2 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___2 != 0L) { tmp___0 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf), 48); tmp___1 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG tnc (pid %d): key %s\n", tmp___1->pid, tmp___0); } else { } return (err); } else { } key_read((struct ubifs_info const *)c, (void const *)node + 24U, & key1); tmp___10 = keys_eq((struct ubifs_info const *)c, (union ubifs_key const *)key, (union ubifs_key const *)(& key1)); if (tmp___10 == 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: bad key in node at LEB %d:%d\n", tmp___3->pid, "ubifs_tnc_read_node", zbr->lnum, zbr->offs); descriptor___0.modname = "ubifs"; descriptor___0.function = "ubifs_tnc_read_node"; descriptor___0.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_misc.c.prepared"; descriptor___0.format = "UBIFS DBG tnc (pid %d): looked for key %s\n"; descriptor___0.lineno = 606U; descriptor___0.flags = 0U; tmp___6 = ldv__builtin_expect((long )descriptor___0.flags & 1L, 0L); if (tmp___6 != 0L) { tmp___4 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)key, (char *)(& __tmp_key_buf___0), 48); tmp___5 = get_current(); __dynamic_pr_debug(& descriptor___0, "UBIFS DBG tnc (pid %d): looked for key %s\n", tmp___5->pid, tmp___4); } else { } descriptor___1.modname = "ubifs"; descriptor___1.function = "ubifs_tnc_read_node"; descriptor___1.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/tnc_misc.c.prepared"; descriptor___1.format = "UBIFS DBG tnc (pid %d): but found node\'s key %s\n"; descriptor___1.lineno = 607U; descriptor___1.flags = 0U; tmp___9 = ldv__builtin_expect((long )descriptor___1.flags & 1L, 0L); if (tmp___9 != 0L) { tmp___7 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& key1), (char *)(& __tmp_key_buf___1), 48); tmp___8 = get_current(); __dynamic_pr_debug(& descriptor___1, "UBIFS DBG tnc (pid %d): but found node\'s key %s\n", tmp___8->pid, tmp___7); } else { } ubifs_dump_node((struct ubifs_info const *)c, (void const *)node); return (-22); } else { } return (0); } } void ldv_mutex_lock_701(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_702(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_703(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_704(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_705(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_706(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_707(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_708(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern int strncmp(char const * , char const * , __kernel_size_t ) ; void ldv_mutex_lock_nested_721(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_718(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_720(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_722(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_724(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_726(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_727(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_729(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_730(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_732(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_733(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_717(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_719(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_723(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_725(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_728(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_731(struct mutex *ldv_func_arg1 ) ; extern struct address_space_operations const empty_aops ; static struct inode_operations const empty_iops ; static struct file_operations const empty_fops ; static int create_xattr(struct ubifs_info *c , struct inode *host , struct qstr const *nm , void const *value , int size ) { int err ; struct inode *inode ; struct ubifs_inode *ui ; struct ubifs_inode *host_ui ; struct ubifs_inode *tmp ; struct ubifs_budget_req req ; long tmp___0 ; long tmp___1 ; loff_t tmp___2 ; { tmp = ubifs_inode((struct inode const *)host); host_ui = tmp; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = 1U; req.mod_dent = (unsigned char)0; req.new_ino = 1U; req.new_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )size) + 7U)) & 8184U; req.dirtied_ino = 1U; req.dirtied_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )host_ui->data_len) + 7U)) & 32760U; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; if (host_ui->xattr_cnt > 65534U) { return (-28); } else { } if (((host_ui->xattr_names + host_ui->xattr_cnt) + (unsigned int )nm->ldv_7607.ldv_7605.len) + 1U > 65536U) { return (-28); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } inode = ubifs_new_inode(c, (struct inode const *)host, 33279); tmp___1 = IS_ERR((void const *)inode); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)inode); err = (int )tmp___0; goto out_budg; } else { } (inode->i_mapping)->a_ops = & empty_aops; inode->i_op = & empty_iops; inode->i_fop = & empty_fops; inode->i_flags = inode->i_flags | 163U; ui = ubifs_inode((struct inode const *)inode); ui->xattr = 1U; ui->flags = ui->flags | 32; ui->data = kmemdup(value, (size_t )size, 80U); if ((unsigned long )ui->data == (unsigned long )((void *)0)) { err = -12; goto out_free; } else { } tmp___2 = (loff_t )size; ui->ui_size = tmp___2; inode->i_size = tmp___2; ui->data_len = size; ldv_mutex_lock_725(& host_ui->ui_mutex); host->i_ctime = ubifs_current_time(host); host_ui->xattr_cnt = host_ui->xattr_cnt + 1U; host_ui->xattr_size = host_ui->xattr_size + (((unsigned int )nm->ldv_7607.ldv_7605.len + 64U) & 4294967288U); host_ui->xattr_size = host_ui->xattr_size + (((unsigned int )size + 168U) & 4294967288U); host_ui->xattr_names = host_ui->xattr_names + (unsigned int )nm->ldv_7607.ldv_7605.len; err = ubifs_jnl_update(c, (struct inode const *)host, nm, (struct inode const *)inode, 0, 1); if (err != 0) { goto out_cancel; } else { } ldv_mutex_unlock_726(& host_ui->ui_mutex); ubifs_release_budget(c, & req); insert_inode_hash(inode); iput(inode); return (0); out_cancel: host_ui->xattr_cnt = host_ui->xattr_cnt - 1U; host_ui->xattr_size = host_ui->xattr_size - (((unsigned int )nm->ldv_7607.ldv_7605.len + 64U) & 4294967288U); host_ui->xattr_size = host_ui->xattr_size - (((unsigned int )size + 168U) & 4294967288U); ldv_mutex_unlock_727(& host_ui->ui_mutex); out_free: make_bad_inode(inode); iput(inode); out_budg: ubifs_release_budget(c, & req); return (err); } } static int change_xattr(struct ubifs_info *c , struct inode *host , struct inode *inode , void const *value , int size ) { int err ; struct ubifs_inode *host_ui ; struct ubifs_inode *tmp ; struct ubifs_inode *ui ; struct ubifs_inode *tmp___0 ; struct ubifs_budget_req req ; struct task_struct *tmp___1 ; long tmp___2 ; loff_t tmp___3 ; { tmp = ubifs_inode((struct inode const *)host); host_ui = tmp; tmp___0 = ubifs_inode((struct inode const *)inode); ui = tmp___0; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = (unsigned char)0; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 2U; req.dirtied_ino_d = (unsigned short )((((unsigned int )((unsigned short )size) + 7U) & 65528U) + (((unsigned int )((unsigned short )host_ui->data_len) + 7U) & 65528U)); req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; tmp___2 = ldv__builtin_expect((loff_t )ui->data_len != inode->i_size, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "change_xattr", 320, tmp___1->pid); dump_stack(); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } kfree((void const *)ui->data); ui->data = kmemdup(value, (size_t )size, 80U); if ((unsigned long )ui->data == (unsigned long )((void *)0)) { err = -12; goto out_free; } else { } tmp___3 = (loff_t )size; ui->ui_size = tmp___3; inode->i_size = tmp___3; ui->data_len = size; ldv_mutex_lock_728(& host_ui->ui_mutex); host->i_ctime = ubifs_current_time(host); host_ui->xattr_size = host_ui->xattr_size - (((unsigned int )ui->data_len + 168U) & 4294967288U); host_ui->xattr_size = host_ui->xattr_size + (((unsigned int )size + 168U) & 4294967288U); err = ubifs_jnl_change_xattr(c, (struct inode const *)inode, (struct inode const *)host); if (err != 0) { goto out_cancel; } else { } ldv_mutex_unlock_729(& host_ui->ui_mutex); ubifs_release_budget(c, & req); return (0); out_cancel: host_ui->xattr_size = host_ui->xattr_size - (((unsigned int )size + 168U) & 4294967288U); host_ui->xattr_size = host_ui->xattr_size + (((unsigned int )ui->data_len + 168U) & 4294967288U); ldv_mutex_unlock_730(& host_ui->ui_mutex); make_bad_inode(inode); out_free: ubifs_release_budget(c, & req); return (err); } } static int check_namespace(struct qstr const *nm ) { int type ; int tmp ; int tmp___0 ; int tmp___1 ; { if ((unsigned int )nm->ldv_7607.ldv_7605.len > 255U) { return (-36); } else { } tmp___1 = strncmp((char const *)nm->name, "trusted.", 8UL); if (tmp___1 == 0) { if ((unsigned int )((unsigned char )*(nm->name + 8UL)) == 0U) { return (-22); } else { } type = 1; } else { tmp___0 = strncmp((char const *)nm->name, "user.", 5UL); if (tmp___0 == 0) { if ((unsigned int )((unsigned char )*(nm->name + 5UL)) == 0U) { return (-22); } else { } type = 0; } else { tmp = strncmp((char const *)nm->name, "security.", 9UL); if (tmp == 0) { if ((unsigned int )((unsigned char )*(nm->name + 9UL)) == 0U) { return (-22); } else { } type = 2; } else { return (-95); } } } return (type); } } static struct inode *iget_xattr(struct ubifs_info *c , ino_t inum ) { struct inode *inode ; long tmp ; struct task_struct *tmp___0 ; long tmp___1 ; struct ubifs_inode *tmp___2 ; struct task_struct *tmp___3 ; void *tmp___4 ; { inode = ubifs_iget(c->vfs_sb, inum); tmp___1 = IS_ERR((void const *)inode); if (tmp___1 != 0L) { tmp = PTR_ERR((void const *)inode); tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: dead extended attribute entry, error %d\n", tmp___0->pid, "iget_xattr", (int )tmp); return (inode); } else { } tmp___2 = ubifs_inode((struct inode const *)inode); if ((unsigned int )*((unsigned char *)tmp___2 + 1060UL) != 0U) { return (inode); } else { } tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: corrupt extended attribute entry\n", tmp___3->pid, "iget_xattr"); iput(inode); tmp___4 = ERR_PTR(-22L); return ((struct inode *)tmp___4); } } int ubifs_setxattr(struct dentry *dentry , char const *name , void const *value , size_t size , int flags ) { struct inode *inode ; struct inode *host ; struct ubifs_info *c ; struct qstr nm ; size_t tmp ; struct ubifs_dent_node *xent ; union ubifs_key key ; int err ; int type ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; void *tmp___5 ; long tmp___6 ; long tmp___7 ; { host = dentry->d_inode; c = (struct ubifs_info *)(host->i_sb)->s_fs_info; tmp = strlen(name); nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = (unsigned int )tmp; nm.name = (unsigned char const *)name; descriptor.modname = "ubifs"; descriptor.function = "ubifs_setxattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/xattr.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): xattr \'%s\', host ino %lu (\'%.*s\'), size %zd\n"; descriptor.lineno = 427U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): xattr \'%s\', host ino %lu (\'%.*s\'), size %zd\n", tmp___0->pid, name, host->i_ino, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, size); } else { } tmp___3 = mutex_is_locked(& host->i_mutex); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_setxattr", 428, tmp___2->pid); dump_stack(); } else { } if (size > 4096UL) { return (-34); } else { } type = check_namespace((struct qstr const *)(& nm)); if (type < 0) { return (type); } else { } tmp___5 = kmalloc(312UL, 80U); xent = (struct ubifs_dent_node *)tmp___5; if ((unsigned long )xent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } xent_key_init((struct ubifs_info const *)c, & key, host->i_ino, (struct qstr const *)(& nm)); err = ubifs_tnc_lookup_nm(c, (union ubifs_key const *)(& key), (void *)xent, (struct qstr const *)(& nm)); if (err != 0) { if (err != -2) { goto out_free; } else { } if ((flags & 2) != 0) { err = -61; } else { err = create_xattr(c, host, (struct qstr const *)(& nm), value, (int )size); } goto out_free; } else { } if (flags & 1) { err = -17; goto out_free; } else { } inode = iget_xattr(c, (ino_t )xent->inum); tmp___7 = IS_ERR((void const *)inode); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)inode); err = (int )tmp___6; goto out_free; } else { } err = change_xattr(c, host, inode, value, (int )size); iput(inode); out_free: kfree((void const *)xent); return (err); } } ssize_t ubifs_getxattr(struct dentry *dentry , char const *name , void *buf , size_t size ) { struct inode *inode ; struct inode *host ; struct ubifs_info *c ; struct qstr nm ; size_t tmp ; struct ubifs_inode *ui ; struct ubifs_dent_node *xent ; union ubifs_key key ; int err ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; void *tmp___2 ; long tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; struct ubifs_inode *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; size_t __len ; void *__ret ; { host = dentry->d_inode; c = (struct ubifs_info *)(host->i_sb)->s_fs_info; tmp = strlen(name); nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = (unsigned int )tmp; nm.name = (unsigned char const *)name; descriptor.modname = "ubifs"; descriptor.function = "ubifs_getxattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/xattr.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): xattr \'%s\', ino %lu (\'%.*s\'), buf size %zd\n"; descriptor.lineno = 491U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): xattr \'%s\', ino %lu (\'%.*s\'), buf size %zd\n", tmp___0->pid, name, host->i_ino, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, size); } else { } err = check_namespace((struct qstr const *)(& nm)); if (err < 0) { return ((ssize_t )err); } else { } tmp___2 = kmalloc(312UL, 80U); xent = (struct ubifs_dent_node *)tmp___2; if ((unsigned long )xent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12L); } else { } xent_key_init((struct ubifs_info const *)c, & key, host->i_ino, (struct qstr const *)(& nm)); err = ubifs_tnc_lookup_nm(c, (union ubifs_key const *)(& key), (void *)xent, (struct qstr const *)(& nm)); if (err != 0) { if (err == -2) { err = -61; } else { } goto out_unlock; } else { } inode = iget_xattr(c, (ino_t )xent->inum); tmp___4 = IS_ERR((void const *)inode); if (tmp___4 != 0L) { tmp___3 = PTR_ERR((void const *)inode); err = (int )tmp___3; goto out_unlock; } else { } ui = ubifs_inode((struct inode const *)inode); tmp___6 = ldv__builtin_expect(inode->i_size != (loff_t )ui->data_len, 0L); if (tmp___6 != 0L) { tmp___5 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_getxattr", 516, tmp___5->pid); dump_stack(); } else { } tmp___8 = ubifs_inode((struct inode const *)host); tmp___9 = ldv__builtin_expect(tmp___8->xattr_size <= (unsigned int )ui->data_len, 0L); if (tmp___9 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_getxattr", 517, tmp___7->pid); dump_stack(); } else { } if ((unsigned long )buf != (unsigned long )((void *)0)) { if ((size_t )ui->data_len > size) { tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: buffer size %zd, xattr len %d\n", tmp___10->pid, "ubifs_getxattr", size, ui->data_len); err = -34; goto out_iput; } else { } __len = (size_t )ui->data_len; __ret = memcpy(buf, (void const *)ui->data, __len); } else { } err = ui->data_len; out_iput: iput(inode); out_unlock: kfree((void const *)xent); return ((ssize_t )err); } } ssize_t ubifs_listxattr(struct dentry *dentry , char *buffer , size_t size ) { union ubifs_key key ; struct inode *host ; struct ubifs_info *c ; struct ubifs_inode *host_ui ; struct ubifs_inode *tmp ; struct ubifs_dent_node *xent ; struct ubifs_dent_node *pxent ; int err ; int len ; int written ; struct qstr nm ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; int type ; long tmp___2 ; long tmp___3 ; long tmp___4 ; size_t __len ; void *__ret ; bool tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; long tmp___8 ; { host = dentry->d_inode; c = (struct ubifs_info *)(host->i_sb)->s_fs_info; tmp = ubifs_inode((struct inode const *)host); host_ui = tmp; pxent = 0; written = 0; nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = 0U; nm.name = 0; descriptor.modname = "ubifs"; descriptor.function = "ubifs_listxattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/xattr.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): ino %lu (\'%.*s\'), buffer size %zd\n"; descriptor.lineno = 550U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): ino %lu (\'%.*s\'), buffer size %zd\n", tmp___0->pid, host->i_ino, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name, size); } else { } len = (int )(host_ui->xattr_names + host_ui->xattr_cnt); if ((unsigned long )buffer == (unsigned long )((char *)0)) { return ((ssize_t )len); } else { } if ((size_t )len > size) { return (-34L); } else { } lowest_xent_key((struct ubifs_info const *)c, & key, host->i_ino); ldv_27889: xent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___3 = IS_ERR((void const *)xent); if (tmp___3 != 0L) { tmp___2 = PTR_ERR((void const *)xent); err = (int )tmp___2; goto ldv_27885; } else { } nm.name = (unsigned char const *)(& xent->name); nm.ldv_7607.ldv_7605.len = (u32 )xent->nlen; type = check_namespace((struct qstr const *)(& nm)); tmp___4 = ldv__builtin_expect(type < 0, 0L); if (tmp___4 != 0L) { err = type; goto ldv_27885; } else { } if (type != 1) { __len = (size_t )(nm.ldv_7607.ldv_7605.len + 1U); __ret = memcpy((void *)buffer + (unsigned long )written, (void const *)nm.name, __len); written = (int )((nm.ldv_7607.ldv_7605.len + (u32 )written) + 1U); } else { tmp___5 = capable(21); if ((int )tmp___5) { __len = (size_t )(nm.ldv_7607.ldv_7605.len + 1U); __ret = memcpy((void *)buffer + (unsigned long )written, (void const *)nm.name, __len); written = (int )((nm.ldv_7607.ldv_7605.len + (u32 )written) + 1U); } else { } } kfree((void const *)pxent); pxent = xent; key_read((struct ubifs_info const *)c, (void const *)(& xent->key), & key); goto ldv_27889; ldv_27885: kfree((void const *)pxent); if (err != -2) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot find next direntry, error %d\n", tmp___6->pid, "ubifs_listxattr", err); return ((ssize_t )err); } else { } tmp___8 = ldv__builtin_expect((size_t )written > size, 0L); if (tmp___8 != 0L) { tmp___7 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_listxattr", 599, tmp___7->pid); dump_stack(); } else { } return ((ssize_t )written); } } static int remove_xattr(struct ubifs_info *c , struct inode *host , struct inode *inode , struct qstr const *nm ) { int err ; struct ubifs_inode *host_ui ; struct ubifs_inode *tmp ; struct ubifs_inode *ui ; struct ubifs_inode *tmp___0 ; struct ubifs_budget_req req ; struct task_struct *tmp___1 ; long tmp___2 ; { tmp = ubifs_inode((struct inode const *)host); host_ui = tmp; tmp___0 = ubifs_inode((struct inode const *)inode); ui = tmp___0; req.fast = (unsigned char)0; req.recalculate = (unsigned char)0; req.new_page = (unsigned char)0; req.dirtied_page = (unsigned char)0; req.new_dent = (unsigned char)0; req.mod_dent = 1U; req.new_ino = (unsigned char)0; req.new_ino_d = (unsigned short)0; req.dirtied_ino = 2U; req.dirtied_ino_d = (unsigned int )((unsigned short )((unsigned int )((unsigned short )host_ui->data_len) + 7U)) & 32760U; req.idx_growth = 0; req.data_growth = 0; req.dd_growth = 0; tmp___2 = ldv__builtin_expect((loff_t )ui->data_len != inode->i_size, 0L); if (tmp___2 != 0L) { tmp___1 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "remove_xattr", 612, tmp___1->pid); dump_stack(); } else { } err = ubifs_budget_space(c, & req); if (err != 0) { return (err); } else { } ldv_mutex_lock_731(& host_ui->ui_mutex); host->i_ctime = ubifs_current_time(host); host_ui->xattr_cnt = host_ui->xattr_cnt - 1U; host_ui->xattr_size = host_ui->xattr_size - (((unsigned int )nm->ldv_7607.ldv_7605.len + 64U) & 4294967288U); host_ui->xattr_size = host_ui->xattr_size - (((unsigned int )ui->data_len + 168U) & 4294967288U); host_ui->xattr_names = host_ui->xattr_names - (unsigned int )nm->ldv_7607.ldv_7605.len; err = ubifs_jnl_delete_xattr(c, (struct inode const *)host, (struct inode const *)inode, nm); if (err != 0) { goto out_cancel; } else { } ldv_mutex_unlock_732(& host_ui->ui_mutex); ubifs_release_budget(c, & req); return (0); out_cancel: host_ui->xattr_cnt = host_ui->xattr_cnt + 1U; host_ui->xattr_size = host_ui->xattr_size + (((unsigned int )nm->ldv_7607.ldv_7605.len + 64U) & 4294967288U); host_ui->xattr_size = host_ui->xattr_size + (((unsigned int )ui->data_len + 168U) & 4294967288U); ldv_mutex_unlock_733(& host_ui->ui_mutex); ubifs_release_budget(c, & req); make_bad_inode(inode); return (err); } } int ubifs_removexattr(struct dentry *dentry , char const *name ) { struct inode *inode ; struct inode *host ; struct ubifs_info *c ; struct qstr nm ; size_t tmp ; struct ubifs_dent_node *xent ; union ubifs_key key ; int err ; struct _ddebug descriptor ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; int tmp___3 ; long tmp___4 ; void *tmp___5 ; long tmp___6 ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; { host = dentry->d_inode; c = (struct ubifs_info *)(host->i_sb)->s_fs_info; tmp = strlen(name); nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = (unsigned int )tmp; nm.name = (unsigned char const *)name; descriptor.modname = "ubifs"; descriptor.function = "ubifs_removexattr"; descriptor.filename = "/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/xattr.c.prepared"; descriptor.format = "UBIFS DBG gen (pid %d): xattr \'%s\', ino %lu (\'%.*s\')\n"; descriptor.lineno = 653U; descriptor.flags = 0U; tmp___1 = ldv__builtin_expect((long )descriptor.flags & 1L, 0L); if (tmp___1 != 0L) { tmp___0 = get_current(); __dynamic_pr_debug(& descriptor, "UBIFS DBG gen (pid %d): xattr \'%s\', ino %lu (\'%.*s\')\n", tmp___0->pid, name, host->i_ino, dentry->d_name.ldv_7607.ldv_7605.len, dentry->d_name.name); } else { } tmp___3 = mutex_is_locked(& host->i_mutex); tmp___4 = ldv__builtin_expect(tmp___3 == 0, 0L); if (tmp___4 != 0L) { tmp___2 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_removexattr", 654, tmp___2->pid); dump_stack(); } else { } err = check_namespace((struct qstr const *)(& nm)); if (err < 0) { return (err); } else { } tmp___5 = kmalloc(312UL, 80U); xent = (struct ubifs_dent_node *)tmp___5; if ((unsigned long )xent == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } xent_key_init((struct ubifs_info const *)c, & key, host->i_ino, (struct qstr const *)(& nm)); err = ubifs_tnc_lookup_nm(c, (union ubifs_key const *)(& key), (void *)xent, (struct qstr const *)(& nm)); if (err != 0) { if (err == -2) { err = -61; } else { } goto out_free; } else { } inode = iget_xattr(c, (ino_t )xent->inum); tmp___7 = IS_ERR((void const *)inode); if (tmp___7 != 0L) { tmp___6 = PTR_ERR((void const *)inode); err = (int )tmp___6; goto out_free; } else { } tmp___9 = ldv__builtin_expect((unsigned int )inode->ldv_13285.i_nlink != 1U, 0L); if (tmp___9 != 0L) { tmp___8 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_removexattr", 678, tmp___8->pid); dump_stack(); } else { } clear_nlink(inode); err = remove_xattr(c, host, inode, (struct qstr const *)(& nm)); if (err != 0) { set_nlink(inode, 1U); } else { } iput(inode); out_free: kfree((void const *)xent); return (err); } } void ldv_main25_sequence_infinite_withcheck_stateful(void) { int tmp ; int tmp___0 ; { LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_27935; ldv_27934: tmp = __VERIFIER_nondet_int(); switch (tmp) { default: ; goto ldv_27933; } ldv_27933: ; ldv_27935: tmp___0 = __VERIFIER_nondet_int(); if (tmp___0 != 0) { goto ldv_27934; } else { } ldv_check_final_state(); return; } } void ldv_mutex_lock_717(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_718(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_719(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_720(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_721(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_722(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_723(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_724(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_725(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_726(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_727(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_728(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_729(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_730(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_731(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_732(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_733(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } extern int snprintf(char * , size_t , char const * , ...) ; extern void warn_slowpath_fmt(char const * , int const , char const * , ...) ; __inline static long IS_ERR_OR_NULL(void const *ptr ) { long tmp ; int tmp___0 ; { if ((unsigned long )ptr == (unsigned long )((void const *)0)) { tmp___0 = 1; } else { tmp = ldv__builtin_expect((unsigned long )ptr > 0xfffffffffffff000UL, 0L); if (tmp != 0L) { tmp___0 = 1; } else { tmp___0 = 0; } } return ((long )tmp___0); } } void ldv_mutex_lock_nested_755(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) ; void ldv_mutex_unlock_752(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_754(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_756(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_758(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_760(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_762(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_763(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_unlock_765(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_751(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_753(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_757(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_759(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_761(struct mutex *ldv_func_arg1 ) ; void ldv_mutex_lock_764(struct mutex *ldv_func_arg1 ) ; extern unsigned long volatile jiffies ; extern unsigned long msecs_to_jiffies(unsigned int const ) ; extern struct inode *ilookup(struct super_block * , unsigned long ) ; extern loff_t no_llseek(struct file * , loff_t , int ) ; extern int nonseekable_open(struct inode * , struct file * ) ; extern ssize_t simple_read_from_buffer(void * , size_t , loff_t * , void const * , size_t ) ; extern struct dentry *debugfs_create_file(char const * , umode_t , struct dentry * , void * , struct file_operations const * ) ; extern struct dentry *debugfs_create_dir(char const * , struct dentry * ) ; extern void debugfs_remove_recursive(struct dentry * ) ; extern unsigned long _copy_from_user(void * , void const * , unsigned int ) ; __inline static unsigned long copy_from_user(void *to , void const *from , unsigned long n ) { int sz ; unsigned long tmp ; int __ret_warn_on ; long tmp___0 ; long tmp___1 ; long tmp___2 ; { tmp = __builtin_object_size((void const *)to, 0); sz = (int )tmp; might_fault(); tmp___1 = ldv__builtin_expect(sz == -1, 1L); if (tmp___1 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { tmp___2 = ldv__builtin_expect((unsigned long )sz >= n, 1L); if (tmp___2 != 0L) { n = _copy_from_user(to, from, (unsigned int )n); } else { __ret_warn_on = 1; tmp___0 = ldv__builtin_expect(__ret_warn_on != 0, 0L); if (tmp___0 != 0L) { warn_slowpath_fmt("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/inst/current/envs/linux-3.8-rc1/linux-3.8-rc1/arch/x86/include/asm/uaccess_64.h", 66, "Buffer overflow detected!\n"); } else { } ldv__builtin_expect(__ret_warn_on != 0, 0L); } } return (n); } } extern void prandom_bytes(void * , int ) ; struct ubifs_global_debug_info ubifs_dbg ; void ubifs_dump_budget_req(struct ubifs_budget_req const *req ) ; void ubifs_dump_lstats(struct ubifs_lp_stats const *lst ) ; void ubifs_dump_lprop(struct ubifs_info const *c , struct ubifs_lprops const *lp ) ; void ubifs_dump_sleb(struct ubifs_info const *c , struct ubifs_scan_leb const *sleb , int offs ) ; void ubifs_dump_tnc(struct ubifs_info *c ) ; void ubifs_dump_index(struct ubifs_info *c ) ; int dbg_debugfs_init(void) ; __inline static ino_t key_inum_flash(struct ubifs_info const *c , void const *k ) { union ubifs_key const *key ; { key = (union ubifs_key const *)k; return ((ino_t )key->j32[0]); } } __inline static unsigned int key_block_flash(struct ubifs_info const *c , void const *k ) { union ubifs_key const *key ; { key = (union ubifs_key const *)k; return (key->j32[1] & 536870911U); } } static spinlock_t dbg_lock = {{{{{0U}}, 3735899821U, 4294967295U, 0xffffffffffffffffUL, {0, {0, 0}, "dbg_lock", 0, 0UL}}}}; static char const *get_key_fmt(int fmt ) { { switch (fmt) { case 0: ; return ("simple"); default: ; return ("unknown/invalid format"); } } } static char const *get_key_hash(int hash ) { { switch (hash) { case 0: ; return ("R5"); case 1: ; return ("test"); default: ; return ("unknown/invalid name hash"); } } } static char const *get_key_type(int type ) { { switch (type) { case 0: ; return ("inode"); case 2: ; return ("direntry"); case 3: ; return ("xentry"); case 1: ; return ("data"); case 4: ; return ("truncate"); default: ; return ("unknown/invalid key"); } } } static char const *get_dent_type___0(int type ) { { switch (type) { case 0: ; return ("file"); case 1: ; return ("dir"); case 2: ; return ("symlink"); case 3: ; return ("blkdev"); case 4: ; return ("char dev"); case 5: ; return ("fifo"); case 6: ; return ("socket"); default: ; return ("unknown/invalid type"); } } } char const *dbg_snprintf_key(struct ubifs_info const *c , union ubifs_key const *key , char *buffer , int len ) { char *p ; int type ; int tmp ; char const *tmp___0 ; ino_t tmp___1 ; int tmp___2 ; uint32_t tmp___3 ; char const *tmp___4 ; ino_t tmp___5 ; int tmp___6 ; unsigned int tmp___7 ; char const *tmp___8 ; ino_t tmp___9 ; int tmp___10 ; char const *tmp___11 ; ino_t tmp___12 ; int tmp___13 ; int tmp___14 ; int tmp___15 ; struct task_struct *tmp___16 ; long tmp___17 ; { p = buffer; tmp = key_type(c, key); type = tmp; if ((int )c->key_fmt == 0) { switch (type) { case 0: tmp___0 = get_key_type(type); tmp___1 = key_inum(c, (void const *)key); tmp___2 = snprintf(p, (size_t )len, "(%lu, %s)", tmp___1, tmp___0); len = len - tmp___2; goto ldv_28738; case 2: ; case 3: tmp___3 = key_hash(c, key); tmp___4 = get_key_type(type); tmp___5 = key_inum(c, (void const *)key); tmp___6 = snprintf(p, (size_t )len, "(%lu, %s, %#08x)", tmp___5, tmp___4, tmp___3); len = len - tmp___6; goto ldv_28738; case 1: tmp___7 = key_block(c, key); tmp___8 = get_key_type(type); tmp___9 = key_inum(c, (void const *)key); tmp___10 = snprintf(p, (size_t )len, "(%lu, %s, %u)", tmp___9, tmp___8, tmp___7); len = len - tmp___10; goto ldv_28738; case 4: tmp___11 = get_key_type(type); tmp___12 = key_inum(c, (void const *)key); tmp___13 = snprintf(p, (size_t )len, "(%lu, %s)", tmp___12, tmp___11); len = len - tmp___13; goto ldv_28738; default: tmp___14 = snprintf(p, (size_t )len, "(bad key type: %#08x, %#08x)", key->u32[0], key->u32[1]); len = len - tmp___14; } ldv_28738: ; } else { tmp___15 = snprintf(p, (size_t )len, "bad key format %d", c->key_fmt); len = len - tmp___15; } tmp___17 = ldv__builtin_expect(len <= 0, 0L); if (tmp___17 != 0L) { tmp___16 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dbg_snprintf_key", 256, tmp___16->pid); dump_stack(); } else { } return ((char const *)p); } } char const *dbg_ntype(int type ) { { switch (type) { case 5: ; return ("padding node"); case 6: ; return ("superblock node"); case 7: ; return ("master node"); case 8: ; return ("reference node"); case 0: ; return ("inode node"); case 2: ; return ("direntry node"); case 3: ; return ("xentry node"); case 1: ; return ("data node"); case 4: ; return ("truncate node"); case 9: ; return ("indexing node"); case 10: ; return ("commit start node"); case 11: ; return ("orphan node"); default: ; return ("unknown node"); } } } static char const *dbg_gtype(int type ) { { switch (type) { case 0: ; return ("no node group"); case 1: ; return ("in node group"); case 2: ; return ("last of node group"); default: ; return ("unknown"); } } } char const *dbg_cstate(int cmt_state ) { { switch (cmt_state) { case 0: ; return ("commit resting"); case 1: ; return ("background commit requested"); case 2: ; return ("commit required"); case 3: ; return ("BACKGROUND commit running"); case 4: ; return ("commit running and required"); case 5: ; return ("broken commit"); default: ; return ("unknown commit state"); } } } char const *dbg_jhead(int jhead ) { { switch (jhead) { case 0: ; return ("0 (GC)"); case 1: ; return ("1 (base)"); case 2: ; return ("2 (data)"); default: ; return ("unknown journal head"); } } } static void dump_ch(struct ubifs_ch const *ch ) { char const *tmp ; char const *tmp___0 ; { printk("\v\tmagic %#x\n", ch->magic); printk("\v\tcrc %#x\n", ch->crc); tmp = dbg_ntype((int )ch->node_type); printk("\v\tnode_type %d (%s)\n", (int )ch->node_type, tmp); tmp___0 = dbg_gtype((int )ch->group_type); printk("\v\tgroup_type %d (%s)\n", (int )ch->group_type, tmp___0); printk("\v\tsqnum %llu\n", ch->sqnum); printk("\v\tlen %u\n", ch->len); return; } } void ubifs_dump_inode(struct ubifs_info *c , struct inode const *inode ) { struct ubifs_inode const *ui ; struct ubifs_inode *tmp ; struct qstr nm ; union ubifs_key key ; struct ubifs_dent_node *dent ; struct ubifs_dent_node *pdent ; int count ; loff_t tmp___0 ; uid_t tmp___1 ; gid_t tmp___2 ; struct task_struct *tmp___3 ; int tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; char const *tmp___9 ; int tmp___10 ; { tmp = ubifs_inode(inode); ui = (struct ubifs_inode const *)tmp; nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = 0U; nm.name = 0; pdent = 0; count = 2; printk("\vDump in-memory inode:"); printk("\v\tinode %lu\n", inode->i_ino); tmp___0 = i_size_read(inode); printk("\v\tsize %llu\n", (unsigned long long )tmp___0); printk("\v\tnlink %u\n", inode->ldv_13285.i_nlink); tmp___1 = i_uid_read(inode); printk("\v\tuid %u\n", tmp___1); tmp___2 = i_gid_read(inode); printk("\v\tgid %u\n", tmp___2); printk("\v\tatime %u.%u\n", (unsigned int )inode->i_atime.tv_sec, (unsigned int )inode->i_atime.tv_nsec); printk("\v\tmtime %u.%u\n", (unsigned int )inode->i_mtime.tv_sec, (unsigned int )inode->i_mtime.tv_nsec); printk("\v\tctime %u.%u\n", (unsigned int )inode->i_ctime.tv_sec, (unsigned int )inode->i_ctime.tv_nsec); printk("\v\tcreat_sqnum %llu\n", ui->creat_sqnum); printk("\v\txattr_size %u\n", ui->xattr_size); printk("\v\txattr_cnt %u\n", ui->xattr_cnt); printk("\v\txattr_names %u\n", ui->xattr_names); printk("\v\tdirty %u\n", (int )ui->dirty); printk("\v\txattr %u\n", (int )ui->xattr); printk("\v\tbulk_read %u\n", (int )ui->xattr); printk("\v\tsynced_i_size %llu\n", (unsigned long long )ui->synced_i_size); printk("\v\tui_size %llu\n", (unsigned long long )ui->ui_size); printk("\v\tflags %d\n", ui->flags); printk("\v\tcompr_type %d\n", (int )ui->compr_type); printk("\v\tlast_page_read %lu\n", ui->last_page_read); printk("\v\tread_in_a_row %lu\n", ui->read_in_a_row); printk("\v\tdata_len %d\n", ui->data_len); if (((int )inode->i_mode & 61440) != 16384) { return; } else { } printk("\vList of directory entries:\n"); tmp___4 = mutex_is_locked(& c->tnc_mutex); tmp___5 = ldv__builtin_expect(tmp___4 != 0, 0L); if (tmp___5 != 0L) { tmp___3 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "ubifs_dump_inode", 398, tmp___3->pid); dump_stack(); } else { } lowest_dent_key((struct ubifs_info const *)c, & key, inode->i_ino); ldv_28800: dent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___8 = IS_ERR((void const *)dent); if (tmp___8 != 0L) { tmp___7 = PTR_ERR((void const *)dent); if (tmp___7 != -2L) { tmp___6 = PTR_ERR((void const *)dent); printk("\verror %ld\n", tmp___6); } else { } goto ldv_28799; } else { } tmp___9 = get_dent_type___0((int )dent->type); tmp___10 = count; count = count + 1; printk("\v\t%d: %s (%s)\n", tmp___10, (__u8 *)(& dent->name), tmp___9); nm.name = (unsigned char const *)(& dent->name); nm.ldv_7607.ldv_7605.len = (u32 )dent->nlen; kfree((void const *)pdent); pdent = dent; key_read((struct ubifs_info const *)c, (void const *)(& dent->key), & key); goto ldv_28800; ldv_28799: kfree((void const *)pdent); return; } } void ubifs_dump_node(struct ubifs_info const *c , void const *node ) { int i ; int n ; union ubifs_key key ; struct ubifs_ch const *ch ; char key_buf[48U] ; struct ubifs_pad_node const *pad ; struct ubifs_sb_node const *sup ; unsigned int sup_flags ; char const *tmp ; char const *tmp___0 ; struct ubifs_mst_node const *mst ; struct ubifs_ref_node const *ref ; struct ubifs_ino_node const *ino ; char const *tmp___1 ; struct ubifs_dent_node const *dent ; int nlen ; char const *tmp___2 ; struct ubifs_data_node const *dn ; int dlen ; char const *tmp___3 ; struct ubifs_trun_node const *trun ; struct ubifs_idx_node const *idx ; struct ubifs_branch const *br ; struct ubifs_branch *tmp___4 ; char const *tmp___5 ; struct ubifs_orph_node const *orph ; { ch = (struct ubifs_ch const *)node; if ((unsigned int )ch->magic != 101718065U) { printk("\vNot a node, first %zu bytes:", 24UL); print_hex_dump("\v", "", 2, 32, 1, node, 24UL, 1); return; } else { } spin_lock(& dbg_lock); dump_ch((struct ubifs_ch const *)node); switch ((int )ch->node_type) { case 5: pad = (struct ubifs_pad_node const *)node; printk("\v\tpad_len %u\n", pad->pad_len); goto ldv_28812; case 6: sup = (struct ubifs_sb_node const *)node; sup_flags = sup->flags; tmp = get_key_hash((int )sup->key_hash); printk("\v\tkey_hash %d (%s)\n", (int )sup->key_hash, tmp); tmp___0 = get_key_fmt((int )sup->key_fmt); printk("\v\tkey_fmt %d (%s)\n", (int )sup->key_fmt, tmp___0); printk("\v\tflags %#x\n", sup_flags); printk("\v\t big_lpt %u\n", (sup_flags & 2U) != 0U); printk("\v\t space_fixup %u\n", (sup_flags & 4U) != 0U); printk("\v\tmin_io_size %u\n", sup->min_io_size); printk("\v\tleb_size %u\n", sup->leb_size); printk("\v\tleb_cnt %u\n", sup->leb_cnt); printk("\v\tmax_leb_cnt %u\n", sup->max_leb_cnt); printk("\v\tmax_bud_bytes %llu\n", sup->max_bud_bytes); printk("\v\tlog_lebs %u\n", sup->log_lebs); printk("\v\tlpt_lebs %u\n", sup->lpt_lebs); printk("\v\torph_lebs %u\n", sup->orph_lebs); printk("\v\tjhead_cnt %u\n", sup->jhead_cnt); printk("\v\tfanout %u\n", sup->fanout); printk("\v\tlsave_cnt %u\n", sup->lsave_cnt); printk("\v\tdefault_compr %u\n", (int )sup->default_compr); printk("\v\trp_size %llu\n", sup->rp_size); printk("\v\trp_uid %u\n", sup->rp_uid); printk("\v\trp_gid %u\n", sup->rp_gid); printk("\v\tfmt_version %u\n", sup->fmt_version); printk("\v\ttime_gran %u\n", sup->time_gran); printk("\v\tUUID %pUB\n", (__u8 const *)(& sup->uuid)); goto ldv_28812; case 7: mst = (struct ubifs_mst_node const *)node; printk("\v\thighest_inum %llu\n", mst->highest_inum); printk("\v\tcommit number %llu\n", mst->cmt_no); printk("\v\tflags %#x\n", mst->flags); printk("\v\tlog_lnum %u\n", mst->log_lnum); printk("\v\troot_lnum %u\n", mst->root_lnum); printk("\v\troot_offs %u\n", mst->root_offs); printk("\v\troot_len %u\n", mst->root_len); printk("\v\tgc_lnum %u\n", mst->gc_lnum); printk("\v\tihead_lnum %u\n", mst->ihead_lnum); printk("\v\tihead_offs %u\n", mst->ihead_offs); printk("\v\tindex_size %llu\n", mst->index_size); printk("\v\tlpt_lnum %u\n", mst->lpt_lnum); printk("\v\tlpt_offs %u\n", mst->lpt_offs); printk("\v\tnhead_lnum %u\n", mst->nhead_lnum); printk("\v\tnhead_offs %u\n", mst->nhead_offs); printk("\v\tltab_lnum %u\n", mst->ltab_lnum); printk("\v\tltab_offs %u\n", mst->ltab_offs); printk("\v\tlsave_lnum %u\n", mst->lsave_lnum); printk("\v\tlsave_offs %u\n", mst->lsave_offs); printk("\v\tlscan_lnum %u\n", mst->lscan_lnum); printk("\v\tleb_cnt %u\n", mst->leb_cnt); printk("\v\tempty_lebs %u\n", mst->empty_lebs); printk("\v\tidx_lebs %u\n", mst->idx_lebs); printk("\v\ttotal_free %llu\n", mst->total_free); printk("\v\ttotal_dirty %llu\n", mst->total_dirty); printk("\v\ttotal_used %llu\n", mst->total_used); printk("\v\ttotal_dead %llu\n", mst->total_dead); printk("\v\ttotal_dark %llu\n", mst->total_dark); goto ldv_28812; case 8: ref = (struct ubifs_ref_node const *)node; printk("\v\tlnum %u\n", ref->lnum); printk("\v\toffs %u\n", ref->offs); printk("\v\tjhead %u\n", ref->jhead); goto ldv_28812; case 0: ino = (struct ubifs_ino_node const *)node; key_read(c, (void const *)(& ino->key), & key); tmp___1 = dbg_snprintf_key(c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); printk("\v\tkey %s\n", tmp___1); printk("\v\tcreat_sqnum %llu\n", ino->creat_sqnum); printk("\v\tsize %llu\n", ino->size); printk("\v\tnlink %u\n", ino->nlink); printk("\v\tatime %lld.%u\n", (long long )ino->atime_sec, ino->atime_nsec); printk("\v\tmtime %lld.%u\n", (long long )ino->mtime_sec, ino->mtime_nsec); printk("\v\tctime %lld.%u\n", (long long )ino->ctime_sec, ino->ctime_nsec); printk("\v\tuid %u\n", ino->uid); printk("\v\tgid %u\n", ino->gid); printk("\v\tmode %u\n", ino->mode); printk("\v\tflags %#x\n", ino->flags); printk("\v\txattr_cnt %u\n", ino->xattr_cnt); printk("\v\txattr_size %u\n", ino->xattr_size); printk("\v\txattr_names %u\n", ino->xattr_names); printk("\v\tcompr_type %#x\n", (int )ino->compr_type); printk("\v\tdata len %u\n", ino->data_len); goto ldv_28812; case 2: ; case 3: dent = (struct ubifs_dent_node const *)node; nlen = (int )dent->nlen; key_read(c, (void const *)(& dent->key), & key); tmp___2 = dbg_snprintf_key(c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); printk("\v\tkey %s\n", tmp___2); printk("\v\tinum %llu\n", dent->inum); printk("\v\ttype %d\n", (int )dent->type); printk("\v\tnlen %d\n", nlen); printk("\v\tname "); if (nlen > 255) { printk("\v(bad name length, not printing, bad or corrupted node)"); } else { i = 0; goto ldv_28827; ldv_28826: printk("%c", (int )dent->name[i]); i = i + 1; ldv_28827: ; if (i < nlen && (unsigned int )dent->name[i] != 0U) { goto ldv_28826; } else { } } printk("\n"); goto ldv_28812; case 1: dn = (struct ubifs_data_node const *)node; dlen = (int )((unsigned int )ch->len - 48U); key_read(c, (void const *)(& dn->key), & key); tmp___3 = dbg_snprintf_key(c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); printk("\v\tkey %s\n", tmp___3); printk("\v\tsize %u\n", dn->size); printk("\v\tcompr_typ %d\n", (int )dn->compr_type); printk("\v\tdata size %d\n", dlen); printk("\v\tdata:\n"); print_hex_dump("\v", "\t", 2, 32, 1, (void const *)(& dn->data), (size_t )dlen, 0); goto ldv_28812; case 4: trun = (struct ubifs_trun_node const *)node; printk("\v\tinum %u\n", trun->inum); printk("\v\told_size %llu\n", trun->old_size); printk("\v\tnew_size %llu\n", trun->new_size); goto ldv_28812; case 9: idx = (struct ubifs_idx_node const *)node; n = (int )idx->child_cnt; printk("\v\tchild_cnt %d\n", n); printk("\v\tlevel %d\n", (int )idx->level); printk("\v\tBranches:\n"); i = 0; goto ldv_28838; ldv_28837: tmp___4 = ubifs_idx_branch(c, idx, i); br = (struct ubifs_branch const *)tmp___4; key_read(c, (void const *)(& br->key), & key); tmp___5 = dbg_snprintf_key(c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); printk("\v\t%d: LEB %d:%d len %d key %s\n", i, br->lnum, br->offs, br->len, tmp___5); i = i + 1; ldv_28838: ; if (i < n && (int )c->fanout + -1 > i) { goto ldv_28837; } else { } goto ldv_28812; case 10: ; goto ldv_28812; case 11: orph = (struct ubifs_orph_node const *)node; printk("\v\tcommit number %llu\n", (unsigned long long )orph->cmt_no & 9223372036854775807ULL); printk("\v\tlast node flag %llu\n", orph->cmt_no >> 63); n = (int )(((unsigned long )ch->len - 32UL) >> 3); printk("\v\t%d orphan inode numbers:\n", n); i = 0; goto ldv_28844; ldv_28843: printk("\v\t ino %llu\n", orph->inos[i]); i = i + 1; ldv_28844: ; if (i < n) { goto ldv_28843; } else { } goto ldv_28812; default: printk("\vnode type %d was not recognized\n", (int )ch->node_type); } ldv_28812: spin_unlock(& dbg_lock); return; } } void ubifs_dump_budget_req(struct ubifs_budget_req const *req ) { { spin_lock(& dbg_lock); printk("\vBudgeting request: new_ino %d, dirtied_ino %d\n", (int )req->new_ino, (int )req->dirtied_ino); printk("\v\tnew_ino_d %d, dirtied_ino_d %d\n", (int )req->new_ino_d, (int )req->dirtied_ino_d); printk("\v\tnew_page %d, dirtied_page %d\n", (int )req->new_page, (int )req->dirtied_page); printk("\v\tnew_dent %d, mod_dent %d\n", (int )req->new_dent, (int )req->mod_dent); printk("\v\tidx_growth %d\n", req->idx_growth); printk("\v\tdata_growth %d dd_growth %d\n", req->data_growth, req->dd_growth); spin_unlock(& dbg_lock); return; } } void ubifs_dump_lstats(struct ubifs_lp_stats const *lst ) { struct task_struct *tmp ; { spin_lock(& dbg_lock); tmp = get_current(); printk("\v(pid %d) Lprops statistics: empty_lebs %d, idx_lebs %d\n", tmp->pid, lst->empty_lebs, lst->idx_lebs); printk("\v\ttaken_empty_lebs %d, total_free %lld, total_dirty %lld\n", lst->taken_empty_lebs, lst->total_free, lst->total_dirty); printk("\v\ttotal_used %lld, total_dark %lld, total_dead %lld\n", lst->total_used, lst->total_dark, lst->total_dead); spin_unlock(& dbg_lock); return; } } void ubifs_dump_budg(struct ubifs_info *c , struct ubifs_budg_info const *bi ) { int i ; struct rb_node *rb ; struct ubifs_bud *bud ; struct ubifs_gced_idx_leb *idx_gc ; long long available ; long long outstanding ; long long free ; struct task_struct *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; char const *tmp___3 ; struct rb_node const *__mptr ; struct list_head const *__mptr___0 ; struct list_head const *__mptr___1 ; struct list_head const *__mptr___2 ; struct list_head const *__mptr___3 ; { spin_lock(& c->space_lock); spin_lock(& dbg_lock); tmp = get_current(); printk("\v(pid %d) Budgeting info: data budget sum %lld, total budget sum %lld\n", tmp->pid, (long long )bi->data_growth + (long long )bi->dd_growth, ((long long )bi->data_growth + (long long )bi->dd_growth) + (long long )bi->idx_growth); printk("\v\tbudg_data_growth %lld, budg_dd_growth %lld, budg_idx_growth %lld\n", bi->data_growth, bi->dd_growth, bi->idx_growth); printk("\v\tmin_idx_lebs %d, old_idx_sz %llu, uncommitted_idx %lld\n", bi->min_idx_lebs, bi->old_idx_sz, bi->uncommitted_idx); printk("\v\tpage_budget %d, inode_budget %d, dent_budget %d\n", bi->page_budget, bi->inode_budget, bi->dent_budget); printk("\v\tnospace %u, nospace_rp %u\n", (int )bi->nospace, (int )bi->nospace_rp); printk("\v\tdark_wm %d, dead_wm %d, max_idx_node_sz %d\n", c->dark_wm, c->dead_wm, c->max_idx_node_sz); if ((unsigned long )((struct ubifs_budg_info const *)(& c->bi)) != (unsigned long )bi) { goto out_unlock; } else { } printk("\v\tfreeable_cnt %d, calc_idx_sz %lld, idx_gc_cnt %d\n", c->freeable_cnt, c->calc_idx_sz, c->idx_gc_cnt); tmp___0 = atomic_long_read(& c->clean_zn_cnt); tmp___1 = atomic_long_read(& c->dirty_zn_cnt); tmp___2 = atomic_long_read(& c->dirty_pg_cnt); printk("\v\tdirty_pg_cnt %ld, dirty_zn_cnt %ld, clean_zn_cnt %ld\n", tmp___2, tmp___1, tmp___0); printk("\v\tgc_lnum %d, ihead_lnum %d\n", c->gc_lnum, c->ihead_lnum); if ((unsigned long )c->jheads != (unsigned long )((struct ubifs_jhead *)0)) { i = 0; goto ldv_28866; ldv_28865: tmp___3 = dbg_jhead((c->jheads + (unsigned long )i)->wbuf.jhead); printk("\v\tjhead %s\t LEB %d\n", tmp___3, (c->jheads + (unsigned long )i)->wbuf.lnum); i = i + 1; ldv_28866: ; if (c->jhead_cnt > i) { goto ldv_28865; } else { } } else { } rb = rb_first((struct rb_root const *)(& c->buds)); goto ldv_28871; ldv_28870: __mptr = (struct rb_node const *)rb; bud = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; printk("\v\tbud LEB %d\n", bud->lnum); rb = rb_next((struct rb_node const *)rb); ldv_28871: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_28870; } else { } __mptr___0 = (struct list_head const *)c->old_buds.next; bud = (struct ubifs_bud *)__mptr___0 + 0xfffffffffffffff0UL; goto ldv_28878; ldv_28877: printk("\v\told bud LEB %d\n", bud->lnum); __mptr___1 = (struct list_head const *)bud->list.next; bud = (struct ubifs_bud *)__mptr___1 + 0xfffffffffffffff0UL; ldv_28878: ; if ((unsigned long )(& bud->list) != (unsigned long )(& c->old_buds)) { goto ldv_28877; } else { } __mptr___2 = (struct list_head const *)c->idx_gc.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr___2; goto ldv_28885; ldv_28884: printk("\v\tGC\'ed idx LEB %d unmap %d\n", idx_gc->lnum, idx_gc->unmap); __mptr___3 = (struct list_head const *)idx_gc->list.next; idx_gc = (struct ubifs_gced_idx_leb *)__mptr___3; ldv_28885: ; if ((unsigned long )(& idx_gc->list) != (unsigned long )(& c->idx_gc)) { goto ldv_28884; } else { } printk("\v\tcommit state %d\n", c->cmt_state); available = ubifs_calc_available((struct ubifs_info const *)c, c->bi.min_idx_lebs); outstanding = c->bi.data_growth + c->bi.dd_growth; free = ubifs_get_free_space_nolock(c); printk("\vBudgeting predictions:\n"); printk("\v\tavailable: %lld, outstanding %lld, free %lld\n", available, outstanding, free); out_unlock: spin_unlock(& dbg_lock); spin_unlock(& c->space_lock); return; } } void ubifs_dump_lprop(struct ubifs_info const *c , struct ubifs_lprops const *lp ) { int i ; int spc ; int dark ; int dead ; struct rb_node *rb ; struct ubifs_bud *bud ; char const *s ; struct rb_node const *__mptr ; int head ; char const *tmp ; char const *tmp___0 ; { dark = 0; dead = 0; spc = (int )lp->free + (int )lp->dirty; if ((int )c->dead_wm > spc) { dead = spc; } else { dark = ubifs_calc_dark(c, spc); } if (((int )lp->flags & 32) != 0) { printk("\vLEB %-7d free %-8d dirty %-8d used %-8d free + dirty %-8d flags %#x (", lp->lnum, lp->free, lp->dirty, (int )c->leb_size - spc, spc, lp->flags); } else { printk("\vLEB %-7d free %-8d dirty %-8d used %-8d free + dirty %-8d dark %-4d dead %-4d nodes fit %-3d flags %#-4x (", lp->lnum, lp->free, lp->dirty, (int )c->leb_size - spc, spc, dark, dead, (int )((unsigned long )spc / 4256UL), lp->flags); } if (((int )lp->flags & 16) != 0) { if (((int )lp->flags & 32) != 0) { printk("index, taken"); } else { printk("taken"); } } else { if (((int )lp->flags & 32) != 0) { switch ((int )lp->flags & 15) { case 2: s = "dirty index"; goto ldv_28899; case 6: s = "freeable index"; goto ldv_28899; default: s = "index"; } ldv_28899: ; } else { switch ((int )lp->flags & 15) { case 0: s = "not categorized"; goto ldv_28903; case 1: s = "dirty"; goto ldv_28903; case 3: s = "free"; goto ldv_28903; case 4: s = "empty"; goto ldv_28903; case 5: s = "freeable"; goto ldv_28903; default: s = 0; goto ldv_28903; } ldv_28903: ; } printk("%s", s); } rb = rb_first(& c->buds); goto ldv_28916; ldv_28915: __mptr = (struct rb_node const *)rb; bud = (struct ubifs_bud *)__mptr + 0xffffffffffffffe0UL; if (bud->lnum == (int )lp->lnum) { head = 0; i = 0; goto ldv_28913; ldv_28912: ; if ((unsigned long )c->jheads != (unsigned long )((struct ubifs_jhead */* const */)0) && (int )lp->lnum == (c->jheads + (unsigned long )i)->wbuf.lnum) { tmp = dbg_jhead(i); printk(", jhead %s", tmp); head = 1; } else { } i = i + 1; ldv_28913: ; if ((int )c->jhead_cnt > i) { goto ldv_28912; } else { } if (head == 0) { tmp___0 = dbg_jhead(bud->jhead); printk(", bud of jhead %s", tmp___0); } else { } } else { } rb = rb_next((struct rb_node const *)rb); ldv_28916: ; if ((unsigned long )rb != (unsigned long )((struct rb_node *)0)) { goto ldv_28915; } else { } if ((int )lp->lnum == (int )c->gc_lnum) { printk(", GC LEB"); } else { } printk(")\n"); return; } } void ubifs_dump_lprops(struct ubifs_info *c ) { int lnum ; int err ; struct ubifs_lprops lp ; struct ubifs_lp_stats lst ; struct task_struct *tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; { tmp = get_current(); printk("\v(pid %d) start dumping LEB properties\n", tmp->pid); ubifs_get_lp_stats(c, & lst); ubifs_dump_lstats((struct ubifs_lp_stats const *)(& lst)); lnum = c->main_first; goto ldv_28927; ldv_28926: err = ubifs_read_one_lp(c, lnum, & lp); if (err != 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read lprops for LEB %d\n", tmp___0->pid, "ubifs_dump_lprops", lnum); } else { } ubifs_dump_lprop((struct ubifs_info const *)c, (struct ubifs_lprops const *)(& lp)); lnum = lnum + 1; ldv_28927: ; if (c->leb_cnt > lnum) { goto ldv_28926; } else { } tmp___1 = get_current(); printk("\v(pid %d) finish dumping LEB properties\n", tmp___1->pid); return; } } void ubifs_dump_lpt_info(struct ubifs_info *c ) { int i ; struct task_struct *tmp ; { spin_lock(& dbg_lock); tmp = get_current(); printk("\v(pid %d) dumping LPT information\n", tmp->pid); printk("\v\tlpt_sz: %lld\n", c->lpt_sz); printk("\v\tpnode_sz: %d\n", c->pnode_sz); printk("\v\tnnode_sz: %d\n", c->nnode_sz); printk("\v\tltab_sz: %d\n", c->ltab_sz); printk("\v\tlsave_sz: %d\n", c->lsave_sz); printk("\v\tbig_lpt: %d\n", (int )c->big_lpt); printk("\v\tlpt_hght: %d\n", c->lpt_hght); printk("\v\tpnode_cnt: %d\n", c->pnode_cnt); printk("\v\tnnode_cnt: %d\n", c->nnode_cnt); printk("\v\tdirty_pn_cnt: %d\n", c->dirty_pn_cnt); printk("\v\tdirty_nn_cnt: %d\n", c->dirty_nn_cnt); printk("\v\tlsave_cnt: %d\n", c->lsave_cnt); printk("\v\tspace_bits: %d\n", c->space_bits); printk("\v\tlpt_lnum_bits: %d\n", c->lpt_lnum_bits); printk("\v\tlpt_offs_bits: %d\n", c->lpt_offs_bits); printk("\v\tlpt_spc_bits: %d\n", c->lpt_spc_bits); printk("\v\tpcnt_bits: %d\n", c->pcnt_bits); printk("\v\tlnum_bits: %d\n", c->lnum_bits); printk("\v\tLPT root is at %d:%d\n", c->lpt_lnum, c->lpt_offs); printk("\v\tLPT head is at %d:%d\n", c->nhead_lnum, c->nhead_offs); printk("\v\tLPT ltab is at %d:%d\n", c->ltab_lnum, c->ltab_offs); if ((unsigned int )*((unsigned char *)c + 2048UL) != 0U) { printk("\v\tLPT lsave is at %d:%d\n", c->lsave_lnum, c->lsave_offs); } else { } i = 0; goto ldv_28934; ldv_28933: printk("\v\tLPT LEB %d free %d dirty %d tgc %d cmt %d\n", c->lpt_first + i, (c->ltab + (unsigned long )i)->free, (c->ltab + (unsigned long )i)->dirty, (int )(c->ltab + (unsigned long )i)->tgc, (int )(c->ltab + (unsigned long )i)->cmt); i = i + 1; ldv_28934: ; if (c->lpt_lebs > i) { goto ldv_28933; } else { } spin_unlock(& dbg_lock); return; } } void ubifs_dump_sleb(struct ubifs_info const *c , struct ubifs_scan_leb const *sleb , int offs ) { struct ubifs_scan_node *snod ; struct task_struct *tmp ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; { tmp = get_current(); printk("\v(pid %d) start dumping scanned data from LEB %d:%d\n", tmp->pid, sleb->lnum, offs); __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_28948; ldv_28947: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/debug.c.prepared", 923, 0); _cond_resched(); printk("\vDumping node at LEB %d:%d len %d\n", sleb->lnum, snod->offs, snod->len); ubifs_dump_node(c, (void const *)snod->node); __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_28948: ; if ((unsigned long )((struct list_head const *)(& snod->list)) != (unsigned long )(& sleb->nodes)) { goto ldv_28947; } else { } return; } } void ubifs_dump_leb(struct ubifs_info const *c , int lnum ) { struct ubifs_scan_leb *sleb ; struct ubifs_scan_node *snod ; void *buf ; struct task_struct *tmp ; pgprot_t __constr_expr_0 ; struct task_struct *tmp___0 ; long tmp___1 ; struct task_struct *tmp___2 ; long tmp___3 ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___4 ; { tmp = get_current(); printk("\v(pid %d) start dumping LEB %d\n", tmp->pid, lnum); __constr_expr_0.pgprot = 0x8000000000000163UL; buf = __vmalloc((unsigned long )c->leb_size, 80U, __constr_expr_0); if ((unsigned long )buf == (unsigned long )((void *)0)) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot allocate memory for dumping LEB %d\n", tmp___0->pid, "ubifs_dump_leb", lnum); return; } else { } sleb = ubifs_scan(c, lnum, 0, buf, 0); tmp___3 = IS_ERR((void const *)sleb); if (tmp___3 != 0L) { tmp___1 = PTR_ERR((void const *)sleb); tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: scan error %d\n", tmp___2->pid, "ubifs_dump_leb", (int )tmp___1); goto out; } else { } printk("\vLEB %d has %d nodes ending at %d\n", lnum, sleb->nodes_cnt, sleb->endpt); __mptr = (struct list_head const *)sleb->nodes.next; snod = (struct ubifs_scan_node *)__mptr; goto ldv_28966; ldv_28965: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/debug.c.prepared", 954, 0); _cond_resched(); printk("\vDumping node at LEB %d:%d len %d\n", lnum, snod->offs, snod->len); ubifs_dump_node(c, (void const *)snod->node); __mptr___0 = (struct list_head const *)snod->list.next; snod = (struct ubifs_scan_node *)__mptr___0; ldv_28966: ; if ((unsigned long )(& snod->list) != (unsigned long )(& sleb->nodes)) { goto ldv_28965; } else { } tmp___4 = get_current(); printk("\v(pid %d) finish dumping LEB %d\n", tmp___4->pid, lnum); ubifs_scan_destroy(sleb); out: vfree((void const *)buf); return; } } void ubifs_dump_znode(struct ubifs_info const *c , struct ubifs_znode const *znode ) { int n ; struct ubifs_zbranch const *zbr ; char key_buf[48U] ; char const *tmp ; char const *tmp___0 ; { spin_lock(& dbg_lock); if ((unsigned long )znode->parent != (unsigned long )((struct ubifs_znode */* const */)0)) { zbr = (struct ubifs_zbranch const *)(& (znode->parent)->zbranch) + (unsigned long )znode->iip; } else { zbr = & c->zroot; } printk("\vznode %p, LEB %d:%d len %d parent %p iip %d level %d child_cnt %d flags %lx\n", znode, zbr->lnum, zbr->offs, zbr->len, znode->parent, znode->iip, znode->level, znode->child_cnt, znode->flags); if ((int )znode->child_cnt <= 0 || (int )znode->child_cnt > (int )c->fanout) { spin_unlock(& dbg_lock); return; } else { } printk("\vzbranches:\n"); n = 0; goto ldv_28976; ldv_28975: zbr = (struct ubifs_zbranch const *)(& znode->zbranch) + (unsigned long )n; if ((int )znode->level > 0) { tmp = dbg_snprintf_key(c, & zbr->key, (char *)(& key_buf), 48); printk("\v\t%d: znode %p LEB %d:%d len %d key %s\n", n, zbr->ldv_26076.znode, zbr->lnum, zbr->offs, zbr->len, tmp); } else { tmp___0 = dbg_snprintf_key(c, & zbr->key, (char *)(& key_buf), 48); printk("\v\t%d: LNC %p LEB %d:%d len %d key %s\n", n, zbr->ldv_26076.znode, zbr->lnum, zbr->offs, zbr->len, tmp___0); } n = n + 1; ldv_28976: ; if ((int )znode->child_cnt > n) { goto ldv_28975; } else { } spin_unlock(& dbg_lock); return; } } void ubifs_dump_heap(struct ubifs_info *c , struct ubifs_lpt_heap *heap , int cat ) { int i ; struct task_struct *tmp ; struct ubifs_lprops *lprops ; struct task_struct *tmp___0 ; { tmp = get_current(); printk("\v(pid %d) start dumping heap cat %d (%d elements)\n", tmp->pid, cat, heap->cnt); i = 0; goto ldv_28986; ldv_28985: lprops = *(heap->arr + (unsigned long )i); printk("\v\t%d. LEB %d hpos %d free %d dirty %d flags %d\n", i, lprops->lnum, lprops->ldv_25977.hpos, lprops->free, lprops->dirty, lprops->flags); i = i + 1; ldv_28986: ; if (heap->cnt > i) { goto ldv_28985; } else { } tmp___0 = get_current(); printk("\v(pid %d) finish dumping heap\n", tmp___0->pid); return; } } void ubifs_dump_pnode(struct ubifs_info *c , struct ubifs_pnode *pnode , struct ubifs_nnode *parent , int iip ) { int i ; struct task_struct *tmp ; struct ubifs_lprops *lp ; { tmp = get_current(); printk("\v(pid %d) dumping pnode:\n", tmp->pid); printk("\v\taddress %zx parent %zx cnext %zx\n", (unsigned long )pnode, (unsigned long )parent, (unsigned long )pnode->cnext); printk("\v\tflags %lu iip %d level %d num %d\n", pnode->flags, iip, pnode->level, pnode->num); i = 0; goto ldv_28997; ldv_28996: lp = (struct ubifs_lprops *)(& pnode->lprops) + (unsigned long )i; printk("\v\t%d: free %d dirty %d flags %d lnum %d\n", i, lp->free, lp->dirty, lp->flags, lp->lnum); i = i + 1; ldv_28997: ; if (i <= 3) { goto ldv_28996; } else { } return; } } void ubifs_dump_tnc(struct ubifs_info *c ) { struct ubifs_znode *znode ; int level ; struct task_struct *tmp ; struct task_struct *tmp___0 ; { printk("\v\n"); tmp = get_current(); printk("\v(pid %d) start dumping TNC tree\n", tmp->pid); znode = ubifs_tnc_levelorder_next(c->zroot.ldv_26076.znode, 0); level = znode->level; printk("\v== Level %d ==\n", level); goto ldv_29005; ldv_29004: ; if (znode->level != level) { level = znode->level; printk("\v== Level %d ==\n", level); } else { } ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); znode = ubifs_tnc_levelorder_next(c->zroot.ldv_26076.znode, znode); ldv_29005: ; if ((unsigned long )znode != (unsigned long )((struct ubifs_znode *)0)) { goto ldv_29004; } else { } tmp___0 = get_current(); printk("\v(pid %d) finish dumping TNC tree\n", tmp___0->pid); return; } } static int dump_znode(struct ubifs_info *c , struct ubifs_znode *znode , void *priv ) { { ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); return (0); } } void ubifs_dump_index(struct ubifs_info *c ) { { dbg_walk_index(c, 0, & dump_znode, 0); return; } } void dbg_save_space_info(struct ubifs_info *c ) { struct ubifs_debug_info *d ; int freeable_cnt ; size_t __len ; void *__ret ; size_t __len___0 ; void *__ret___0 ; { d = c->dbg; spin_lock(& c->space_lock); __len = 56UL; if (__len > 63UL) { __ret = memcpy((void *)(& d->saved_lst), (void const *)(& c->lst), __len); } else { __ret = memcpy((void *)(& d->saved_lst), (void const *)(& c->lst), __len); } __len___0 = 64UL; if (__len___0 > 63UL) { __ret___0 = memcpy((void *)(& d->saved_bi), (void const *)(& c->bi), __len___0); } else { __ret___0 = memcpy((void *)(& d->saved_bi), (void const *)(& c->bi), __len___0); } d->saved_idx_gc_cnt = c->idx_gc_cnt; freeable_cnt = c->freeable_cnt; c->freeable_cnt = 0; d->saved_free = ubifs_get_free_space_nolock(c); c->freeable_cnt = freeable_cnt; spin_unlock(& c->space_lock); return; } } int dbg_check_space_info(struct ubifs_info *c ) { struct ubifs_debug_info *d ; struct ubifs_lp_stats lst ; long long free ; int freeable_cnt ; struct task_struct *tmp ; { d = c->dbg; spin_lock(& c->space_lock); freeable_cnt = c->freeable_cnt; c->freeable_cnt = 0; free = ubifs_get_free_space_nolock(c); c->freeable_cnt = freeable_cnt; spin_unlock(& c->space_lock); if (d->saved_free != free) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: free space changed from %lld to %lld\n", tmp->pid, "dbg_check_space_info", d->saved_free, free); goto out; } else { } return (0); out: printk("\rUBIFS: saved lprops statistics dump\n"); ubifs_dump_lstats((struct ubifs_lp_stats const *)(& d->saved_lst)); printk("\rUBIFS: saved budgeting info dump\n"); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& d->saved_bi)); printk("\rUBIFS: saved idx_gc_cnt %d\n", d->saved_idx_gc_cnt); printk("\rUBIFS: current lprops statistics dump\n"); ubifs_get_lp_stats(c, & lst); ubifs_dump_lstats((struct ubifs_lp_stats const *)(& lst)); printk("\rUBIFS: current budgeting info dump\n"); ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); dump_stack(); return (-22); } } int dbg_check_synced_i_size(struct ubifs_info const *c , struct inode *inode ) { int err ; struct ubifs_inode *ui ; struct ubifs_inode *tmp ; int tmp___0 ; struct task_struct *tmp___1 ; loff_t tmp___2 ; struct task_struct *tmp___3 ; { err = 0; tmp = ubifs_inode((struct inode const *)inode); ui = tmp; tmp___0 = dbg_is_chk_gen(c); if (tmp___0 == 0) { return (0); } else { } if (((int )inode->i_mode & 61440) != 32768) { return (0); } else { } ldv_mutex_lock_759(& ui->ui_mutex); spin_lock(& ui->ui_lock); if (ui->ui_size != ui->synced_i_size && (unsigned int )*((unsigned char *)ui + 1060UL) == 0U) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: ui_size is %lld, synced_i_size is %lld, but inode is clean\n", tmp___1->pid, "dbg_check_synced_i_size", ui->ui_size, ui->synced_i_size); tmp___2 = i_size_read((struct inode const *)inode); tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: i_ino %lu, i_mode %#x, i_size %lld\n", tmp___3->pid, "dbg_check_synced_i_size", inode->i_ino, (int )inode->i_mode, tmp___2); dump_stack(); err = -22; } else { } spin_unlock(& ui->ui_lock); ldv_mutex_unlock_760(& ui->ui_mutex); return (err); } } int dbg_check_dir(struct ubifs_info *c , struct inode const *dir ) { unsigned int nlink ; union ubifs_key key ; struct ubifs_dent_node *dent ; struct ubifs_dent_node *pdent ; struct qstr nm ; loff_t size ; int tmp ; int err ; long tmp___0 ; long tmp___1 ; loff_t tmp___2 ; struct task_struct *tmp___3 ; loff_t tmp___4 ; struct task_struct *tmp___5 ; { nlink = 2U; pdent = 0; nm.ldv_7607.ldv_7605.hash = 0U; nm.ldv_7607.ldv_7605.len = 0U; nm.name = 0; size = 160LL; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } if (((int )dir->i_mode & 61440) != 16384) { return (0); } else { } lowest_dent_key((struct ubifs_info const *)c, & key, dir->i_ino); ldv_29054: dent = ubifs_tnc_next_ent(c, & key, (struct qstr const *)(& nm)); tmp___1 = IS_ERR((void const *)dent); if (tmp___1 != 0L) { tmp___0 = PTR_ERR((void const *)dent); err = (int )tmp___0; if (err == -2) { goto ldv_29053; } else { } return (err); } else { } nm.name = (unsigned char const *)(& dent->name); nm.ldv_7607.ldv_7605.len = (u32 )dent->nlen; size = (loff_t )(((unsigned long long )((unsigned long )nm.ldv_7607.ldv_7605.len + 64UL) & 0xfffffffffffffff8ULL) + (unsigned long long )size); if ((unsigned int )dent->type == 1U) { nlink = nlink + 1U; } else { } kfree((void const *)pdent); pdent = dent; key_read((struct ubifs_info const *)c, (void const *)(& dent->key), & key); goto ldv_29054; ldv_29053: kfree((void const *)pdent); tmp___4 = i_size_read(dir); if (tmp___4 != size) { tmp___2 = i_size_read(dir); tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: directory inode %lu has size %llu, but calculated size is %llu\n", tmp___3->pid, "dbg_check_dir", dir->i_ino, (unsigned long long )tmp___2, (unsigned long long )size); ubifs_dump_inode(c, dir); dump_stack(); return (-22); } else { } if ((unsigned int )dir->ldv_13285.i_nlink != nlink) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: directory inode %lu has nlink %u, but calculated nlink is %u\n", tmp___5->pid, "dbg_check_dir", dir->i_ino, dir->ldv_13285.i_nlink, nlink); ubifs_dump_inode(c, dir); dump_stack(); return (-22); } else { } return (0); } } static int dbg_check_key_order(struct ubifs_info *c , struct ubifs_zbranch *zbr1 , struct ubifs_zbranch *zbr2 ) { int err ; int nlen1 ; int nlen2 ; int cmp ; struct ubifs_dent_node *dent1 ; struct ubifs_dent_node *dent2 ; union ubifs_key key ; char key_buf[48U] ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; void *tmp___2 ; void *tmp___3 ; char const *tmp___4 ; struct task_struct *tmp___5 ; char const *tmp___6 ; struct task_struct *tmp___7 ; int tmp___8 ; char const *tmp___9 ; struct task_struct *tmp___10 ; char const *tmp___11 ; struct task_struct *tmp___12 ; int tmp___13 ; int __min1 ; int __min2 ; struct task_struct *tmp___14 ; char const *tmp___15 ; struct task_struct *tmp___16 ; { tmp___0 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr1->key), (union ubifs_key const *)(& zbr2->key)); tmp___1 = ldv__builtin_expect(tmp___0 != 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dbg_check_key_order", 1300, tmp->pid); dump_stack(); } else { } tmp___2 = kmalloc(312UL, 80U); dent1 = (struct ubifs_dent_node *)tmp___2; if ((unsigned long )dent1 == (unsigned long )((struct ubifs_dent_node *)0)) { return (-12); } else { } tmp___3 = kmalloc(312UL, 80U); dent2 = (struct ubifs_dent_node *)tmp___3; if ((unsigned long )dent2 == (unsigned long )((struct ubifs_dent_node *)0)) { err = -12; goto out_free; } else { } err = ubifs_tnc_read_node(c, zbr1, (void *)dent1); if (err != 0) { goto out_free; } else { } err = ubifs_validate_entry(c, (struct ubifs_dent_node const *)dent1); if (err != 0) { goto out_free; } else { } err = ubifs_tnc_read_node(c, zbr2, (void *)dent2); if (err != 0) { goto out_free; } else { } err = ubifs_validate_entry(c, (struct ubifs_dent_node const *)dent2); if (err != 0) { goto out_free; } else { } err = 1; key_read((struct ubifs_info const *)c, (void const *)(& dent1->key), & key); tmp___8 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr1->key), (union ubifs_key const *)(& key)); if (tmp___8 != 0) { tmp___4 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: 1st entry at %d:%d has key %s\n", tmp___5->pid, "dbg_check_key_order", zbr1->lnum, zbr1->offs, tmp___4); tmp___6 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr1->key), (char *)(& key_buf), 48); tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: but it should have key %s according to tnc\n", tmp___7->pid, "dbg_check_key_order", tmp___6); ubifs_dump_node((struct ubifs_info const *)c, (void const *)dent1); goto out_free; } else { } key_read((struct ubifs_info const *)c, (void const *)(& dent2->key), & key); tmp___13 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr2->key), (union ubifs_key const *)(& key)); if (tmp___13 != 0) { tmp___9 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: 2nd entry at %d:%d has key %s\n", tmp___10->pid, "dbg_check_key_order", zbr1->lnum, zbr1->offs, tmp___9); tmp___11 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr2->key), (char *)(& key_buf), 48); tmp___12 = get_current(); printk("\vUBIFS error (pid %d): %s: but it should have key %s according to tnc\n", tmp___12->pid, "dbg_check_key_order", tmp___11); ubifs_dump_node((struct ubifs_info const *)c, (void const *)dent2); goto out_free; } else { } nlen1 = (int )dent1->nlen; nlen2 = (int )dent2->nlen; __min1 = nlen1; __min2 = nlen2; cmp = memcmp((void const *)(& dent1->name), (void const *)(& dent2->name), (size_t )(__min1 < __min2 ? __min1 : __min2)); if (cmp < 0 || (cmp == 0 && nlen1 < nlen2)) { err = 0; goto out_free; } else { } if (cmp == 0 && nlen1 == nlen2) { tmp___14 = get_current(); printk("\vUBIFS error (pid %d): %s: 2 xent/dent nodes with the same name\n", tmp___14->pid, "dbg_check_key_order"); } else { tmp___15 = dbg_snprintf_key((struct ubifs_info const *)c, (union ubifs_key const *)(& key), (char *)(& key_buf), 48); tmp___16 = get_current(); printk("\vUBIFS error (pid %d): %s: bad order of colliding key %s\n", tmp___16->pid, "dbg_check_key_order", tmp___15); } printk("\rUBIFS: first node at %d:%d\n\n", zbr1->lnum, zbr1->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)dent1); printk("\rUBIFS: second node at %d:%d\n\n", zbr2->lnum, zbr2->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)dent2); out_free: kfree((void const *)dent2); kfree((void const *)dent1); return (err); } } static int dbg_check_znode(struct ubifs_info *c , struct ubifs_zbranch *zbr ) { struct ubifs_znode *znode ; struct ubifs_znode *zp ; int n ; int err ; int cmp ; int tmp ; int tmp___0 ; int tmp___1 ; int tmp___2 ; union ubifs_key const *min ; union ubifs_key const *max ; int tmp___3 ; int tmp___4 ; struct task_struct *tmp___5 ; { znode = zbr->ldv_26076.znode; zp = znode->parent; if (znode->child_cnt <= 0 || znode->child_cnt > c->fanout) { err = 1; goto out; } else { } if (znode->level < 0) { err = 2; goto out; } else { } if (znode->iip < 0 || znode->iip >= c->fanout) { err = 3; goto out; } else { } if (zbr->len == 0) { tmp = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp == 0) { err = 4; goto out; } else { } } else { } tmp___2 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___2 != 0) { __asm__ volatile ("mfence": : : "memory"); if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { tmp___1 = ubifs_zn_dirty((struct ubifs_znode const *)zp); if (tmp___1 == 0) { __asm__ volatile ("mfence": : : "memory"); tmp___0 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___0 != 0) { err = 5; goto out; } else { } } else { } } else { } } else { } if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { if (znode->level != zp->level + -1) { err = 6; goto out; } else { } err = ubifs_search_zbranch((struct ubifs_info const *)c, (struct ubifs_znode const *)zp, (union ubifs_key const *)(& zbr->key), & n); if (err == 0) { err = 7; goto out; } else { } if (znode->iip >= zp->child_cnt) { err = 8; goto out; } else { } if (znode->iip != n) { tmp___3 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& zp->zbranch[n].key), (union ubifs_key const *)(& zp->zbranch[znode->iip].key)); if (tmp___3 != 0) { err = 9; goto out; } else { } n = znode->iip; } else { } min = (union ubifs_key const *)(& zbr->key); cmp = keys_cmp((struct ubifs_info const *)c, min, (union ubifs_key const *)(& znode->zbranch[0].key)); if (cmp == 1) { err = 10; goto out; } else { } if (n + 1 < zp->child_cnt) { max = (union ubifs_key const *)(& zp->zbranch[n + 1].key); cmp = keys_cmp((struct ubifs_info const *)c, max, (union ubifs_key const *)(& znode->zbranch[znode->child_cnt + -1].key)); if (cmp == -1) { err = 11; goto out; } else { } } else { } } else if ((unsigned long )(& c->zroot) != (unsigned long )zbr) { err = 12; goto out; } else { } n = 1; goto ldv_29088; ldv_29087: cmp = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[n + -1].key), (union ubifs_key const *)(& znode->zbranch[n].key)); if (cmp > 0) { err = 13; goto out; } else { } if (cmp == 0) { tmp___4 = is_hash_key((struct ubifs_info const *)c, (union ubifs_key const *)(& znode->zbranch[n].key)); if (tmp___4 == 0) { err = 14; goto out; } else { } if (znode->level != 0 || (unsigned int )*((unsigned char *)c + 5528UL) != 0U) { goto ldv_29086; } else { } err = dbg_check_key_order(c, (struct ubifs_zbranch *)(& znode->zbranch) + ((unsigned long )n + 0xffffffffffffffffUL), (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n); if (err < 0) { return (err); } else { } if (err != 0) { err = 15; goto out; } else { } } else { } ldv_29086: n = n + 1; ldv_29088: ; if (znode->child_cnt > n) { goto ldv_29087; } else { } n = 0; goto ldv_29091; ldv_29090: ; if ((unsigned long )znode->zbranch[n].ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0) && (znode->zbranch[n].lnum == 0 || znode->zbranch[n].len == 0)) { err = 16; goto out; } else { } if (znode->zbranch[n].lnum != 0 && znode->zbranch[n].len == 0) { err = 17; goto out; } else { } if (znode->zbranch[n].lnum == 0 && znode->zbranch[n].len != 0) { err = 18; goto out; } else { } if (znode->zbranch[n].lnum == 0 && znode->zbranch[n].offs != 0) { err = 19; goto out; } else { } if (znode->level != 0 && (unsigned long )znode->zbranch[n].ldv_26076.znode != (unsigned long )((struct ubifs_znode *)0)) { if ((unsigned long )(znode->zbranch[n].ldv_26076.znode)->parent != (unsigned long )znode) { err = 20; goto out; } else { } } else { } n = n + 1; ldv_29091: ; if (znode->child_cnt > n) { goto ldv_29090; } else { } return (0); out: tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: failed, error %d\n", tmp___5->pid, "dbg_check_znode", err); printk("\rUBIFS: dump of the znode\n"); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); if ((unsigned long )zp != (unsigned long )((struct ubifs_znode *)0)) { printk("\rUBIFS: dump of the parent znode\n"); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)zp); } else { } dump_stack(); return (-22); } } int dbg_check_tnc(struct ubifs_info *c , int extra ) { struct ubifs_znode *znode ; long clean_cnt ; long dirty_cnt ; int err ; int last ; int tmp ; struct task_struct *tmp___0 ; int tmp___1 ; long tmp___2 ; struct ubifs_znode *prev ; struct ubifs_zbranch *zbr ; int tmp___3 ; int tmp___4 ; long tmp___5 ; struct task_struct *tmp___6 ; long tmp___7 ; long tmp___8 ; struct task_struct *tmp___9 ; long tmp___10 ; { clean_cnt = 0L; dirty_cnt = 0L; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } tmp___1 = mutex_is_locked(& c->tnc_mutex); tmp___2 = ldv__builtin_expect(tmp___1 == 0, 0L); if (tmp___2 != 0L) { tmp___0 = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "dbg_check_tnc", 1596, tmp___0->pid); dump_stack(); } else { } if ((unsigned long )c->zroot.ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0)) { return (0); } else { } znode = ubifs_tnc_postorder_first(c->zroot.ldv_26076.znode); ldv_29107: ; if ((unsigned long )znode->parent == (unsigned long )((struct ubifs_znode *)0)) { zbr = & c->zroot; } else { zbr = (struct ubifs_zbranch *)(& (znode->parent)->zbranch) + (unsigned long )znode->iip; } err = dbg_check_znode(c, zbr); if (err != 0) { return (err); } else { } if (extra != 0) { tmp___3 = ubifs_zn_dirty((struct ubifs_znode const *)znode); if (tmp___3 != 0) { dirty_cnt = dirty_cnt + 1L; } else { clean_cnt = clean_cnt + 1L; } } else { } prev = znode; znode = ubifs_tnc_postorder_next(znode); if ((unsigned long )znode == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_29106; } else { } last = prev->child_cnt + -1; if ((prev->level == 0 && znode->level == 0) && (unsigned int )*((unsigned char *)c + 5528UL) == 0U) { tmp___4 = keys_cmp((struct ubifs_info const *)c, (union ubifs_key const *)(& prev->zbranch[last].key), (union ubifs_key const *)(& znode->zbranch[0].key)); if (tmp___4 == 0) { err = dbg_check_key_order(c, (struct ubifs_zbranch *)(& prev->zbranch) + (unsigned long )last, (struct ubifs_zbranch *)(& znode->zbranch)); if (err < 0) { return (err); } else { } if (err != 0) { printk("\rUBIFS: first znode\n"); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)prev); printk("\rUBIFS: second znode\n"); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); return (-22); } else { } } else { } } else { } goto ldv_29107; ldv_29106: ; if (extra != 0) { tmp___7 = atomic_long_read(& c->clean_zn_cnt); if (tmp___7 != clean_cnt) { tmp___5 = atomic_long_read(& c->clean_zn_cnt); tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: incorrect clean_zn_cnt %ld, calculated %ld\n", tmp___6->pid, "dbg_check_tnc", tmp___5, clean_cnt); return (-22); } else { } tmp___10 = atomic_long_read(& c->dirty_zn_cnt); if (tmp___10 != dirty_cnt) { tmp___8 = atomic_long_read(& c->dirty_zn_cnt); tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: incorrect dirty_zn_cnt %ld, calculated %ld\n", tmp___9->pid, "dbg_check_tnc", tmp___8, dirty_cnt); return (-22); } else { } } else { } return (0); } } int dbg_walk_index(struct ubifs_info *c , int (*leaf_cb)(struct ubifs_info * , struct ubifs_zbranch * , void * ) , int (*znode_cb)(struct ubifs_info * , struct ubifs_znode * , void * ) , void *priv ) { int err ; struct ubifs_zbranch *zbr ; struct ubifs_znode *znode ; struct ubifs_znode *child ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; int idx ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; { ldv_mutex_lock_761(& c->tnc_mutex); if ((unsigned long )c->zroot.ldv_26076.znode == (unsigned long )((struct ubifs_znode *)0)) { c->zroot.ldv_26076.znode = ubifs_load_znode(c, & c->zroot, 0, 0); tmp___0 = IS_ERR((void const *)c->zroot.ldv_26076.znode); if (tmp___0 != 0L) { tmp = PTR_ERR((void const *)c->zroot.ldv_26076.znode); err = (int )tmp; c->zroot.ldv_26076.znode = 0; goto out_unlock; } else { } } else { } znode = c->zroot.ldv_26076.znode; goto ldv_29120; ldv_29119: zbr = (struct ubifs_zbranch *)(& znode->zbranch); child = zbr->ldv_26076.znode; if ((unsigned long )child == (unsigned long )((struct ubifs_znode *)0)) { child = ubifs_load_znode(c, zbr, znode, 0); tmp___2 = IS_ERR((void const *)child); if (tmp___2 != 0L) { tmp___1 = PTR_ERR((void const *)child); err = (int )tmp___1; goto out_unlock; } else { } zbr->ldv_26076.znode = child; } else { } znode = child; ldv_29120: ; if (znode->level > 0) { goto ldv_29119; } else { } ldv_29134: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/debug.c.prepared", 1724, 0); _cond_resched(); if ((unsigned long )znode_cb != (unsigned long )((int (*)(struct ubifs_info * , struct ubifs_znode * , void * ))0)) { err = (*znode_cb)(c, znode, priv); if (err != 0) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: znode checking function returned error %d\n", tmp___3->pid, "dbg_walk_index", err); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); goto out_dump; } else { } } else { } if ((unsigned long )leaf_cb != (unsigned long )((int (*)(struct ubifs_info * , struct ubifs_zbranch * , void * ))0) && znode->level == 0) { idx = 0; goto ldv_29127; ldv_29126: zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )idx; err = (*leaf_cb)(c, zbr, priv); if (err != 0) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: leaf checking function returned error %d, for leaf at LEB %d:%d\n", tmp___4->pid, "dbg_walk_index", err, zbr->lnum, zbr->offs); goto out_dump; } else { } idx = idx + 1; ldv_29127: ; if (znode->child_cnt > idx) { goto ldv_29126; } else { } } else { } if ((unsigned long )znode->parent == (unsigned long )((struct ubifs_znode *)0)) { goto ldv_29129; } else { } idx = znode->iip + 1; znode = znode->parent; if (znode->child_cnt > idx) { zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )idx; child = zbr->ldv_26076.znode; if ((unsigned long )child == (unsigned long )((struct ubifs_znode *)0)) { child = ubifs_load_znode(c, zbr, znode, idx); tmp___6 = IS_ERR((void const *)child); if (tmp___6 != 0L) { tmp___5 = PTR_ERR((void const *)child); err = (int )tmp___5; goto out_unlock; } else { } zbr->ldv_26076.znode = child; } else { } znode = child; } else { goto ldv_29130; } goto ldv_29132; ldv_29131: zbr = (struct ubifs_zbranch *)(& znode->zbranch); child = zbr->ldv_26076.znode; if ((unsigned long )child == (unsigned long )((struct ubifs_znode *)0)) { child = ubifs_load_znode(c, zbr, znode, 0); tmp___8 = IS_ERR((void const *)child); if (tmp___8 != 0L) { tmp___7 = PTR_ERR((void const *)child); err = (int )tmp___7; goto out_unlock; } else { } zbr->ldv_26076.znode = child; } else { } znode = child; ldv_29132: ; if (znode->level > 0) { goto ldv_29131; } else { } ldv_29130: ; goto ldv_29134; ldv_29129: ldv_mutex_unlock_762(& c->tnc_mutex); return (0); out_dump: ; if ((unsigned long )znode->parent != (unsigned long )((struct ubifs_znode *)0)) { zbr = (struct ubifs_zbranch *)(& (znode->parent)->zbranch) + (unsigned long )znode->iip; } else { zbr = & c->zroot; } printk("\rUBIFS: dump of znode at LEB %d:%d\n", zbr->lnum, zbr->offs); ubifs_dump_znode((struct ubifs_info const *)c, (struct ubifs_znode const *)znode); out_unlock: ldv_mutex_unlock_763(& c->tnc_mutex); return (err); } } static int add_size(struct ubifs_info *c , struct ubifs_znode *znode , void *priv ) { long long *idx_size ; int add ; { idx_size = (long long *)priv; add = ubifs_idx_node_sz((struct ubifs_info const *)c, znode->child_cnt); add = (add + 7) & -8; *idx_size = *idx_size + (long long )add; return (0); } } int dbg_check_idx_size(struct ubifs_info *c , long long idx_size ) { int err ; long long calc ; int tmp ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; { calc = 0LL; tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } err = dbg_walk_index(c, 0, & add_size, (void *)(& calc)); if (err != 0) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while walking the index\n", tmp___0->pid, "dbg_check_idx_size", err); return (err); } else { } if (calc != idx_size) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: index size check failed: calculated size is %lld, should be %lld\n", tmp___1->pid, "dbg_check_idx_size", calc, idx_size); dump_stack(); return (-22); } else { } return (0); } } static struct fsck_inode *add_inode(struct ubifs_info *c , struct fsck_data *fsckd , struct ubifs_ino_node *ino ) { struct rb_node **p ; struct rb_node *parent ; struct fsck_inode *fscki ; ino_t inum ; ino_t tmp ; struct inode *inode ; struct ubifs_inode *ui ; struct rb_node const *__mptr ; struct task_struct *tmp___0 ; void *tmp___1 ; void *tmp___2 ; void *tmp___3 ; { parent = 0; tmp = key_inum_flash((struct ubifs_info const *)c, (void const *)(& ino->key)); inum = tmp; p = & fsckd->inodes.rb_node; goto ldv_29180; ldv_29179: parent = *p; __mptr = (struct rb_node const *)parent; fscki = (struct fsck_inode *)__mptr; if (fscki->inum > inum) { p = & (*p)->rb_left; } else if (fscki->inum < inum) { p = & (*p)->rb_right; } else { return (fscki); } ldv_29180: ; if ((unsigned long )*p != (unsigned long )((struct rb_node *)0)) { goto ldv_29179; } else { } if (c->highest_inum < inum) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: too high inode number, max. is %lu\n", tmp___0->pid, "add_inode", c->highest_inum); tmp___1 = ERR_PTR(-22L); return ((struct fsck_inode *)tmp___1); } else { } tmp___2 = kzalloc(112UL, 80U); fscki = (struct fsck_inode *)tmp___2; if ((unsigned long )fscki == (unsigned long )((struct fsck_inode *)0)) { tmp___3 = ERR_PTR(-12L); return ((struct fsck_inode *)tmp___3); } else { } inode = ilookup(c->vfs_sb, inum); fscki->inum = inum; if ((unsigned long )inode == (unsigned long )((struct inode *)0)) { fscki->nlink = ino->nlink; fscki->size = (long long )ino->size; fscki->xattr_cnt = ino->xattr_cnt; fscki->xattr_sz = ino->xattr_size; fscki->xattr_nms = ino->xattr_names; fscki->mode = (umode_t )ino->mode; } else { ui = ubifs_inode((struct inode const *)inode); fscki->nlink = inode->ldv_13285.i_nlink; fscki->size = inode->i_size; fscki->xattr_cnt = ui->xattr_cnt; fscki->xattr_sz = ui->xattr_size; fscki->xattr_nms = ui->xattr_names; fscki->mode = inode->i_mode; iput(inode); } if (((int )fscki->mode & 61440) == 16384) { fscki->calc_sz = 160LL; fscki->calc_cnt = 2; } else { } rb_link_node(& fscki->rb, parent, p); rb_insert_color(& fscki->rb, & fsckd->inodes); return (fscki); } } static struct fsck_inode *search_inode(struct fsck_data *fsckd , ino_t inum ) { struct rb_node *p ; struct fsck_inode *fscki ; struct rb_node const *__mptr ; { p = fsckd->inodes.rb_node; goto ldv_29192; ldv_29191: __mptr = (struct rb_node const *)p; fscki = (struct fsck_inode *)__mptr; if (fscki->inum > inum) { p = p->rb_left; } else if (fscki->inum < inum) { p = p->rb_right; } else { return (fscki); } ldv_29192: ; if ((unsigned long )p != (unsigned long )((struct rb_node *)0)) { goto ldv_29191; } else { } return (0); } } static struct fsck_inode *read_add_inode(struct ubifs_info *c , struct fsck_data *fsckd , ino_t inum ) { int n ; int err ; union ubifs_key key ; struct ubifs_znode *znode ; struct ubifs_zbranch *zbr ; struct ubifs_ino_node *ino ; struct fsck_inode *fscki ; struct task_struct *tmp ; void *tmp___0 ; struct task_struct *tmp___1 ; void *tmp___2 ; struct task_struct *tmp___3 ; void *tmp___4 ; void *tmp___5 ; void *tmp___6 ; struct task_struct *tmp___7 ; void *tmp___8 ; long tmp___9 ; struct task_struct *tmp___10 ; long tmp___11 ; { fscki = search_inode(fsckd, inum); if ((unsigned long )fscki != (unsigned long )((struct fsck_inode *)0)) { return (fscki); } else { } ino_key_init((struct ubifs_info const *)c, & key, inum); err = ubifs_lookup_level0(c, (union ubifs_key const *)(& key), & znode, & n); if (err == 0) { tmp = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu not found in index\n", tmp->pid, "read_add_inode", inum); tmp___0 = ERR_PTR(-2L); return ((struct fsck_inode *)tmp___0); } else if (err < 0) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while looking up inode %lu\n", tmp___1->pid, "read_add_inode", err, inum); tmp___2 = ERR_PTR((long )err); return ((struct fsck_inode *)tmp___2); } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; if ((unsigned int )zbr->len <= 159U) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node %lu node length %d\n", tmp___3->pid, "read_add_inode", inum, zbr->len); tmp___4 = ERR_PTR(-22L); return ((struct fsck_inode *)tmp___4); } else { } tmp___5 = kmalloc((size_t )zbr->len, 80U); ino = (struct ubifs_ino_node *)tmp___5; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { tmp___6 = ERR_PTR(-12L); return ((struct fsck_inode *)tmp___6); } else { } err = ubifs_tnc_read_node(c, zbr, (void *)ino); if (err != 0) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read inode node at LEB %d:%d, error %d\n", tmp___7->pid, "read_add_inode", zbr->lnum, zbr->offs, err); kfree((void const *)ino); tmp___8 = ERR_PTR((long )err); return ((struct fsck_inode *)tmp___8); } else { } fscki = add_inode(c, fsckd, ino); kfree((void const *)ino); tmp___11 = IS_ERR((void const *)fscki); if (tmp___11 != 0L) { tmp___9 = PTR_ERR((void const *)fscki); tmp___10 = get_current(); printk("\vUBIFS error (pid %d): %s: error %ld while adding inode %lu node\n", tmp___10->pid, "read_add_inode", tmp___9, inum); return (fscki); } else { } return (fscki); } } static int check_leaf(struct ubifs_info *c , struct ubifs_zbranch *zbr , void *priv ) { ino_t inum ; void *node ; struct ubifs_ch *ch ; int err ; int type ; int tmp ; struct fsck_inode *fscki ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; long tmp___2 ; struct task_struct *tmp___3 ; long tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; long long blk_offs ; struct ubifs_data_node *dn ; long tmp___7 ; struct task_struct *tmp___8 ; long tmp___9 ; unsigned int tmp___10 ; struct task_struct *tmp___11 ; int nlen ; struct ubifs_dent_node *dent ; struct fsck_inode *fscki1 ; long tmp___12 ; struct task_struct *tmp___13 ; long tmp___14 ; long tmp___15 ; struct task_struct *tmp___16 ; long tmp___17 ; { tmp = key_type((struct ubifs_info const *)c, (union ubifs_key const *)(& zbr->key)); type = tmp; if ((unsigned int )zbr->len <= 23U) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad leaf length %d (LEB %d:%d)\n", tmp___0->pid, "check_leaf", zbr->len, zbr->lnum, zbr->offs); return (-22); } else { } node = kmalloc((size_t )zbr->len, 80U); if ((unsigned long )node == (unsigned long )((void *)0)) { return (-12); } else { } err = ubifs_tnc_read_node(c, zbr, node); if (err != 0) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read leaf node at LEB %d:%d, error %d\n", tmp___1->pid, "check_leaf", zbr->lnum, zbr->offs, err); goto out_free; } else { } if (type == 0) { fscki = add_inode(c, (struct fsck_data *)priv, (struct ubifs_ino_node *)node); tmp___4 = IS_ERR((void const *)fscki); if (tmp___4 != 0L) { tmp___2 = PTR_ERR((void const *)fscki); err = (int )tmp___2; tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while adding inode node\n", tmp___3->pid, "check_leaf", err); goto out_dump; } else { } goto out; } else { } if ((type != 2 && type != 3) && type != 1) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: unexpected node type %d at LEB %d:%d\n", tmp___5->pid, "check_leaf", type, zbr->lnum, zbr->offs); err = -22; goto out_free; } else { } ch = (struct ubifs_ch *)node; if (ch->sqnum > c->max_sqnum) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: too high sequence number, max. is %llu\n", tmp___6->pid, "check_leaf", c->max_sqnum); err = -22; goto out_dump; } else { } if (type == 1) { dn = (struct ubifs_data_node *)node; inum = key_inum_flash((struct ubifs_info const *)c, (void const *)(& dn->key)); fscki = read_add_inode(c, (struct fsck_data *)priv, inum); tmp___9 = IS_ERR((void const *)fscki); if (tmp___9 != 0L) { tmp___7 = PTR_ERR((void const *)fscki); err = (int )tmp___7; tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while processing data node and trying to find inode node %lu\n", tmp___8->pid, "check_leaf", err, inum); goto out_dump; } else { } tmp___10 = key_block_flash((struct ubifs_info const *)c, (void const *)(& dn->key)); blk_offs = (long long )tmp___10; blk_offs = blk_offs << 12; blk_offs = (long long )dn->size + blk_offs; if (fscki->size < blk_offs) { tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: data node at LEB %d:%d is not within inode size %lld\n", tmp___11->pid, "check_leaf", zbr->lnum, zbr->offs, fscki->size); err = -22; goto out_dump; } else { } } else { dent = (struct ubifs_dent_node *)node; err = ubifs_validate_entry(c, (struct ubifs_dent_node const *)dent); if (err != 0) { goto out_dump; } else { } inum = (ino_t )dent->inum; fscki = read_add_inode(c, (struct fsck_data *)priv, inum); tmp___14 = IS_ERR((void const *)fscki); if (tmp___14 != 0L) { tmp___12 = PTR_ERR((void const *)fscki); err = (int )tmp___12; tmp___13 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while processing entry node and trying to find inode node %lu\n", tmp___13->pid, "check_leaf", err, inum); goto out_dump; } else { } fscki->references = fscki->references + 1; inum = key_inum_flash((struct ubifs_info const *)c, (void const *)(& dent->key)); fscki1 = read_add_inode(c, (struct fsck_data *)priv, inum); tmp___17 = IS_ERR((void const *)fscki1); if (tmp___17 != 0L) { tmp___15 = PTR_ERR((void const *)fscki1); err = (int )tmp___15; tmp___16 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while processing entry node and trying to find parent inode node %lu\n", tmp___16->pid, "check_leaf", err, inum); goto out_dump; } else { } nlen = (int )dent->nlen; if (type == 3) { fscki1->calc_xcnt = fscki1->calc_xcnt + 1LL; fscki1->calc_xsz = (long long )((unsigned long long )fscki1->calc_xsz + ((unsigned long long )((unsigned long )nlen + 64UL) & 0xfffffffffffffff8ULL)); fscki1->calc_xsz = (long long )((unsigned long long )fscki1->calc_xsz + (((unsigned long long )fscki->size + 168ULL) & 0xfffffffffffffff8ULL)); fscki1->calc_xnms = fscki1->calc_xnms + (long long )nlen; } else { fscki1->calc_sz = (long long )((unsigned long long )fscki1->calc_sz + ((unsigned long long )((unsigned long )nlen + 64UL) & 0xfffffffffffffff8ULL)); if ((unsigned int )dent->type == 1U) { fscki1->calc_cnt = fscki1->calc_cnt + 1; } else { } } } out: kfree((void const *)node); return (0); out_dump: printk("\rUBIFS: dump of node at LEB %d:%d\n", zbr->lnum, zbr->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)node); out_free: kfree((void const *)node); return (err); } } static void free_inodes(struct fsck_data *fsckd ) { struct rb_node *this ; struct fsck_inode *fscki ; struct rb_node const *__mptr ; { this = fsckd->inodes.rb_node; goto ldv_29235; ldv_29234: ; if ((unsigned long )this->rb_left != (unsigned long )((struct rb_node *)0)) { this = this->rb_left; } else if ((unsigned long )this->rb_right != (unsigned long )((struct rb_node *)0)) { this = this->rb_right; } else { __mptr = (struct rb_node const *)this; fscki = (struct fsck_inode *)__mptr; this = (struct rb_node *)(this->__rb_parent_color & 0xfffffffffffffffcUL); if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { if ((unsigned long )this->rb_left == (unsigned long )(& fscki->rb)) { this->rb_left = 0; } else { this->rb_right = 0; } } else { } kfree((void const *)fscki); } ldv_29235: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_29234; } else { } return; } } static int check_inodes(struct ubifs_info *c , struct fsck_data *fsckd ) { int n ; int err ; union ubifs_key key ; struct ubifs_znode *znode ; struct ubifs_zbranch *zbr ; struct ubifs_ino_node *ino ; struct fsck_inode *fscki ; struct rb_node *this ; struct rb_node *tmp ; struct rb_node const *__mptr ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; struct task_struct *tmp___6 ; struct task_struct *tmp___7 ; struct task_struct *tmp___8 ; struct task_struct *tmp___9 ; void *tmp___10 ; struct task_struct *tmp___11 ; { tmp = rb_first((struct rb_root const *)(& fsckd->inodes)); this = tmp; goto ldv_29254; ldv_29253: __mptr = (struct rb_node const *)this; fscki = (struct fsck_inode *)__mptr; this = rb_next((struct rb_node const *)this); if (((int )fscki->mode & 61440) == 16384) { if (fscki->inum != 1UL && fscki->references != 1) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: directory inode %lu has %d direntries which refer it, but should be 1\n", tmp___0->pid, "check_inodes", fscki->inum, fscki->references); goto out_dump; } else { } if (fscki->inum == 1UL && fscki->references != 0) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: root inode %lu has non-zero (%d) direntries which refer it\n", tmp___1->pid, "check_inodes", fscki->inum, fscki->references); goto out_dump; } else { } if (fscki->calc_sz != fscki->size) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: directory inode %lu size is %lld, but calculated size is %lld\n", tmp___2->pid, "check_inodes", fscki->inum, fscki->size, fscki->calc_sz); goto out_dump; } else { } if ((unsigned int )fscki->calc_cnt != fscki->nlink) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: directory inode %lu nlink is %d, but calculated nlink is %d\n", tmp___3->pid, "check_inodes", fscki->inum, fscki->nlink, fscki->calc_cnt); goto out_dump; } else { } } else if ((unsigned int )fscki->references != fscki->nlink) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu nlink is %d, but calculated nlink is %d\n", tmp___4->pid, "check_inodes", fscki->inum, fscki->nlink, fscki->references); goto out_dump; } else { } if ((long long )fscki->xattr_sz != fscki->calc_xsz) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu has xattr size %u, but calculated size is %lld\n", tmp___5->pid, "check_inodes", fscki->inum, fscki->xattr_sz, fscki->calc_xsz); goto out_dump; } else { } if ((long long )fscki->xattr_cnt != fscki->calc_xcnt) { tmp___6 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu has %u xattrs, but calculated count is %lld\n", tmp___6->pid, "check_inodes", fscki->inum, fscki->xattr_cnt, fscki->calc_xcnt); goto out_dump; } else { } if ((long long )fscki->xattr_nms != fscki->calc_xnms) { tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu has xattr names\' size %u, but calculated names\' size is %lld\n", tmp___7->pid, "check_inodes", fscki->inum, fscki->xattr_nms, fscki->calc_xnms); goto out_dump; } else { } ldv_29254: ; if ((unsigned long )this != (unsigned long )((struct rb_node *)0)) { goto ldv_29253; } else { } return (0); out_dump: ino_key_init((struct ubifs_info const *)c, & key, fscki->inum); err = ubifs_lookup_level0(c, (union ubifs_key const *)(& key), & znode, & n); if (err == 0) { tmp___8 = get_current(); printk("\vUBIFS error (pid %d): %s: inode %lu not found in index\n", tmp___8->pid, "check_inodes", fscki->inum); return (-2); } else if (err < 0) { tmp___9 = get_current(); printk("\vUBIFS error (pid %d): %s: error %d while looking up inode %lu\n", tmp___9->pid, "check_inodes", err, fscki->inum); return (err); } else { } zbr = (struct ubifs_zbranch *)(& znode->zbranch) + (unsigned long )n; tmp___10 = kmalloc((size_t )zbr->len, 80U); ino = (struct ubifs_ino_node *)tmp___10; if ((unsigned long )ino == (unsigned long )((struct ubifs_ino_node *)0)) { return (-12); } else { } err = ubifs_tnc_read_node(c, zbr, (void *)ino); if (err != 0) { tmp___11 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot read inode node at LEB %d:%d, error %d\n", tmp___11->pid, "check_inodes", zbr->lnum, zbr->offs, err); kfree((void const *)ino); return (err); } else { } printk("\rUBIFS: dump of the inode %lu sitting in LEB %d:%d\n", fscki->inum, zbr->lnum, zbr->offs); ubifs_dump_node((struct ubifs_info const *)c, (void const *)ino); kfree((void const *)ino); return (-22); } } int dbg_check_filesystem(struct ubifs_info *c ) { int err ; struct fsck_data fsckd ; int tmp ; struct rb_root __constr_expr_0 ; struct task_struct *tmp___0 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } __constr_expr_0.rb_node = 0; fsckd.inodes = __constr_expr_0; err = dbg_walk_index(c, & check_leaf, 0, (void *)(& fsckd)); if (err != 0) { goto out_free; } else { } err = check_inodes(c, & fsckd); if (err != 0) { goto out_free; } else { } free_inodes(& fsckd); return (0); out_free: tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: file-system check failed with error %d\n", tmp___0->pid, "dbg_check_filesystem", err); dump_stack(); free_inodes(& fsckd); return (err); } } int dbg_check_data_nodes_order(struct ubifs_info *c , struct list_head *head ) { struct list_head *cur ; struct ubifs_scan_node *sa ; struct ubifs_scan_node *sb ; int tmp ; ino_t inuma ; ino_t inumb ; uint32_t blka ; uint32_t blkb ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } cur = head->next; goto ldv_29284; ldv_29283: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/debug.c.prepared", 2443, 0); _cond_resched(); __mptr = (struct list_head const *)cur; sa = (struct ubifs_scan_node *)__mptr; __mptr___0 = (struct list_head const *)cur->next; sb = (struct ubifs_scan_node *)__mptr___0; if (sa->type != 1) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type %d\n", tmp___0->pid, "dbg_check_data_nodes_order", sa->type); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sa->node); return (-22); } else { } if (sb->type != 1) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type %d\n", tmp___1->pid, "dbg_check_data_nodes_order", sb->type); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sb->node); return (-22); } else { } inuma = key_inum((struct ubifs_info const *)c, (void const *)(& sa->key)); inumb = key_inum((struct ubifs_info const *)c, (void const *)(& sb->key)); if (inuma < inumb) { goto ldv_29281; } else { } if (inuma > inumb) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: larger inum %lu goes before inum %lu\n", tmp___2->pid, "dbg_check_data_nodes_order", inuma, inumb); goto error_dump; } else { } blka = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); blkb = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); if (blka > blkb) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: larger block %u goes before %u\n", tmp___3->pid, "dbg_check_data_nodes_order", blka, blkb); goto error_dump; } else { } if (blka == blkb) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: two data nodes for the same block\n", tmp___4->pid, "dbg_check_data_nodes_order"); goto error_dump; } else { } ldv_29281: cur = cur->next; ldv_29284: ; if ((unsigned long )cur->next != (unsigned long )head) { goto ldv_29283; } else { } return (0); error_dump: ubifs_dump_node((struct ubifs_info const *)c, (void const *)sa->node); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sb->node); return (-22); } } int dbg_check_nondata_nodes_order(struct ubifs_info *c , struct list_head *head ) { struct list_head *cur ; struct ubifs_scan_node *sa ; struct ubifs_scan_node *sb ; int tmp ; ino_t inuma ; ino_t inumb ; uint32_t hasha ; uint32_t hashb ; struct list_head const *__mptr ; struct list_head const *__mptr___0 ; struct task_struct *tmp___0 ; struct task_struct *tmp___1 ; struct task_struct *tmp___2 ; struct task_struct *tmp___3 ; struct task_struct *tmp___4 ; struct task_struct *tmp___5 ; { tmp = dbg_is_chk_gen((struct ubifs_info const *)c); if (tmp == 0) { return (0); } else { } cur = head->next; goto ldv_29306; ldv_29305: __might_sleep("/home/mikhail/launches/cpachecker-regression/launcher-working-dir/ldv-manager-work-dir/work/current--X--fs/ubifs/ubifs.ko--X--regression-testlinux-3.8-rc1--X--32_7a--X--cpachecker/linux-3.8-rc1/csd_deg_dscv/38/dscv_tempdir/dscv/ri/32_7a/fs/ubifs/debug.c.prepared", 2510, 0); _cond_resched(); __mptr = (struct list_head const *)cur; sa = (struct ubifs_scan_node *)__mptr; __mptr___0 = (struct list_head const *)cur->next; sb = (struct ubifs_scan_node *)__mptr___0; if ((sa->type != 0 && sa->type != 2) && sa->type != 3) { tmp___0 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type %d\n", tmp___0->pid, "dbg_check_nondata_nodes_order", sa->type); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sa->node); return (-22); } else { } if ((sa->type != 0 && sa->type != 2) && sa->type != 3) { tmp___1 = get_current(); printk("\vUBIFS error (pid %d): %s: bad node type %d\n", tmp___1->pid, "dbg_check_nondata_nodes_order", sb->type); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sb->node); return (-22); } else { } if (sa->type != 0 && sb->type == 0) { tmp___2 = get_current(); printk("\vUBIFS error (pid %d): %s: non-inode node goes before inode node\n", tmp___2->pid, "dbg_check_nondata_nodes_order"); goto error_dump; } else { } if (sa->type == 0 && sb->type != 0) { goto ldv_29304; } else { } if (sa->type == 0 && sb->type == 0) { if (sa->len < sb->len) { tmp___3 = get_current(); printk("\vUBIFS error (pid %d): %s: smaller inode node goes first\n", tmp___3->pid, "dbg_check_nondata_nodes_order"); goto error_dump; } else { } goto ldv_29304; } else { } inuma = key_inum((struct ubifs_info const *)c, (void const *)(& sa->key)); inumb = key_inum((struct ubifs_info const *)c, (void const *)(& sb->key)); if (inuma < inumb) { goto ldv_29304; } else { } if (inuma > inumb) { tmp___4 = get_current(); printk("\vUBIFS error (pid %d): %s: larger inum %lu goes before inum %lu\n", tmp___4->pid, "dbg_check_nondata_nodes_order", inuma, inumb); goto error_dump; } else { } hasha = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& sa->key)); hashb = key_block((struct ubifs_info const *)c, (union ubifs_key const *)(& sb->key)); if (hasha > hashb) { tmp___5 = get_current(); printk("\vUBIFS error (pid %d): %s: larger hash %u goes before %u\n", tmp___5->pid, "dbg_check_nondata_nodes_order", hasha, hashb); goto error_dump; } else { } ldv_29304: cur = cur->next; ldv_29306: ; if ((unsigned long )cur->next != (unsigned long )head) { goto ldv_29305; } else { } return (0); error_dump: printk("\rUBIFS: dumping first node\n"); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sa->node); printk("\rUBIFS: dumping second node\n"); ubifs_dump_node((struct ubifs_info const *)c, (void const *)sb->node); return (-22); return (0); } } __inline static int chance(unsigned int n , unsigned int out_of ) { u32 tmp ; { tmp = prandom_u32(); return (tmp % out_of + 1U <= n); } } static int power_cut_emulated(struct ubifs_info *c , int lnum , int write ) { struct ubifs_debug_info *d ; struct task_struct *tmp ; int tmp___0 ; long tmp___1 ; unsigned long delay ; u32 tmp___2 ; unsigned long tmp___3 ; struct task_struct *tmp___4 ; u32 tmp___5 ; struct task_struct *tmp___6 ; int tmp___7 ; int tmp___8 ; unsigned int tmp___9 ; int tmp___10 ; int tmp___11 ; struct task_struct *tmp___12 ; int tmp___13 ; struct task_struct *tmp___14 ; int tmp___15 ; int tmp___16 ; struct task_struct *tmp___17 ; int tmp___18 ; int tmp___19 ; struct task_struct *tmp___20 ; int tmp___21 ; int tmp___22 ; struct task_struct *tmp___23 ; int tmp___24 ; struct task_struct *tmp___25 ; int tmp___26 ; struct task_struct *tmp___27 ; int tmp___28 ; struct task_struct *tmp___29 ; int tmp___30 ; struct task_struct *tmp___31 ; int tmp___32 ; struct task_struct *tmp___33 ; struct ubifs_bud *tmp___34 ; struct task_struct *tmp___35 ; { d = c->dbg; tmp___0 = dbg_is_chk_gen((struct ubifs_info const *)c); tmp___1 = ldv__builtin_expect(tmp___0 == 0, 0L); if (tmp___1 != 0L) { tmp = get_current(); printk("\nUBIFS assert failed in %s at %u (pid %d)\n", "power_cut_emulated", 2590, tmp->pid); dump_stack(); } else { } if (d->pc_cnt == 0U) { tmp___8 = chance(1U, 2U); if (tmp___8 != 0) { tmp___7 = chance(1U, 2U); if (tmp___7 != 0) { d->pc_delay = 1; tmp___2 = prandom_u32(); delay = (unsigned long )(tmp___2 % 60000U); d->pc_timeout = jiffies; tmp___3 = msecs_to_jiffies((unsigned int const )delay); d->pc_timeout = d->pc_timeout + tmp___3; tmp___4 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing after %lums\n", tmp___4->pid, "power_cut_emulated", delay); } else { d->pc_delay = 2; tmp___5 = prandom_u32(); delay = (unsigned long )(tmp___5 % 10000U); d->pc_cnt_max = (unsigned int )delay; tmp___6 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing after %lu calls\n", tmp___6->pid, "power_cut_emulated", delay); } } else { } d->pc_cnt = d->pc_cnt + 1U; } else { } if (d->pc_delay == 1 && (long )jiffies - (long )d->pc_timeout < 0L) { return (0); } else { } if (d->pc_delay == 2) { tmp___9 = d->pc_cnt; d->pc_cnt = d->pc_cnt + 1U; if (tmp___9 < d->pc_cnt_max) { return (0); } else { } } else { } if (lnum == 0) { if (write != 0) { tmp___10 = chance(1U, 2U); if (tmp___10 != 0) { return (0); } else { } } else { } tmp___11 = chance(19U, 20U); if (tmp___11 != 0) { return (0); } else { } tmp___12 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in super block LEB %d\n", tmp___12->pid, "power_cut_emulated", lnum); } else if (lnum == 1 || lnum == 2) { tmp___13 = chance(19U, 20U); if (tmp___13 != 0) { return (0); } else { } tmp___14 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in master LEB %d\n", tmp___14->pid, "power_cut_emulated", lnum); } else if (lnum > 2 && c->log_last >= lnum) { if (write != 0) { tmp___15 = chance(99U, 100U); if (tmp___15 != 0) { return (0); } else { } } else { } tmp___16 = chance(399U, 400U); if (tmp___16 != 0) { return (0); } else { } tmp___17 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in log LEB %d\n", tmp___17->pid, "power_cut_emulated", lnum); } else if (c->lpt_first <= lnum && c->lpt_last >= lnum) { if (write != 0) { tmp___18 = chance(7U, 8U); if (tmp___18 != 0) { return (0); } else { } } else { } tmp___19 = chance(19U, 20U); if (tmp___19 != 0) { return (0); } else { } tmp___20 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in LPT LEB %d\n", tmp___20->pid, "power_cut_emulated", lnum); } else if (c->orph_first <= lnum && c->orph_last >= lnum) { if (write != 0) { tmp___21 = chance(1U, 2U); if (tmp___21 != 0) { return (0); } else { } } else { } tmp___22 = chance(9U, 10U); if (tmp___22 != 0) { return (0); } else { } tmp___23 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in orphan LEB %d\n", tmp___23->pid, "power_cut_emulated", lnum); } else if (c->ihead_lnum == lnum) { tmp___24 = chance(99U, 100U); if (tmp___24 != 0) { return (0); } else { } tmp___25 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in index head LEB %d\n", tmp___25->pid, "power_cut_emulated", lnum); } else if ((unsigned long )c->jheads != (unsigned long )((struct ubifs_jhead *)0) && (c->jheads)->wbuf.lnum == lnum) { tmp___26 = chance(9U, 10U); if (tmp___26 != 0) { return (0); } else { } tmp___27 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in GC head LEB %d\n", tmp___27->pid, "power_cut_emulated", lnum); } else if (write != 0 && (unsigned long )c->buds.rb_node != (unsigned long )((struct rb_node *)0)) { tmp___34 = ubifs_search_bud(c, lnum); if ((unsigned long )tmp___34 == (unsigned long )((struct ubifs_bud *)0)) { tmp___28 = chance(19U, 20U); if (tmp___28 != 0) { return (0); } else { } tmp___29 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in non-bud LEB %d\n", tmp___29->pid, "power_cut_emulated", lnum); } else { goto _L; } } else _L: /* CIL Label */ if (c->cmt_state == 3 || c->cmt_state == 4) { tmp___30 = chance(999U, 1000U); if (tmp___30 != 0) { return (0); } else { } tmp___31 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in bud LEB %d commit running\n", tmp___31->pid, "power_cut_emulated", lnum); } else { tmp___32 = chance(9999U, 10000U); if (tmp___32 != 0) { return (0); } else { } tmp___33 = get_current(); printk("\fUBIFS warning (pid %d): %s: failing in bud LEB %d commit not running\n", tmp___33->pid, "power_cut_emulated", lnum); } d->pc_happened = 1; tmp___35 = get_current(); printk("\fUBIFS warning (pid %d): %s: ========== Power cut emulated ==========\n", tmp___35->pid, "power_cut_emulated"); dump_stack(); return (1); } } static int corrupt_data(struct ubifs_info const *c , void const *buf , unsigned int len ) { unsigned int from ; unsigned int to ; unsigned int ffs___0 ; int tmp ; unsigned char *p ; u32 tmp___0 ; unsigned int _min1 ; unsigned int _min2 ; struct task_struct *tmp___1 ; { tmp = chance(1U, 2U); ffs___0 = (unsigned int )tmp; p = (unsigned char *)buf; tmp___0 = prandom_u32(); from = tmp___0 % (len + 1U); _min1 = len; _min2 = (((unsigned int )c->max_write_size + from) - 1U) & - ((unsigned int )c->max_write_size); to = _min1 < _min2 ? _min1 : _min2; tmp___1 = get_current(); printk("\fUBIFS warning (pid %d): %s: filled bytes %u-%u with %s\n", tmp___1->pid, "corrupt_data", from, to - 1U, ffs___0 != 0U ? (char *)"0xFFs" : (char *)"random data"); if (ffs___0 != 0U) { memset((void *)p + (unsigned long )from, 255, (size_t )(to - from)); } else { prandom_bytes((void *)p + (unsigned long )from, (int )(to - from)); } return ((int )to); } } int dbg_leb_write(struct ubifs_info *c , int lnum , void const *buf , int offs , int len ) { int err ; int failing ; struct task_struct *tmp ; { if ((c->dbg)->pc_happened != 0) { return (-30); } else { } failing = power_cut_emulated(c, lnum, 1); if (failing != 0) { len = corrupt_data((struct ubifs_info const *)c, buf, (unsigned int )len); } else { } tmp = get_current(); printk("\fUBIFS warning (pid %d): %s: actually write %d bytes to LEB %d:%d (the buffer was corrupted)\n", tmp->pid, "dbg_leb_write", len, lnum, offs); err = ubi_leb_write(c->ubi, lnum, buf, offs, len); if (err != 0) { return (err); } else { } if (failing != 0) { return (-30); } else { } return (0); } } int dbg_leb_change(struct ubifs_info *c , int lnum , void const *buf , int len ) { int err ; int tmp ; int tmp___0 ; { if ((c->dbg)->pc_happened != 0) { return (-30); } else { } tmp = power_cut_emulated(c, lnum, 1); if (tmp != 0) { return (-30); } else { } err = ubi_leb_change(c->ubi, lnum, buf, len); if (err != 0) { return (err); } else { } tmp___0 = power_cut_emulated(c, lnum, 1); if (tmp___0 != 0) { return (-30); } else { } return (0); } } int dbg_leb_unmap(struct ubifs_info *c , int lnum ) { int err ; int tmp ; int tmp___0 ; { if ((c->dbg)->pc_happened != 0) { return (-30); } else { } tmp = power_cut_emulated(c, lnum, 0); if (tmp != 0) { return (-30); } else { } err = ubi_leb_unmap(c->ubi, lnum); if (err != 0) { return (err); } else { } tmp___0 = power_cut_emulated(c, lnum, 0); if (tmp___0 != 0) { return (-30); } else { } return (0); } } int dbg_leb_map(struct ubifs_info *c , int lnum ) { int err ; int tmp ; int tmp___0 ; { if ((c->dbg)->pc_happened != 0) { return (-30); } else { } tmp = power_cut_emulated(c, lnum, 0); if (tmp != 0) { return (-30); } else { } err = ubi_leb_map(c->ubi, lnum); if (err != 0) { return (err); } else { } tmp___0 = power_cut_emulated(c, lnum, 0); if (tmp___0 != 0) { return (-30); } else { } return (0); } } static struct dentry *dfs_rootdir ; static int dfs_file_open(struct inode *inode , struct file *file ) { int tmp ; { file->private_data = inode->i_private; tmp = nonseekable_open(inode, file); return (tmp); } } static int provide_user_output(int val , char *u , size_t count , loff_t *ppos ) { char buf[3U] ; ssize_t tmp ; { if (val != 0) { buf[0] = 49; } else { buf[0] = 48; } buf[1] = 10; buf[2] = 0; tmp = simple_read_from_buffer((void *)u, count, ppos, (void const *)(& buf), 2UL); return ((int )tmp); } } static ssize_t dfs_file_read(struct file *file , char *u , size_t count , loff_t *ppos ) { struct dentry *dent ; struct ubifs_info *c ; struct ubifs_debug_info *d ; int val ; int tmp ; { dent = file->f_path.dentry; c = (struct ubifs_info *)file->private_data; d = c->dbg; if ((unsigned long )d->dfs_chk_gen == (unsigned long )dent) { val = (int )d->chk_gen; } else if ((unsigned long )d->dfs_chk_index == (unsigned long )dent) { val = (int )d->chk_index; } else if ((unsigned long )d->dfs_chk_orph == (unsigned long )dent) { val = (int )d->chk_orph; } else if ((unsigned long )d->dfs_chk_lprops == (unsigned long )dent) { val = (int )d->chk_lprops; } else if ((unsigned long )d->dfs_chk_fs == (unsigned long )dent) { val = (int )d->chk_fs; } else if ((unsigned long )d->dfs_tst_rcvry == (unsigned long )dent) { val = (int )d->tst_rcvry; } else if ((unsigned long )d->dfs_ro_error == (unsigned long )dent) { val = (int )c->ro_error; } else { return (-22L); } tmp = provide_user_output(val, u, count, ppos); return ((ssize_t )tmp); } } static int interpret_user_input(char const *u , size_t count ) { size_t buf_size ; char buf[8U] ; size_t __min1 ; size_t __min2 ; unsigned long tmp ; { __min1 = count; __min2 = 7UL; buf_size = __min1 < __min2 ? __min1 : __min2; tmp = copy_from_user((void *)(& buf), (void const *)u, buf_size); if (tmp != 0UL) { return (-14); } else { } if ((int )((signed char )buf[0]) == 49) { return (1); } else if ((int )((signed char )buf[0]) == 48) { return (0); } else { } return (-22); } } static ssize_t dfs_file_write(struct file *file , char const *u , size_t count , loff_t *ppos ) { struct ubifs_info *c ; struct ubifs_debug_info *d ; struct dentry *dent ; int val ; { c = (struct ubifs_info *)file->private_data; d = c->dbg; dent = file->f_path.dentry; if ((unsigned long )file->f_path.dentry == (unsigned long )d->dfs_dump_lprops) { ubifs_dump_lprops(c); return ((ssize_t )count); } else { } if ((unsigned long )file->f_path.dentry == (unsigned long )d->dfs_dump_budg) { ubifs_dump_budg(c, (struct ubifs_budg_info const *)(& c->bi)); return ((ssize_t )count); } else { } if ((unsigned long )file->f_path.dentry == (unsigned long )d->dfs_dump_tnc) { ldv_mutex_lock_764(& c->tnc_mutex); ubifs_dump_tnc(c); ldv_mutex_unlock_765(& c->tnc_mutex); return ((ssize_t )count); } else { } val = interpret_user_input(u, count); if (val < 0) { return ((ssize_t )val); } else { } if ((unsigned long )d->dfs_chk_gen == (unsigned long )dent) { d->chk_gen = (unsigned char )val; } else if ((unsigned long )d->dfs_chk_index == (unsigned long )dent) { d->chk_index = (unsigned char )val; } else if ((unsigned long )d->dfs_chk_orph == (unsigned long )dent) { d->chk_orph = (unsigned char )val; } else if ((unsigned long )d->dfs_chk_lprops == (unsigned long )dent) { d->chk_lprops = (unsigned char )val; } else if ((unsigned long )d->dfs_chk_fs == (unsigned long )dent) { d->chk_fs = (unsigned char )val; } else if ((unsigned long )d->dfs_tst_rcvry == (unsigned long )dent) { d->tst_rcvry = (unsigned char )val; } else if ((unsigned long )d->dfs_ro_error == (unsigned long )dent) { c->ro_error = val != 0; } else { return (-22L); } return ((ssize_t )count); } } static struct file_operations const dfs_fops = {& __this_module, & no_llseek, & dfs_file_read, & dfs_file_write, 0, 0, 0, 0, 0, 0, 0, & dfs_file_open, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int dbg_debugfs_init_fs(struct ubifs_info *c ) { int err ; int n ; char const *fname ; struct dentry *dent ; struct ubifs_debug_info *d ; void *tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; long tmp___7 ; long tmp___8 ; long tmp___9 ; long tmp___10 ; long tmp___11 ; struct task_struct *tmp___12 ; { d = c->dbg; n = snprintf((char *)(& d->dfs_dir_name), 10UL, "ubi%d_%d", c->vi.ubi_num, c->vi.vol_id); if (n == 9) { fname = "ubi%d_%d"; tmp = ERR_PTR(-22L); dent = (struct dentry *)tmp; goto out; } else { } fname = (char const *)(& d->dfs_dir_name); dent = debugfs_create_dir(fname, dfs_rootdir); tmp___0 = IS_ERR_OR_NULL((void const *)dent); if (tmp___0 != 0L) { goto out; } else { } d->dfs_dir = dent; fname = "dump_lprops"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)c, & dfs_fops); tmp___1 = IS_ERR_OR_NULL((void const *)dent); if (tmp___1 != 0L) { goto out_remove; } else { } d->dfs_dump_lprops = dent; fname = "dump_budg"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)c, & dfs_fops); tmp___2 = IS_ERR_OR_NULL((void const *)dent); if (tmp___2 != 0L) { goto out_remove; } else { } d->dfs_dump_budg = dent; fname = "dump_tnc"; dent = debugfs_create_file(fname, 128, d->dfs_dir, (void *)c, & dfs_fops); tmp___3 = IS_ERR_OR_NULL((void const *)dent); if (tmp___3 != 0L) { goto out_remove; } else { } d->dfs_dump_tnc = dent; fname = "chk_general"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___4 = IS_ERR_OR_NULL((void const *)dent); if (tmp___4 != 0L) { goto out_remove; } else { } d->dfs_chk_gen = dent; fname = "chk_index"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___5 = IS_ERR_OR_NULL((void const *)dent); if (tmp___5 != 0L) { goto out_remove; } else { } d->dfs_chk_index = dent; fname = "chk_orphans"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___6 = IS_ERR_OR_NULL((void const *)dent); if (tmp___6 != 0L) { goto out_remove; } else { } d->dfs_chk_orph = dent; fname = "chk_lprops"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___7 = IS_ERR_OR_NULL((void const *)dent); if (tmp___7 != 0L) { goto out_remove; } else { } d->dfs_chk_lprops = dent; fname = "chk_fs"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___8 = IS_ERR_OR_NULL((void const *)dent); if (tmp___8 != 0L) { goto out_remove; } else { } d->dfs_chk_fs = dent; fname = "tst_recovery"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___9 = IS_ERR_OR_NULL((void const *)dent); if (tmp___9 != 0L) { goto out_remove; } else { } d->dfs_tst_rcvry = dent; fname = "ro_error"; dent = debugfs_create_file(fname, 384, d->dfs_dir, (void *)c, & dfs_fops); tmp___10 = IS_ERR_OR_NULL((void const *)dent); if (tmp___10 != 0L) { goto out_remove; } else { } d->dfs_ro_error = dent; return (0); out_remove: debugfs_remove_recursive(d->dfs_dir); out: ; if ((unsigned long )dent != (unsigned long )((struct dentry *)0)) { tmp___11 = PTR_ERR((void const *)dent); err = (int )tmp___11; } else { err = -19; } tmp___12 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot create \"%s\" debugfs file or directory, error %d\n\n", tmp___12->pid, "dbg_debugfs_init_fs", fname, err); return (err); } } void dbg_debugfs_exit_fs(struct ubifs_info *c ) { { debugfs_remove_recursive((c->dbg)->dfs_dir); return; } } static struct dentry *dfs_chk_gen ; static struct dentry *dfs_chk_index ; static struct dentry *dfs_chk_orph ; static struct dentry *dfs_chk_lprops ; static struct dentry *dfs_chk_fs ; static struct dentry *dfs_tst_rcvry ; static ssize_t dfs_global_file_read(struct file *file , char *u , size_t count , loff_t *ppos ) { struct dentry *dent ; int val ; int tmp ; { dent = file->f_path.dentry; if ((unsigned long )dent == (unsigned long )dfs_chk_gen) { val = (int )ubifs_dbg.chk_gen; } else if ((unsigned long )dent == (unsigned long )dfs_chk_index) { val = (int )ubifs_dbg.chk_index; } else if ((unsigned long )dent == (unsigned long )dfs_chk_orph) { val = (int )ubifs_dbg.chk_orph; } else if ((unsigned long )dent == (unsigned long )dfs_chk_lprops) { val = (int )ubifs_dbg.chk_lprops; } else if ((unsigned long )dent == (unsigned long )dfs_chk_fs) { val = (int )ubifs_dbg.chk_fs; } else if ((unsigned long )dent == (unsigned long )dfs_tst_rcvry) { val = (int )ubifs_dbg.tst_rcvry; } else { return (-22L); } tmp = provide_user_output(val, u, count, ppos); return ((ssize_t )tmp); } } static ssize_t dfs_global_file_write(struct file *file , char const *u , size_t count , loff_t *ppos ) { struct dentry *dent ; int val ; { dent = file->f_path.dentry; val = interpret_user_input(u, count); if (val < 0) { return ((ssize_t )val); } else { } if ((unsigned long )dent == (unsigned long )dfs_chk_gen) { ubifs_dbg.chk_gen = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )dfs_chk_index) { ubifs_dbg.chk_index = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )dfs_chk_orph) { ubifs_dbg.chk_orph = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )dfs_chk_lprops) { ubifs_dbg.chk_lprops = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )dfs_chk_fs) { ubifs_dbg.chk_fs = (unsigned char )val; } else if ((unsigned long )dent == (unsigned long )dfs_tst_rcvry) { ubifs_dbg.tst_rcvry = (unsigned char )val; } else { return (-22L); } return ((ssize_t )count); } } static struct file_operations const dfs_global_fops = {& __this_module, & no_llseek, & dfs_global_file_read, & dfs_global_file_write, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int dbg_debugfs_init(void) { int err ; char const *fname ; struct dentry *dent ; long tmp ; long tmp___0 ; long tmp___1 ; long tmp___2 ; long tmp___3 ; long tmp___4 ; long tmp___5 ; long tmp___6 ; struct task_struct *tmp___7 ; { fname = "ubifs"; dent = debugfs_create_dir(fname, 0); tmp = IS_ERR_OR_NULL((void const *)dent); if (tmp != 0L) { goto out; } else { } dfs_rootdir = dent; fname = "chk_general"; dent = debugfs_create_file(fname, 384, dfs_rootdir, 0, & dfs_global_fops); tmp___0 = IS_ERR_OR_NULL((void const *)dent); if (tmp___0 != 0L) { goto out_remove; } else { } dfs_chk_gen = dent; fname = "chk_index"; dent = debugfs_create_file(fname, 384, dfs_rootdir, 0, & dfs_global_fops); tmp___1 = IS_ERR_OR_NULL((void const *)dent); if (tmp___1 != 0L) { goto out_remove; } else { } dfs_chk_index = dent; fname = "chk_orphans"; dent = debugfs_create_file(fname, 384, dfs_rootdir, 0, & dfs_global_fops); tmp___2 = IS_ERR_OR_NULL((void const *)dent); if (tmp___2 != 0L) { goto out_remove; } else { } dfs_chk_orph = dent; fname = "chk_lprops"; dent = debugfs_create_file(fname, 384, dfs_rootdir, 0, & dfs_global_fops); tmp___3 = IS_ERR_OR_NULL((void const *)dent); if (tmp___3 != 0L) { goto out_remove; } else { } dfs_chk_lprops = dent; fname = "chk_fs"; dent = debugfs_create_file(fname, 384, dfs_rootdir, 0, & dfs_global_fops); tmp___4 = IS_ERR_OR_NULL((void const *)dent); if (tmp___4 != 0L) { goto out_remove; } else { } dfs_chk_fs = dent; fname = "tst_recovery"; dent = debugfs_create_file(fname, 384, dfs_rootdir, 0, & dfs_global_fops); tmp___5 = IS_ERR_OR_NULL((void const *)dent); if (tmp___5 != 0L) { goto out_remove; } else { } dfs_tst_rcvry = dent; return (0); out_remove: debugfs_remove_recursive(dfs_rootdir); out: ; if ((unsigned long )dent != (unsigned long )((struct dentry *)0)) { tmp___6 = PTR_ERR((void const *)dent); err = (int )tmp___6; } else { err = -19; } tmp___7 = get_current(); printk("\vUBIFS error (pid %d): %s: cannot create \"%s\" debugfs file or directory, error %d\n\n", tmp___7->pid, "dbg_debugfs_init", fname, err); return (err); } } void dbg_debugfs_exit(void) { { debugfs_remove_recursive(dfs_rootdir); return; } } int ubifs_debugging_init(struct ubifs_info *c ) { void *tmp ; { tmp = kzalloc(344UL, 208U); c->dbg = (struct ubifs_debug_info *)tmp; if ((unsigned long )c->dbg == (unsigned long )((struct ubifs_debug_info *)0)) { return (-12); } else { } return (0); } } void ubifs_debugging_exit(struct ubifs_info *c ) { { kfree((void const *)c->dbg); return; } } extern void ldv_check_return_value(int ) ; void ldv_main26_sequence_infinite_withcheck_stateful(void) { struct inode *var_group1 ; struct file *var_group2 ; int res_dfs_file_open_52 ; char *var_dfs_file_read_54_p1 ; size_t var_dfs_file_read_54_p2 ; loff_t *var_dfs_file_read_54_p3 ; ssize_t res_dfs_file_read_54 ; char const *var_dfs_file_write_56_p1 ; size_t var_dfs_file_write_56_p2 ; loff_t *var_dfs_file_write_56_p3 ; ssize_t res_dfs_file_write_56 ; char *var_dfs_global_file_read_59_p1 ; size_t var_dfs_global_file_read_59_p2 ; loff_t *var_dfs_global_file_read_59_p3 ; ssize_t res_dfs_global_file_read_59 ; char const *var_dfs_global_file_write_60_p1 ; size_t var_dfs_global_file_write_60_p2 ; loff_t *var_dfs_global_file_write_60_p3 ; ssize_t res_dfs_global_file_write_60 ; int ldv_s_dfs_fops_file_operations ; int ldv_s_dfs_global_fops_file_operations ; int tmp ; int tmp___0 ; { ldv_s_dfs_fops_file_operations = 0; ldv_s_dfs_global_fops_file_operations = 0; LDV_IN_INTERRUPT = 1; ldv_initialize(); goto ldv_29510; ldv_29509: tmp = __VERIFIER_nondet_int(); switch (tmp) { case 0: ; if (ldv_s_dfs_fops_file_operations == 0) { ldv_handler_precall(); res_dfs_file_open_52 = dfs_file_open(var_group1, var_group2); ldv_check_return_value(res_dfs_file_open_52); if (res_dfs_file_open_52 != 0) { goto ldv_module_exit; } else { } ldv_s_dfs_fops_file_operations = ldv_s_dfs_fops_file_operations + 1; } else { } goto ldv_29503; case 1: ; if (ldv_s_dfs_fops_file_operations == 1) { ldv_handler_precall(); res_dfs_file_read_54 = dfs_file_read(var_group2, var_dfs_file_read_54_p1, var_dfs_file_read_54_p2, var_dfs_file_read_54_p3); ldv_check_return_value((int )res_dfs_file_read_54); if (res_dfs_file_read_54 < 0L) { goto ldv_module_exit; } else { } ldv_s_dfs_fops_file_operations = ldv_s_dfs_fops_file_operations + 1; } else { } goto ldv_29503; case 2: ; if (ldv_s_dfs_fops_file_operations == 2) { ldv_handler_precall(); res_dfs_file_write_56 = dfs_file_write(var_group2, var_dfs_file_write_56_p1, var_dfs_file_write_56_p2, var_dfs_file_write_56_p3); ldv_check_return_value((int )res_dfs_file_write_56); if (res_dfs_file_write_56 < 0L) { goto ldv_module_exit; } else { } ldv_s_dfs_fops_file_operations = 0; } else { } goto ldv_29503; case 3: ; if (ldv_s_dfs_global_fops_file_operations == 0) { ldv_handler_precall(); res_dfs_global_file_read_59 = dfs_global_file_read(var_group2, var_dfs_global_file_read_59_p1, var_dfs_global_file_read_59_p2, var_dfs_global_file_read_59_p3); ldv_check_return_value((int )res_dfs_global_file_read_59); if (res_dfs_global_file_read_59 < 0L) { goto ldv_module_exit; } else { } ldv_s_dfs_global_fops_file_operations = ldv_s_dfs_global_fops_file_operations + 1; } else { } goto ldv_29503; case 4: ; if (ldv_s_dfs_global_fops_file_operations == 1) { ldv_handler_precall(); res_dfs_global_file_write_60 = dfs_global_file_write(var_group2, var_dfs_global_file_write_60_p1, var_dfs_global_file_write_60_p2, var_dfs_global_file_write_60_p3); ldv_check_return_value((int )res_dfs_global_file_write_60); if (res_dfs_global_file_write_60 < 0L) { goto ldv_module_exit; } else { } ldv_s_dfs_global_fops_file_operations = 0; } else { } goto ldv_29503; default: ; goto ldv_29503; } ldv_29503: ; ldv_29510: tmp___0 = __VERIFIER_nondet_int(); if ((tmp___0 != 0 || ldv_s_dfs_fops_file_operations != 0) || ldv_s_dfs_global_fops_file_operations != 0) { goto ldv_29509; } else { } ldv_module_exit: ; ldv_check_final_state(); return; } } void ldv_mutex_lock_751(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lock(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_752(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lock(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_753(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_cred_guard_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_754(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_cred_guard_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_nested_755(struct mutex *ldv_func_arg1 , unsigned int ldv_func_arg2 ) { { ldv_mutex_lock_io_mutex(ldv_func_arg1); mutex_lock_nested(ldv_func_arg1, ldv_func_arg2); return; } } void ldv_mutex_unlock_756(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_io_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_757(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_lp_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_758(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_lp_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_759(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_ui_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_760(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_ui_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_761(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_762(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_unlock_763(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } void ldv_mutex_lock_764(struct mutex *ldv_func_arg1 ) { { ldv_mutex_lock_tnc_mutex(ldv_func_arg1); mutex_lock(ldv_func_arg1); return; } } void ldv_mutex_unlock_765(struct mutex *ldv_func_arg1 ) { { ldv_mutex_unlock_tnc_mutex(ldv_func_arg1); mutex_unlock(ldv_func_arg1); return; } } __inline static void ldv_error(void) __attribute__((__no_instrument_function__)) ; __inline static void ldv_error(void) { { ERROR: {reach_error();abort();} } } extern int __VERIFIER_nondet_int(void) ; long ldv__builtin_expect(long exp , long c ) { { return (exp); } } static int ldv_mutex_bu_mutex ; int ldv_mutex_lock_interruptible_bu_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bu_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_bu_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_bu_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bu_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_bu_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_bu_mutex(struct mutex *lock ) { { if (ldv_mutex_bu_mutex == 1) { } else { ldv_error(); } ldv_mutex_bu_mutex = 2; return; } } int ldv_mutex_trylock_bu_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_bu_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_bu_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_bu_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_bu_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_bu_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_bu_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_bu_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_bu_mutex(struct mutex *lock ) { { if (ldv_mutex_bu_mutex == 2) { } else { ldv_error(); } ldv_mutex_bu_mutex = 1; return; } } static int ldv_mutex_comp_mutex ; int ldv_mutex_lock_interruptible_comp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_comp_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_comp_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_comp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_comp_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_comp_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_comp_mutex(struct mutex *lock ) { { if (ldv_mutex_comp_mutex == 1) { } else { ldv_error(); } ldv_mutex_comp_mutex = 2; return; } } int ldv_mutex_trylock_comp_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_comp_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_comp_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_comp_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_comp_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_comp_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_comp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_comp_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_comp_mutex(struct mutex *lock ) { { if (ldv_mutex_comp_mutex == 2) { } else { ldv_error(); } ldv_mutex_comp_mutex = 1; return; } } static int ldv_mutex_cred_guard_mutex ; int ldv_mutex_lock_interruptible_cred_guard_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_cred_guard_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_cred_guard_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_cred_guard_mutex(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex = 2; return; } } int ldv_mutex_trylock_cred_guard_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_cred_guard_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_cred_guard_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_cred_guard_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_cred_guard_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_cred_guard_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_cred_guard_mutex(struct mutex *lock ) { { if (ldv_mutex_cred_guard_mutex == 2) { } else { ldv_error(); } ldv_mutex_cred_guard_mutex = 1; return; } } static int ldv_mutex_decomp_mutex ; int ldv_mutex_lock_interruptible_decomp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_decomp_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_decomp_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_decomp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_decomp_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_decomp_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_decomp_mutex(struct mutex *lock ) { { if (ldv_mutex_decomp_mutex == 1) { } else { ldv_error(); } ldv_mutex_decomp_mutex = 2; return; } } int ldv_mutex_trylock_decomp_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_decomp_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_decomp_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_decomp_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_decomp_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_decomp_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_decomp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_decomp_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_decomp_mutex(struct mutex *lock ) { { if (ldv_mutex_decomp_mutex == 2) { } else { ldv_error(); } ldv_mutex_decomp_mutex = 1; return; } } static int ldv_mutex_i_mutex ; int ldv_mutex_lock_interruptible_i_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_i_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_i_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_i_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_i_mutex(struct mutex *lock ) { { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } ldv_mutex_i_mutex = 2; return; } } int ldv_mutex_trylock_i_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_i_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_i_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_i_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_i_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_i_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_i_mutex(struct mutex *lock ) { { if (ldv_mutex_i_mutex == 2) { } else { ldv_error(); } ldv_mutex_i_mutex = 1; return; } } static int ldv_mutex_io_mutex ; int ldv_mutex_lock_interruptible_io_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_io_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_io_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_io_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_io_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_io_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_io_mutex(struct mutex *lock ) { { if (ldv_mutex_io_mutex == 1) { } else { ldv_error(); } ldv_mutex_io_mutex = 2; return; } } int ldv_mutex_trylock_io_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_io_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_io_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_io_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_io_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_io_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_io_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_io_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_io_mutex(struct mutex *lock ) { { if (ldv_mutex_io_mutex == 2) { } else { ldv_error(); } ldv_mutex_io_mutex = 1; return; } } static int ldv_mutex_lock ; int ldv_mutex_lock_interruptible_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lock = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lock = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_lock(struct mutex *lock ) { { if (ldv_mutex_lock == 1) { } else { ldv_error(); } ldv_mutex_lock = 2; return; } } int ldv_mutex_trylock_lock(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_lock = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_lock(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_lock == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_lock = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_lock(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lock == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_lock(struct mutex *lock ) { { if (ldv_mutex_lock == 2) { } else { ldv_error(); } ldv_mutex_lock = 1; return; } } static int ldv_mutex_log_mutex ; int ldv_mutex_lock_interruptible_log_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_log_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_log_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_log_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_log_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_log_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_log_mutex(struct mutex *lock ) { { if (ldv_mutex_log_mutex == 1) { } else { ldv_error(); } ldv_mutex_log_mutex = 2; return; } } int ldv_mutex_trylock_log_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_log_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_log_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_log_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_log_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_log_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_log_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_log_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_log_mutex(struct mutex *lock ) { { if (ldv_mutex_log_mutex == 2) { } else { ldv_error(); } ldv_mutex_log_mutex = 1; return; } } static int ldv_mutex_lp_mutex ; int ldv_mutex_lock_interruptible_lp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lp_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lp_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_lp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lp_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_lp_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_lp_mutex(struct mutex *lock ) { { if (ldv_mutex_lp_mutex == 1) { } else { ldv_error(); } ldv_mutex_lp_mutex = 2; return; } } int ldv_mutex_trylock_lp_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_lp_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_lp_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_lp_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_lp_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_lp_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_lp_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_lp_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_lp_mutex(struct mutex *lock ) { { if (ldv_mutex_lp_mutex == 2) { } else { ldv_error(); } ldv_mutex_lp_mutex = 1; return; } } static int ldv_mutex_mst_mutex ; int ldv_mutex_lock_interruptible_mst_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mst_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mst_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_mst_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mst_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_mst_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_mst_mutex(struct mutex *lock ) { { if (ldv_mutex_mst_mutex == 1) { } else { ldv_error(); } ldv_mutex_mst_mutex = 2; return; } } int ldv_mutex_trylock_mst_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_mst_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_mst_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_mst_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_mst_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_mst_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_mst_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_mst_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_mst_mutex(struct mutex *lock ) { { if (ldv_mutex_mst_mutex == 2) { } else { ldv_error(); } ldv_mutex_mst_mutex = 1; return; } } static int ldv_mutex_tnc_mutex ; int ldv_mutex_lock_interruptible_tnc_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_tnc_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_tnc_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_tnc_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_tnc_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_tnc_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_tnc_mutex(struct mutex *lock ) { { if (ldv_mutex_tnc_mutex == 1) { } else { ldv_error(); } ldv_mutex_tnc_mutex = 2; return; } } int ldv_mutex_trylock_tnc_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_tnc_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_tnc_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_tnc_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_tnc_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_tnc_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_tnc_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_tnc_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_tnc_mutex(struct mutex *lock ) { { if (ldv_mutex_tnc_mutex == 2) { } else { ldv_error(); } ldv_mutex_tnc_mutex = 1; return; } } static int ldv_mutex_ui_mutex ; int ldv_mutex_lock_interruptible_ui_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_ui_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_ui_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_ui_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_ui_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_ui_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_ui_mutex(struct mutex *lock ) { { if (ldv_mutex_ui_mutex == 1) { } else { ldv_error(); } ldv_mutex_ui_mutex = 2; return; } } int ldv_mutex_trylock_ui_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_ui_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_ui_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_ui_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_ui_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_ui_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_ui_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_ui_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_ui_mutex(struct mutex *lock ) { { if (ldv_mutex_ui_mutex == 2) { } else { ldv_error(); } ldv_mutex_ui_mutex = 1; return; } } static int ldv_mutex_umount_mutex ; int ldv_mutex_lock_interruptible_umount_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_umount_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_umount_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_umount_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_umount_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_umount_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_umount_mutex(struct mutex *lock ) { { if (ldv_mutex_umount_mutex == 1) { } else { ldv_error(); } ldv_mutex_umount_mutex = 2; return; } } int ldv_mutex_trylock_umount_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_umount_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_umount_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_umount_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_umount_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_umount_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_umount_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_umount_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_umount_mutex(struct mutex *lock ) { { if (ldv_mutex_umount_mutex == 2) { } else { ldv_error(); } ldv_mutex_umount_mutex = 1; return; } } static int ldv_mutex_write_reserve_mutex ; int ldv_mutex_lock_interruptible_write_reserve_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_write_reserve_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_write_reserve_mutex = 2; return (0); } else { return (-4); } } } int ldv_mutex_lock_killable_write_reserve_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_write_reserve_mutex == 1) { } else { ldv_error(); } nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { ldv_mutex_write_reserve_mutex = 2; return (0); } else { return (-4); } } } void ldv_mutex_lock_write_reserve_mutex(struct mutex *lock ) { { if (ldv_mutex_write_reserve_mutex == 1) { } else { ldv_error(); } ldv_mutex_write_reserve_mutex = 2; return; } } int ldv_mutex_trylock_write_reserve_mutex(struct mutex *lock ) { int is_mutex_held_by_another_thread ; { if (ldv_mutex_write_reserve_mutex == 1) { } else { ldv_error(); } is_mutex_held_by_another_thread = __VERIFIER_nondet_int(); if (is_mutex_held_by_another_thread) { return (0); } else { ldv_mutex_write_reserve_mutex = 2; return (1); } } } int ldv_atomic_dec_and_mutex_lock_write_reserve_mutex(atomic_t *cnt , struct mutex *lock ) { int atomic_value_after_dec ; { if (ldv_mutex_write_reserve_mutex == 1) { } else { ldv_error(); } atomic_value_after_dec = __VERIFIER_nondet_int(); if (atomic_value_after_dec == 0) { ldv_mutex_write_reserve_mutex = 2; return (1); } else { } return (0); } } int ldv_mutex_is_locked_write_reserve_mutex(struct mutex *lock ) { int nondetermined ; { if (ldv_mutex_write_reserve_mutex == 1) { nondetermined = __VERIFIER_nondet_int(); if (nondetermined) { return (0); } else { return (1); } } else { return (1); } } } void ldv_mutex_unlock_write_reserve_mutex(struct mutex *lock ) { { if (ldv_mutex_write_reserve_mutex == 2) { } else { ldv_error(); } ldv_mutex_write_reserve_mutex = 1; return; } } void ldv_initialize(void) { { ldv_mutex_bu_mutex = 1; ldv_mutex_comp_mutex = 1; ldv_mutex_cred_guard_mutex = 1; ldv_mutex_decomp_mutex = 1; ldv_mutex_i_mutex = 1; ldv_mutex_io_mutex = 1; ldv_mutex_lock = 1; ldv_mutex_log_mutex = 1; ldv_mutex_lp_mutex = 1; ldv_mutex_mst_mutex = 1; ldv_mutex_tnc_mutex = 1; ldv_mutex_ui_mutex = 1; ldv_mutex_umount_mutex = 1; ldv_mutex_write_reserve_mutex = 1; return; } } void ldv_check_final_state(void) { { if (ldv_mutex_bu_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_comp_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_cred_guard_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_decomp_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_i_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_io_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_lock == 1) { } else { ldv_error(); } if (ldv_mutex_log_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_lp_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_mst_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_tnc_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_ui_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_umount_mutex == 1) { } else { ldv_error(); } if (ldv_mutex_write_reserve_mutex == 1) { } else { ldv_error(); } return; } } #include "model/32_7a_cilled_false-unreach-call_linux-3.8-rc1-32_7a-fs--ubifs--ubifs.ko-ldv_main3_sequence_infinite_withcheck_stateful.env.c" #include "model/common.env.c"