~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to fs/ocfs2/dcache.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <linux/slab.h>
29
29
#include <linux/namei.h>
30
30
 
31
 
#define MLOG_MASK_PREFIX ML_DCACHE
32
31
#include <cluster/masklog.h>
33
32
 
34
33
#include "ocfs2.h"
39
38
#include "file.h"
40
39
#include "inode.h"
41
40
#include "super.h"
 
41
#include "ocfs2_trace.h"
42
42
 
43
43
void ocfs2_dentry_attach_gen(struct dentry *dentry)
44
44
{
62
62
        inode = dentry->d_inode;
63
63
        osb = OCFS2_SB(dentry->d_sb);
64
64
 
65
 
        mlog_entry("(0x%p, '%.*s')\n", dentry,
66
 
                   dentry->d_name.len, dentry->d_name.name);
 
65
        trace_ocfs2_dentry_revalidate(dentry, dentry->d_name.len,
 
66
                                      dentry->d_name.name);
67
67
 
68
68
        /* For a negative dentry -
69
69
         * check the generation number of the parent and compare with the
73
73
                unsigned long gen = (unsigned long) dentry->d_fsdata;
74
74
                unsigned long pgen =
75
75
                        OCFS2_I(dentry->d_parent->d_inode)->ip_dir_lock_gen;
76
 
                mlog(0, "negative dentry: %.*s parent gen: %lu "
77
 
                        "dentry gen: %lu\n",
78
 
                        dentry->d_name.len, dentry->d_name.name, pgen, gen);
 
76
 
 
77
                trace_ocfs2_dentry_revalidate_negative(dentry->d_name.len,
 
78
                                                       dentry->d_name.name,
 
79
                                                       pgen, gen);
79
80
                if (gen != pgen)
80
81
                        goto bail;
81
82
                goto valid;
90
91
        /* did we or someone else delete this inode? */
91
92
        if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_DELETED) {
92
93
                spin_unlock(&OCFS2_I(inode)->ip_lock);
93
 
                mlog(0, "inode (%llu) deleted, returning false\n",
94
 
                     (unsigned long long)OCFS2_I(inode)->ip_blkno);
 
94
                trace_ocfs2_dentry_revalidate_delete(
 
95
                                (unsigned long long)OCFS2_I(inode)->ip_blkno);
95
96
                goto bail;
96
97
        }
97
98
        spin_unlock(&OCFS2_I(inode)->ip_lock);
101
102
         * inode nlink hits zero, it never goes back.
102
103
         */
103
104
        if (inode->i_nlink == 0) {
104
 
                mlog(0, "Inode %llu orphaned, returning false "
105
 
                     "dir = %d\n",
106
 
                     (unsigned long long)OCFS2_I(inode)->ip_blkno,
107
 
                     S_ISDIR(inode->i_mode));
 
105
                trace_ocfs2_dentry_revalidate_orphaned(
 
106
                        (unsigned long long)OCFS2_I(inode)->ip_blkno,
 
107
                        S_ISDIR(inode->i_mode));
108
108
                goto bail;
109
109
        }
110
110
 
113
113
         * redo it.
114
114
         */
115
115
        if (!dentry->d_fsdata) {
116
 
                mlog(0, "Inode %llu doesn't have dentry lock, "
117
 
                     "returning false\n",
118
 
                     (unsigned long long)OCFS2_I(inode)->ip_blkno);
 
116
                trace_ocfs2_dentry_revalidate_nofsdata(
 
117
                                (unsigned long long)OCFS2_I(inode)->ip_blkno);
119
118
                goto bail;
120
119
        }
121
120
 
123
122
        ret = 1;
124
123
 
125
124
bail:
126
 
        mlog_exit(ret);
127
 
 
 
125
        trace_ocfs2_dentry_revalidate_ret(ret);
128
126
        return ret;
129
127
}
130
128
 
181
179
 
182
180
                spin_lock(&dentry->d_lock);
183
181
                if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
184
 
                        mlog(0, "dentry found: %.*s\n",
185
 
                             dentry->d_name.len, dentry->d_name.name);
 
182
                        trace_ocfs2_find_local_alias(dentry->d_name.len,
 
183
                                                     dentry->d_name.name);
186
184
 
187
185
                        dget_dlock(dentry);
188
186
                        spin_unlock(&dentry->d_lock);
240
238
        struct dentry *alias;
241
239
        struct ocfs2_dentry_lock *dl = dentry->d_fsdata;
242
240
 
243
 
        mlog(0, "Attach \"%.*s\", parent %llu, fsdata: %p\n",
244
 
             dentry->d_name.len, dentry->d_name.name,
245
 
             (unsigned long long)parent_blkno, dl);
 
241
        trace_ocfs2_dentry_attach_lock(dentry->d_name.len, dentry->d_name.name,
 
242
                                       (unsigned long long)parent_blkno, dl);
246
243
 
247
244
        /*
248
245
         * Negative dentry. We ignore these for now.
292
289
                                (unsigned long long)parent_blkno,
293
290
                                (unsigned long long)dl->dl_parent_blkno);
294
291
 
295
 
                mlog(0, "Found: %s\n", dl->dl_lockres.l_name);
 
292
                trace_ocfs2_dentry_attach_lock_found(dl->dl_lockres.l_name,
 
293
                                (unsigned long long)parent_blkno,
 
294
                                (unsigned long long)OCFS2_I(inode)->ip_blkno);
296
295
 
297
296
                goto out_attach;
298
297
        }